dream2nix/tests/impure/default.nix
2021-11-17 17:09:25 +07:00

46 lines
653 B
Nix

{
async,
coreutils,
lib,
# dream2nix
callPackageDream,
utils,
...
}:
let
l = lib // builtins;
allTestFiles =
l.attrNames
(l.filterAttrs
(name: type: type == "regular" && l.hasPrefix "test_" name)
(l.readDir ./.));
allTests =
l.map
(file: callPackageDream ("${./.}/${file}") {})
allTestFiles;
executeAll = utils.writePureShellScript
[
async
coreutils
]
''
S=$(mktemp)
async -s=$S server --start -j4
for test in ${toString allTests}; do
async -s=$S cmd -- $test
done
async -s=$S wait
rm $S
'';
in
executeAll