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 4D7CA40DBC9 for ; Sun, 14 Nov 2010 13:55:08 -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 v8WRz8cUu8db for ; Sun, 14 Nov 2010 13:54:54 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 4909140DBD2 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 9E84B19F3336; 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 lbxxtHJeAz-M; Sun, 14 Nov 2010 22:54:40 +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 0D44619F3345; Sun, 14 Nov 2010 22:54:40 +0100 (CET) Received: from steelpick.2x.cz (unknown [213.29.198.144]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 03B40FA004; Sun, 14 Nov 2010 22:54:40 +0100 (CET) Received: from wsh by steelpick.2x.cz with local (Exim 4.72) (envelope-from ) id 1PHkX1-0002P6-Ie; Sun, 14 Nov 2010 22:54:39 +0100 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH 4/5] test: Detect unfinished subsets Date: Sun, 14 Nov 2010 22:54:31 +0100 Message-Id: <1289771672-9204-4-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:08 -0000 When test_begin_subtest is not followed by corresponding test_expect_equal, the output of the rest of the test script is errornously suppressed. Add code to detect these bugs in test scripts. --- test/test-lib.sh | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index dce9077..04a4c14 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -396,12 +396,17 @@ add_email_corpus () test_begin_subtest () { + if [ -n "$inside_subtest" ]; then + exec 1>&6 2>&7 # Restore stdout and stderr + error "bug in test script: Missing test_expect_equal in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}" + fi test_subtest_name="$1" # Remember stdout and stderr file descriptios and redirect test # output to the previously prepared file descriptors 3 and 4 (see # bellow) if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi exec 6>&1 7>&2 >&3 2>&4 + inside_subtest=t } # Pass test if two arguments match @@ -413,6 +418,7 @@ test_begin_subtest () test_expect_equal () { exec 1>&6 2>&7 # Restore stdout and stderr + inside_subtest= test "$#" = 3 && { prereq=$1; shift; } || prereq= test "$#" = 2 || error "bug in the test script: not 2 or 3 parameters to test_expect_equal" -- 1.7.2.3