From ac078469cbafe85cf771fca84f376740850d10b0 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 7 Nov 2016 14:57:51 +0100 Subject: [PATCH] tests: Do not allow tests to be run in a shared environment. * tests/openpgp/README: Update. * tests/openpgp/run-tests.scm (run-tests-parallel-shared): Drop function. (run-tests-parallel-isolated): Rename to 'run-tests-parallel'. (run-tests-sequential-shared): Drop function. (run-tests-sequential-isolated): Rename to 'run-tests-sequential'. Signed-off-by: Justus Winter --- tests/openpgp/README | 15 +++++---------- tests/openpgp/run-tests.scm | 32 ++++---------------------------- 2 files changed, 9 insertions(+), 38 deletions(-) diff --git a/tests/openpgp/README b/tests/openpgp/README index 75d818e9e..eba77b1ae 100644 --- a/tests/openpgp/README +++ b/tests/openpgp/README @@ -36,18 +36,13 @@ below. From your build directory, do: run-tests.scm [test suite runner args] *** Arguments supported by the test suite runner -The test suite runner supports four modes of operation, -{sequential,parallel}x{isolated,shared}. You can select the mode of -operation using a combination of the flags --parallel, --sequential, ---shared, and --isolated. - -By default the tests are run in sequential order, each one in a clean -environment. +The test suite runner supports two modes of operation, '--sequential' +and '--parallel'. By default the tests are run in sequential order, +each one in a clean environment. You can specify the tests to run as positional arguments relative to -srcdir (e.g. just 'version.scm'). By default all tests listed in -run-tests.scm are executed. Note that you do not have to specify -setup.scm and finish.scm, they are executed implicitly. +srcdir (e.g. just 'version.scm'). Note that you do not have to +specify setup.scm and finish.scm, they are executed implicitly. The test suite runner can be executed in any location that the current user can write to. It will create temporary files and directories, diff --git a/tests/openpgp/run-tests.scm b/tests/openpgp/run-tests.scm index 18f8b8081..0cee55908 100644 --- a/tests/openpgp/run-tests.scm +++ b/tests/openpgp/run-tests.scm @@ -109,18 +109,7 @@ (define (report) (echo (string-append (status retcode) ":") name)))))) -(define (run-tests-parallel-shared setup teardown . tests) - (setup::run-sync) - (let loop ((pool (test-pool::new '())) (tests' tests)) - (if (null? tests') - (let ((results (pool::wait))) - (for-each (lambda (t) (t::report)) results::procs) - (teardown::run-sync) - (exit (results::report))) - (let ((test (car tests'))) - (loop (pool::add (test::run-async)) (cdr tests')))))) - -(define (run-tests-parallel-isolated setup teardown . tests) +(define (run-tests-parallel setup teardown . tests) (lettmp (gpghome-tar) (setup::run-sync '--create-tarball gpghome-tar) (let loop ((pool (test-pool::new '())) (tests' tests)) @@ -140,16 +129,7 @@ (setup'::run-sync-quiet '--unpack-tarball gpghome-tar) (loop (pool::add (test'::run-async)) (cdr tests'))))))) -(define (run-tests-sequential-shared setup teardown . tests) - (let loop ((pool (test-pool::new '())) - (tests' `(,setup ,@tests ,teardown))) - (if (null? tests') - (let ((results (pool::wait))) - (exit (results::report))) - (let ((test (car tests'))) - (loop (pool::add (test::run-sync)) (cdr tests')))))) - -(define (run-tests-sequential-isolated setup teardown . tests) +(define (run-tests-sequential setup teardown . tests) (lettmp (gpghome-tar) (setup::run-sync '--create-tarball gpghome-tar) (let loop ((pool (test-pool::new '())) (tests' tests)) @@ -170,12 +150,8 @@ (loop (pool::add (test'::run-sync)) (cdr tests'))))))) (let* ((runner (if (member "--parallel" *args*) - (if (member "--shared" *args*) - run-tests-parallel-shared - run-tests-parallel-isolated) - (if (member "--shared" *args*) - run-tests-sequential-shared - run-tests-sequential-isolated))) + run-tests-parallel + run-tests-sequential)) (tests (filter (lambda (arg) (not (string-prefix? arg "--"))) *args*))) (apply runner (append (list (test::scm "setup.scm") (test::scm "finish.scm")) (map test::scm tests))))