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 0F45C431FD9 for ; Fri, 6 Sep 2013 08:05:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 6QkJtuRMXNQu for ; Fri, 6 Sep 2013 08:05:50 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 67BAA431FBD for ; Fri, 6 Sep 2013 08:05:50 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id DA55B100063; Fri, 6 Sep 2013 18:05:45 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH 1/1] test: exit with nonzero value when not all tests completed successfully Date: Fri, 6 Sep 2013 18:05:35 +0300 Message-Id: <1378479935-26312-1-git-send-email-tomi.ollila@iki.fi> X-Mailer: git-send-email 1.8.0 Cc: tomi.ollila@iki.fi 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: Fri, 06 Sep 2013 15:05:57 -0000 If any of the tests in our test system is not passing the execution of the test suite completes with nonzero exit value. It is better to rely on the exit value of the test system instead of some arbitrary strings in test output (or use both). --- test/aggregate-results.sh | 5 +++++ test/notmuch-test | 3 +++ 2 files changed, 8 insertions(+) diff --git a/test/aggregate-results.sh b/test/aggregate-results.sh index 732d6ca..5193d7f 100755 --- a/test/aggregate-results.sh +++ b/test/aggregate-results.sh @@ -49,10 +49,12 @@ pluralize () { } echo "Notmuch test suite complete." +ev=1 if [ "$fixed" = "0" ] && [ "$failed" = "0" ]; then tests=$(pluralize "test" $total) printf "All $total $tests " if [ "$broken" = "0" ]; then + ev=0 echo "passed." else failures=$(pluralize "failure" $broken) @@ -76,6 +78,9 @@ fi skipped=$(($total - $fixed - $success - $failed - $broken)) if [ "$skipped" != "0" ]; then + ev=1 tests=$(pluralize "test" $skipped) echo "$skipped $tests skipped." fi + +exit $ev diff --git a/test/notmuch-test b/test/notmuch-test index 6db7979..aa28bb0 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -97,6 +97,9 @@ trap - HUP INT TERM # Report results ./aggregate-results.sh test-results/* +ev=$? # Clean up rm -rf test-results corpus.mail + +exit $ev -- 1.7.10.4