From 0bf16d702665a269ce5ef724c927fbbd8f7f1ce9 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 19 Dec 2016 17:23:56 +0100 Subject: [PATCH] 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 --- tests/openpgp/run-tests.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/openpgp/run-tests.scm b/tests/openpgp/run-tests.scm index 414641199..546d7d497 100644 --- a/tests/openpgp/run-tests.scm +++ b/tests/openpgp/run-tests.scm @@ -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)))