]> git.notmuchmail.org Git - notmuch/commitdiff
test: allow disabling timeout with NOTMUCH_TEST_TIMEOUT=0
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 20 May 2019 23:25:35 +0000 (19:25 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 25 May 2019 11:26:41 +0000 (08:26 -0300)
To aid in diagnosing test suite tooling that interacts poorly with
coreutils' timeout, it's handy to be able to bypass it entirely.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
test/notmuch-test

index 8e483383f79d67aa7d87c04949e51407ddb7542d..50ed87219f3cb0793208aca2c3eed3e1199c5ce0 100755 (executable)
@@ -33,8 +33,13 @@ rm -rf $NOTMUCH_BUILDDIR/test/test-results
 # Test for timeout utility
 if command -v timeout >/dev/null; then
     TEST_TIMEOUT=${NOTMUCH_TEST_TIMEOUT:-2m}
-    TEST_TIMEOUT_CMD="timeout $TEST_TIMEOUT"
-    echo "INFO: using $TEST_TIMEOUT timeout for tests"
+    if [ "$TEST_TIMEOUT" = 0 ]; then
+        TEST_TIMEOUT_CMD=""
+        echo "INFO: timeout disabled"
+    else
+        TEST_TIMEOUT_CMD="timeout $TEST_TIMEOUT"
+        echo "INFO: using $TEST_TIMEOUT timeout for tests"
+    fi
 else
     TEST_TIMEOUT_CMD=""
 fi