[PATCH 3/5] test: Break on test script (or other) error
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 14 Nov 2010 21:54:30 +0000 (22:54 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:30 +0000 (09:37 -0800)
ec/5eb64ad112e885a735f2d06627286327a42b6f [new file with mode: 0644]

diff --git a/ec/5eb64ad112e885a735f2d06627286327a42b6f b/ec/5eb64ad112e885a735f2d06627286327a42b6f
new file mode 100644 (file)
index 0000000..c9101c0
--- /dev/null
@@ -0,0 +1,104 @@
+Return-Path: <sojkam1@fel.cvut.cz>\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 8D75740DBF6\r
+       for <notmuch@notmuchmail.org>; Sun, 14 Nov 2010 13:55:06 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.9\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9] autolearn=ham\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 DwyAyD9R9v3d for <notmuch@notmuchmail.org>;\r
+       Sun, 14 Nov 2010 13:54:53 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 06A2540DBC9\r
+       for <notmuch@notmuchmail.org>; Sun, 14 Nov 2010 13:54:42 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.4])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 5AE6B19F331D;\r
+       Sun, 14 Nov 2010 22:54:41 +0100 (CET)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id ONu3IbyDs2jj; Sun, 14 Nov 2010 22:54:39 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id D123E19F3342;\r
+       Sun, 14 Nov 2010 22:54:39 +0100 (CET)\r
+Received: from steelpick.2x.cz (unknown [213.29.198.144])\r
+       (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id BBEACFA004;\r
+       Sun, 14 Nov 2010 22:54:39 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.72)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1PHkX1-0002P3-Bh; Sun, 14 Nov 2010 22:54:39 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/5] test: Break on test script (or other) error\r
+Date: Sun, 14 Nov 2010 22:54:30 +0100\r
+Message-Id: <1289771672-9204-3-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 1.7.2.3\r
+In-Reply-To: <87hbfjr2sr.fsf@steelpick.2x.cz>\r
+References: <87hbfjr2sr.fsf@steelpick.2x.cz>\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: Sun, 14 Nov 2010 21:55:07 -0000\r
+\r
+Break notmuch-test whenever a test script returns non-zero status.\r
+This happens either when some test from the script fails or when there\r
+is an error in the script.\r
+\r
+This is especially useful in the latter case since the error may not\r
+appear in the final aggregated results.\r
+---\r
+ test/notmuch-test |   12 +++++++++++-\r
+ 1 files changed, 11 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/test/notmuch-test b/test/notmuch-test\r
+index b51045a..055467f 100755\r
+--- a/test/notmuch-test\r
++++ b/test/notmuch-test\r
+@@ -14,12 +14,20 @@ if [ ${BASH_VERSINFO[0]} -lt 4 ]; then\r
+     exit 1\r
+ fi\r
\r
++set -e\r
++\r
++die () {\r
++    echo >&2 "Unexpected failure"\r
++}\r
++\r
++trap 'die' 0\r
++\r
+ cd $(dirname "$0")\r
\r
+ TESTS="basic new search json thread-naming raw reply dump-restore uuencode thread-order author-order from-guessing long-id encoding emacs maildir-sync"\r
\r
+ # Clean up any results from a previous run\r
+-rm -r test-results >/dev/null 2>/dev/null\r
++rm -rf test-results >/dev/null 2>/dev/null\r
\r
+ # Run the tests\r
+ for test in $TESTS; do\r
+@@ -31,3 +39,5 @@ done\r
\r
+ # Clean up\r
+ rm -r test-results corpus.mail\r
++\r
++trap '' 0\r
+-- \r
+1.7.2.3\r
+\r