1 Return-Path: <tomi.ollila@iki.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 1F7C6431FAF
\r
6 for <notmuch@notmuchmail.org>; Tue, 27 Nov 2012 23:25:12 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id q6qaPtFzYEre for <notmuch@notmuchmail.org>;
\r
16 Tue, 27 Nov 2012 23:25:11 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 0EE59431FAE
\r
19 for <notmuch@notmuchmail.org>; Tue, 27 Nov 2012 23:25:11 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 4FFC31000E5;
\r
22 Wed, 28 Nov 2012 09:25:07 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH] test: Abort driver if a test script aborts
\r
26 In-Reply-To: <1354075997-29140-1-git-send-email-amdragon@mit.edu>
\r
27 References: <1354075997-29140-1-git-send-email-amdragon@mit.edu>
\r
28 User-Agent: Notmuch/0.14+116~g29fcdb5 (http://notmuchmail.org) Emacs/24.2.1
\r
29 (x86_64-unknown-linux-gnu)
\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
31 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
32 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
33 Date: Wed, 28 Nov 2012 09:25:07 +0200
\r
34 Message-ID: <m28v9mxk8c.fsf@guru.guru-group.fi>
\r
36 Content-Type: text/plain
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.13
\r
40 List-Id: "Use and development of the notmuch mail system."
\r
41 <notmuch.notmuchmail.org>
\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
45 List-Post: <mailto:notmuch@notmuchmail.org>
\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
49 X-List-Received-Date: Wed, 28 Nov 2012 07:25:12 -0000
\r
51 On Wed, Nov 28 2012, Austin Clements <amdragon@MIT.EDU> wrote:
\r
53 > Previously, if a test script aborted (e.g., because it passed too few
\r
54 > arguments to a test function), the test driver loop would simply
\r
55 > continue on to the next test script and the final results would
\r
56 > declare that everything passed (except that the test count would look
\r
57 > suspiciously low, but maybe you just misremembered how many tests
\r
60 > Now, if a test script exits with a non-zero status and did not produce
\r
61 > a final results file, we propagate that failure out of the driver loop
\r
64 > To keep this simple, this patch removes the PID from the test-results
\r
65 > file name. This PID was inherited from the git test system and seems
\r
66 > unnecessary, since the file name already includes the name of the test
\r
67 > script and the test-results directory is created anew for each run.
\r
76 > test/notmuch-test | 6 ++++++
\r
77 > test/test-lib.sh | 2 +-
\r
78 > 3 files changed, 8 insertions(+), 2 deletions(-)
\r
80 > diff --git a/test/basic b/test/basic
\r
81 > index 1b842d2..b7feb07 100755
\r
84 > @@ -79,7 +79,7 @@ test_begin_subtest "Ensure that -v does not suppress test output"
\r
85 > output=$(cd $TEST_DIRECTORY; ./test-verbose -v 2>&1 | suppress_diff_date)
\r
86 > expected=$(cat $EXPECTED/test-verbose-yes | suppress_diff_date)
\r
87 > # Do not include the results of test-verbose in totals
\r
88 > -rm $TEST_DIRECTORY/test-results/test-verbose-*
\r
89 > +rm $TEST_DIRECTORY/test-results/test-verbose
\r
90 > rm -r $TEST_DIRECTORY/tmp.test-verbose
\r
91 > test_expect_equal "$output" "$expected"
\r
93 > diff --git a/test/notmuch-test b/test/notmuch-test
\r
94 > index 9a1b375..f275439 100755
\r
95 > --- a/test/notmuch-test
\r
96 > +++ b/test/notmuch-test
\r
97 > @@ -81,6 +81,12 @@ trap 'e=$?; kill $!; exit $e' HUP INT TERM
\r
98 > for test in $TESTS; do
\r
99 > $TEST_TIMEOUT_CMD ./$test "$@" &
\r
101 > + # If the test failed without producing results, then it aborted,
\r
102 > + # so we should abort, too.
\r
104 > + if [[ $RES != 0 && ! -e "test-results/${test%.sh}" ]]; then
\r
108 > trap - HUP INT TERM
\r
110 > diff --git a/test/test-lib.sh b/test/test-lib.sh
\r
111 > index e092231..77063a4 100644
\r
112 > --- a/test/test-lib.sh
\r
113 > +++ b/test/test-lib.sh
\r
114 > @@ -920,7 +920,7 @@ test_done () {
\r
116 > test_results_dir="$TEST_DIRECTORY/test-results"
\r
117 > mkdir -p "$test_results_dir"
\r
118 > - test_results_path="$test_results_dir/${0%.sh}-$$"
\r
119 > + test_results_path="$test_results_dir/${0%.sh}"
\r
121 > echo "total $test_count" >> $test_results_path
\r
122 > echo "success $test_success" >> $test_results_path
\r
126 > _______________________________________________
\r
127 > notmuch mailing list
\r
128 > notmuch@notmuchmail.org
\r
129 > http://notmuchmail.org/mailman/listinfo/notmuch
\r