diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-05-27 01:24:20 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-05-27 01:24:20 -0400 |
commit | 921eb00c131fe0c6f0834f2556e7597424a3ba49 (patch) | |
tree | 04acf5223dd4978013d75d8f85e811e0756852c2 /source/merge.d | |
parent | 97ebb43d26d3e452f6ac8995f212ba971aefc231 (diff) | |
download | dm-921eb00c131fe0c6f0834f2556e7597424a3ba49.tar.gz |
Better testing
Diffstat (limited to 'source/merge.d')
-rw-r--r-- | source/merge.d | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/merge.d b/source/merge.d index f63a5da..7de55fe 100644 --- a/source/merge.d +++ b/source/merge.d @@ -150,6 +150,11 @@ auto integration_test(ref Conda conda, string outdir, test_runner_t runner, test import std.random : randomSample; import std.utf : byCodeUnit; + auto id = letters.byCodeUnit.randomSample(6).to!string; + string basetemp = tempDir.buildPath("dm_testable_" ~ id); + basetemp.mkdir; + scope(exit) basetemp.rmdirRecurse; + string cwd = getcwd().absolutePath; scope (exit) cwd.chdir; string repo_root = buildPath(outdir, pkg.repo.baseName) @@ -158,14 +163,14 @@ auto integration_test(ref Conda conda, string outdir, test_runner_t runner, test if (!repo_root.exists) { if (conda.sh("git clone --recursive " ~ pkg.repo ~ " " ~ repo_root)) { - exit(1); + return 1; } } repo_root.chdir; if (conda.sh("git checkout " ~ pkg.head)) { - exit(1); + return 1; } foreach (string found; conda.scan_packages(repo_root.baseName ~ "*")) { @@ -177,25 +182,20 @@ auto integration_test(ref Conda conda, string outdir, test_runner_t runner, test if (runner.requires) { if (conda.sh("python -m pip install -r " ~ runner.requires)) { - exit(1); + return 1; } } if (conda.sh("python -m pip install .[test]")) { - exit(1); + return 1; } if (conda.sh("python setup.py egg_info")) { - exit(1); + return 1; } - auto id = letters.byCodeUnit.randomSample(6).to!string; - string basetemp = tempDir.buildPath("dm_testable" ~ id); - basetemp.mkdir; - scope(exit) basetemp.rmdirRecurse; - if (conda.sh(runner.program ~ " " ~ runner.args ~ " --basetemp=" ~ basetemp) > 1) { - exit(1); + return 1; } return 0; } |