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 <justus@g10code.com>
This commit is contained in:
Justus Winter 2016-11-07 14:57:51 +01:00
parent 37751d2b19
commit ac078469cb
2 changed files with 9 additions and 38 deletions

View File

@ -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,

View File

@ -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))))