diff options
author | Timo Kaufmann <timokau@zoho.com> | 2018-11-24 18:58:29 +0100 |
---|---|---|
committer | Timo Kaufmann <timokau@zoho.com> | 2018-11-24 23:14:38 +0100 |
commit | e28a8ed2878633c7f4e343a6dff6d6a6a4ce2d4d (patch) | |
tree | 25a02f52b51667f7b7de8098282c53f60a16cdfd /pkgs/applications | |
parent | 21f9123ea6b0a5d5ec13f06513d29668ae79c799 (diff) | |
download | nixlib-e28a8ed2878633c7f4e343a6dff6d6a6a4ce2d4d.tar nixlib-e28a8ed2878633c7f4e343a6dff6d6a6a4ce2d4d.tar.gz nixlib-e28a8ed2878633c7f4e343a6dff6d6a6a4ce2d4d.tar.bz2 nixlib-e28a8ed2878633c7f4e343a6dff6d6a6a4ce2d4d.tar.lz nixlib-e28a8ed2878633c7f4e343a6dff6d6a6a4ce2d4d.tar.xz nixlib-e28a8ed2878633c7f4e343a6dff6d6a6a4ce2d4d.tar.zst nixlib-e28a8ed2878633c7f4e343a6dff6d6a6a4ce2d4d.zip |
sage: add some flexibility to the test runner
Make it possible to run individual tests. This is very useful while git-bisecting.
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/science/math/sage/sage-tests.nix | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/pkgs/applications/science/math/sage/sage-tests.nix b/pkgs/applications/science/math/sage/sage-tests.nix index fdaf32a88ab3..feccf75a7acb 100644 --- a/pkgs/applications/science/math/sage/sage-tests.nix +++ b/pkgs/applications/science/math/sage/sage-tests.nix @@ -1,15 +1,30 @@ { stdenv +, lib , sage-with-env , makeWrapper +, files ? null # "null" means run all tests +, longTests ? true # run tests marked as "long time" }: +# for a quick test of some source files: +# nix-build -E 'with (import ./. {}); sage.tests.override { files = [ "src/sage/misc/cython.py" ];}' + +let + src = sage-with-env.env.lib.src; + runAllTests = files == null; + testArgs = if runAllTests then "--all" else testFileList; + patienceSpecifier = if longTests then "--long" else ""; + relpathToArg = relpath: lib.escapeShellArg "${src}/${relpath}"; # paths need to be absolute + testFileList = lib.concatStringsSep " " (map relpathToArg files); +in stdenv.mkDerivation rec { version = src.version; name = "sage-tests-${version}"; - src = sage-with-env.env.lib.src; + inherit src; buildInputs = [ makeWrapper + sage-with-env ]; unpackPhase = "#do nothing"; @@ -31,6 +46,6 @@ stdenv.mkDerivation rec { mkdir -p "$HOME" # "--long" tests are in the order of 1h, without "--long" its 1/2h - "$out/bin/sage" -t --nthreads "$NIX_BUILD_CORES" --optional=sage --long --all + "sage" -t --nthreads "$NIX_BUILD_CORES" --optional=sage ${patienceSpecifier} ${testArgs} ''; } |