mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-30 09:52:03 +03:00
46 lines
653 B
Nix
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
|