tests: Use sequential test runner if only one test is given.

* tests/openpgp/run-tests.scm: Use sequential test runner if only one
test is given.
--

This allows one to set the environment variable TESTFLAGS to
'--parallel' and enjoy faster test execution times without interfering
with stdio when one works on a single test.

Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-12-19 17:23:56 +01:00
parent 63c7bf1a62
commit 0bf16d7026
1 changed files with 4 additions and 3 deletions

View File

@ -26,9 +26,10 @@
;; Set objdir so that the tests can locate built programs.
(setenv "objdir" (getcwd) #f)
(let* ((runner (if (member "--parallel" *args*)
(let* ((tests (filter (lambda (arg) (not (string-prefix? arg "--"))) *args*))
(runner (if (and (member "--parallel" *args*)
(> (length tests) 1))
run-tests-parallel
run-tests-sequential))
(tests (filter (lambda (arg) (not (string-prefix? arg "--"))) *args*)))
run-tests-sequential)))
(runner (test::scm "setup.scm" "setup.scm")
(map (lambda (t) (test::scm t t)) tests)))