dream2nix/tests/unit/default.nix
DavHau 3a293cc914 automatic unit tests for pure translators
- translators can now enable unit tests via `generateUnitTestsForProjects`
2022-04-24 12:04:08 +02:00

28 lines
404 B
Nix

{
self,
lib,
coreutils,
nix,
python3,
utils,
dream2nixWithExternals,
...
}: let
l = lib // builtins;
pythonEnv = python3.withPackages (ps:
with ps; [
pytest
pytest-xdist
]);
in
utils.writePureShellScript
[
coreutils
nix
]
''
export dream2nixSrc=${dream2nixWithExternals}
${pythonEnv}/bin/pytest ${self}/tests/unit -n $(nproc) -v "$@"
''