tests-examples: allow passing arguments

This commit is contained in:
DavHau 2022-05-18 20:42:05 +02:00
parent 2fd96e44e9
commit b5d473e2e8

View File

@ -24,12 +24,13 @@
] ]
'' ''
dir=$1 dir=$1
shift
echo -e \"\ntesting example for $dir\" echo -e \"\ntesting example for $dir\"
cp -r ${examples}/$dir/* . cp -r ${examples}/$dir/* .
chmod -R +w . chmod -R +w .
nix flake lock --override-input dream2nix ${../../.} nix flake lock --override-input dream2nix ${../../.}
nix run .#resolveImpure nix run .#resolveImpure
nix flake check nix flake check "$@"
''; '';
in in
utils.writePureShellScript utils.writePureShellScript
@ -41,6 +42,8 @@ in
if [ -z ''${1+x} ]; then if [ -z ''${1+x} ]; then
parallel -j$(nproc) -a <(ls ${examples}) ${testScript} parallel -j$(nproc) -a <(ls ${examples}) ${testScript}
else else
${testScript} $1 arg1=$1
shift
${testScript} $arg1 "$@"
fi fi
'' ''