[PATCH 1/1] test: check that expected results file exists when test script exits...
authorTomi Ollila <tomi.ollila@iki.fi>
Wed, 15 Jan 2014 18:58:27 +0000 (20:58 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:59:04 +0000 (09:59 -0800)
ad/1e7374f72d2392382117b9307929487bacffa0 [new file with mode: 0644]

diff --git a/ad/1e7374f72d2392382117b9307929487bacffa0 b/ad/1e7374f72d2392382117b9307929487bacffa0
new file mode 100644 (file)
index 0000000..4d6c21b
--- /dev/null
@@ -0,0 +1,82 @@
+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 EB944431FBF\r
+       for <notmuch@notmuchmail.org>; Wed, 15 Jan 2014 10:58:39 -0800 (PST)\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 ATKt1Erdp0T7 for <notmuch@notmuchmail.org>;\r
+       Wed, 15 Jan 2014 10:58:34 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 59F0B431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 15 Jan 2014 10:58:34 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 6E1A51001E5; Wed, 15 Jan 2014 20:58:29 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] test: check that expected results file exists when test\r
+       script exits != 0\r
+Date: Wed, 15 Jan 2014 20:58:27 +0200\r
+Message-Id: <1389812307-17065-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.8.0\r
+In-Reply-To: <877ga2jdf6.fsf@zancas.localnet>\r
+References: <877ga2jdf6.fsf@zancas.localnet>\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: Wed, 15 Jan 2014 18:58:40 -0000\r
+\r
+This way tests continue to run after one test script does not\r
+report success.\r
+---\r
+\r
+I failed to notice this when MANUALLY testing the test change in question.\r
+\r
+This is quick fix and makes notmuch-test & test-lib.sh have interdependency\r
+how to modify the test script name for output file. I'll think whether\r
+there is something to be made about this, meanwhile I'm open to suggestions\r
+to that. too.\r
+\r
+ test/notmuch-test | 4 +++-\r
+ 1 file changed, 3 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/test/notmuch-test b/test/notmuch-test\r
+index b843712..ecf81a9 100755\r
+--- a/test/notmuch-test\r
++++ b/test/notmuch-test\r
+@@ -32,12 +32,14 @@ fi\r
+ trap 'e=$?; kill $!; exit $e' HUP INT TERM\r
+ # Run the tests\r
+ for test in $TESTS; do\r
++    this_test=${test%.sh}\r
++    this_test=${this_test#T[0-9][0-9][0-9]-}\r
+     $TEST_TIMEOUT_CMD ./$test "$@" &\r
+     wait $!\r
+     # If the test failed without producing results, then it aborted,\r
+     # so we should abort, too.\r
+     RES=$?\r
+-    if [[ $RES != 0 && ! -e "test-results/${test%.sh}" ]]; then\r
++    if [[ $RES != 0 && ! -e "test-results/$this_test" ]]; then\r
+         exit $RES\r
+     fi\r
+ done\r
+-- \r
+1.8.0\r
+\r