]> git.notmuchmail.org Git - notmuch/commitdiff
tests: environment variable to specify that tests should be serialized
authorJameson Graef Rollins <jrollins@finestructure.net>
Mon, 6 May 2019 04:44:09 +0000 (04:44 +0000)
committerDavid Bremner <david@tethera.net>
Tue, 7 May 2019 09:55:31 +0000 (06:55 -0300)
If NOTMUCH_TEST_SERIALIZE is non-null all tests will be run in series,
rather than in parallel.

test/README
test/notmuch-test

index b378c3ff3c5fa3a60b9758f52abd3c731d69ccfe..3f54af58876f324a851565a1e8b16633b61d5b08 100644 (file)
@@ -43,7 +43,6 @@ these system tools. Most often the tests are written, reviewed and
 tested on Linux system so such portability issues arise from time to
 time.
 
 tested on Linux system so such portability issues arise from time to
 time.
 
-
 Running Tests
 -------------
 The easiest way to run tests is to say "make test", (or simply run the
 Running Tests
 -------------
 The easiest way to run tests is to say "make test", (or simply run the
@@ -105,9 +104,14 @@ to with emacs, e.g.
 
      make test TEST_CC=gcc TEST_CFLAGS="-g -O2"
 
 
      make test TEST_CC=gcc TEST_CFLAGS="-g -O2"
 
+Parallel Execution
+------------------
+If either the moreutils or GNU "parallel" utility is available all
+tests will be run in parallel.  If the NOTMUCH_TEST_SERIALIZE variable
+is non-null all tests will be executed sequentially.
+
 Quiet Execution
 ---------------
 Quiet Execution
 ---------------
-
 Normally, when new script starts and when test PASSes you get a message
 printed on screen. This printing can be disabled by setting the
 NOTMUCH_TEST_QUIET variable to a non-null value. Message on test
 Normally, when new script starts and when test PASSes you get a message
 printed on screen. This printing can be disabled by setting the
 NOTMUCH_TEST_QUIET variable to a non-null value. Message on test
index a4b7a1eb0b54dfbbda2c24ce7603424e7ed887c3..bd3e080af01e47218e1d804f093cbd414b0d12e5 100755 (executable)
@@ -40,7 +40,7 @@ fi
 
 trap 'e=$?; kill $!; exit $e' HUP INT TERM
 # Run the tests
 
 trap 'e=$?; kill $!; exit $e' HUP INT TERM
 # Run the tests
-if command -v parallel >/dev/null ; then
+if test -z "$NOTMUCH_TEST_SERIALIZE" && command -v parallel >/dev/null ; then
     if parallel -h | grep -q GNU ; then
         echo "INFO: running tests with GNU parallel"
         printf '%s\n' $TESTS | $TEST_TIMEOUT_CMD parallel
     if parallel -h | grep -q GNU ; then
         echo "INFO: running tests with GNU parallel"
         printf '%s\n' $TESTS | $TEST_TIMEOUT_CMD parallel