[PATCH] test: make all tests terminable with Ctrl-c

Tomi Ollila tomi.ollila at iki.fi
Tue Nov 8 08:02:25 PST 2011


Some tests don't break when HUP signal is sent tho those (by
pressing ctrl-c on the terminal). Therefore, the top-level
test script catches the HUP and sends TERM signal to the
started test script.
---
 test/notmuch-test |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/test/notmuch-test b/test/notmuch-test
index 738f8f6..b38c2c6 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -57,10 +57,13 @@ else
     TEST_TIMEOUT_CMD=""
 fi
 
+trap 'e=$?; kill $!; exit $e' HUP INT TERM
 # Run the tests
 for test in $TESTS; do
-    $TEST_TIMEOUT_CMD ./$test "$@"
+    $TEST_TIMEOUT_CMD ./$test "$@" &
+    wait $!
 done
+trap - HUP INT TERM
 
 # Report results
 ./aggregate-results.sh test-results/*
-- 
1.7.6.2



More information about the notmuch mailing list