Improve test apps
* Allow running test apps in repo root (e.g. `nix run ./tests#runTests`) * Pass argv to cabal to allow filtering tests with `-m` * Use `cabal run spec` rather than `cabal test`
This commit is contained in:
parent
9e2f3895e9
commit
ec9f9f98d8
2 changed files with 15 additions and 5 deletions
|
|
@ -18,7 +18,17 @@
|
|||
program = lib.getExe (
|
||||
pkgs.writeShellApplication {
|
||||
inherit name runtimeInputs;
|
||||
text = script;
|
||||
text = ''
|
||||
if ! [ -e jail-nix-tests.cabal ]; then
|
||||
if [ -e tests/jail-nix-tests.cabal ]; then
|
||||
cd tests
|
||||
else
|
||||
echo "${name} must be called in repo root or tests directory"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
${script}
|
||||
'';
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
@ -36,7 +46,7 @@
|
|||
(lib.concatStringsSep " ")
|
||||
(lib.toShellVar "NIX_PATH")
|
||||
]
|
||||
} cabal test
|
||||
} cabal run spec -- "$@"
|
||||
'';
|
||||
|
||||
apps.x86_64-linux.checkFmt = mkApp "check-fmt" [ pkgs.nixfmt-tree ] "treefmt --ci";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue