[PATCH] test: make all tests terminable with Ctrl-c
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 8 Nov 2011 16:02:25 +0000 (18:02 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:02 +0000 (09:40 -0800)
58/502b3963f745a10b71081140782c628e4cfe84 [new file with mode: 0644]

diff --git a/58/502b3963f745a10b71081140782c628e4cfe84 b/58/502b3963f745a10b71081140782c628e4cfe84
new file mode 100644 (file)
index 0000000..631863d
--- /dev/null
@@ -0,0 +1,81 @@
+Return-Path: <tomi.ollila@nixu.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 8C5CC429E27\r
+       for <notmuch@notmuchmail.org>; Tue,  8 Nov 2011 08:02:30 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id vW5VFaI7c3wp for <notmuch@notmuchmail.org>;\r
+       Tue,  8 Nov 2011 08:02:28 -0800 (PST)\r
+Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id A41B1431FB6\r
+       for <notmuch@notmuchmail.org>; Tue,  8 Nov 2011 08:02:28 -0800 (PST)\r
+Received: from taco2.nixu.fi (taco2.nixu.fi [194.197.118.31])\r
+       by taco2.nixu.fi (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id\r
+       pA8G2P4H019845\r
+       for <notmuch@notmuchmail.org>; Tue, 8 Nov 2011 18:02:26 +0200\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: <notmuch@notmuchmail.org>\r
+Subject: [PATCH] test: make all tests terminable with Ctrl-c\r
+User-Agent: Notmuch/0.9+23~g556c5fa (http://notmuchmail.org) Emacs/23.3.1\r
+       (i686-pc-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Tue, 08 Nov 2011 18:02:25 +0200\r
+Message-ID: <yf6obwm1u26.fsf@taco2.nixu.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 08 Nov 2011 16:02:30 -0000\r
+\r
+Some tests don't break when HUP signal is sent tho those (by\r
+pressing ctrl-c on the terminal). Therefore, the top-level\r
+test script catches the HUP and sends TERM signal to the\r
+started test script.\r
+---\r
+ test/notmuch-test |    5 ++++-\r
+ 1 files changed, 4 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/test/notmuch-test b/test/notmuch-test\r
+index 738f8f6..b38c2c6 100755\r
+--- a/test/notmuch-test\r
++++ b/test/notmuch-test\r
+@@ -57,10 +57,13 @@ else\r
+     TEST_TIMEOUT_CMD=""\r
+ fi\r
\r
++trap 'e=$?; kill $!; exit $e' HUP INT TERM\r
+ # Run the tests\r
+ for test in $TESTS; do\r
+-    $TEST_TIMEOUT_CMD ./$test "$@"\r
++    $TEST_TIMEOUT_CMD ./$test "$@" &\r
++    wait $!\r
+ done\r
++trap - HUP INT TERM\r
\r
+ # Report results\r
+ ./aggregate-results.sh test-results/*\r
+-- \r
+1.7.6.2\r
+\r