[PATCH 1/1] test: exit with nonzero value when not all tests completed successfully
authorTomi Ollila <tomi.ollila@iki.fi>
Fri, 6 Sep 2013 15:05:35 +0000 (18:05 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:59 +0000 (09:56 -0800)
be/08f090bfd6662a68e142c471c1a53ed1795224 [new file with mode: 0644]

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