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 D8B70429E36 for ; Thu, 17 Nov 2011 05:06:35 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled 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 1oeUwnRjjhFJ for ; Thu, 17 Nov 2011 05:06:34 -0800 (PST) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id BEA4D429E37 for ; Thu, 17 Nov 2011 05:06:31 -0800 (PST) Received: by mail-bw0-f53.google.com with SMTP id q10so2108356bka.26 for ; Thu, 17 Nov 2011 05:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; bh=fQ3NP9/UoQnEjXReAX4S7QA127u2pjlZTGmrqY1lPJk=; b=n5kg4e2IsKP04CkwpbKE5AdaYPkSr2/ESxtBDJBtkc1yysh88R8B+D0eIHMpgiHcOf 3afykFLG9qLiBaEgpaDF+YxyFZRbTgImstYf+W5vOqp+F9CW94ln70bRi87su+jB5eZj jx8BDTdApyFjB2selWigeztR67yJUet/9pe1M= Received: by 10.204.156.150 with SMTP id x22mr33537401bkw.86.1321535191219; Thu, 17 Nov 2011 05:06:31 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id j9sm41234411bkd.2.2011.11.17.05.06.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Nov 2011 05:06:30 -0800 (PST) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH v2 03/10] test: add test state reset to test_expect_* functions that did not have it Date: Thu, 17 Nov 2011 17:05:56 +0400 Message-Id: <1321535163-4895-4-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.7.2 In-Reply-To: <1321535163-4895-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1321535163-4895-1-git-send-email-dmitry.kurochkin@gmail.com> 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: Thu, 17 Nov 2011 13:06:36 -0000 --- test/test-lib.sh | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index ff85848..f21e45e 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -622,82 +622,85 @@ test_skip () { test_reset_state_ say_color skip >&3 "skipping test: $@" say_color skip "%-6s" "SKIP" echo " $1" : true ;; *) false ;; esac } test_subtest_known_broken () { test_subtest_known_broken_=t } test_expect_success () { test "$#" = 3 && { prereq=$1; shift; } || prereq= test "$#" = 2 || error "bug in the test script: not 2 or 3 parameters to test-expect-success" + test_reset_state_ if ! test_skip "$@" then test_run_ "$2" if [ "$?" = 0 -a "$eval_ret" = 0 ] then test_ok_ "$1" else test_failure_ "$@" fi fi } test_expect_code () { test "$#" = 4 && { prereq=$1; shift; } || prereq= test "$#" = 3 || error "bug in the test script: not 3 or 4 parameters to test-expect-code" + test_reset_state_ if ! test_skip "$@" then test_run_ "$3" if [ "$?" = 0 -a "$eval_ret" = "$1" ] then test_ok_ "$2" else test_failure_ "$@" fi fi } # test_external runs external test scripts that provide continuous # test output about their progress, and succeeds/fails on # zero/non-zero exit code. It outputs the test output on stdout even # in non-verbose mode, and announces the external script with "* run # : ..." before running it. When providing relative paths, keep in # mind that all scripts run in "trash directory". # Usage: test_external description command arguments... # Example: test_external 'Perl API' perl ../path/to/test.pl test_external () { test "$#" = 4 && { prereq=$1; shift; } || prereq= test "$#" = 3 || error >&5 "bug in the test script: not 3 or 4 parameters to test_external" descr="$1" shift + test_reset_state_ if ! test_skip "$descr" "$@" then # Announce the script to reduce confusion about the # test output that follows. say_color "" " run $test_count: $descr ($*)" # Run command; redirect its stderr to &4 as in # test_run_, but keep its stdout on our stdout even in # non-verbose mode. "$@" 2>&4 if [ "$?" = 0 ] then test_ok_ "$descr" else test_failure_ "$descr" "$@" fi fi } # Like test_external, but in addition tests that the command generated # no output on stderr. -- 1.7.7.2