Patchworkβ test: make all tests terminable with Ctrl-c

login
register
about
Submitter Tomi Ollila
Date 2011-11-08 16:02:25
Message ID <yf6obwm1u26.fsf@taco2.nixu.fi>
Download mbox | patch
Permalink /patch/1475/
State New
Headers show

Comments

Tomi Ollila - 2011-11-08 16:02:25
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(-)

Patch

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/*