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