1 Return-Path: <too@guru-group.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 F27F2431FB6
\r
6 for <notmuch@notmuchmail.org>; Thu, 5 Dec 2013 04:46:18 -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 8bzz4As-IuXL for <notmuch@notmuchmail.org>;
\r
16 Thu, 5 Dec 2013 04:46:14 -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 74EB5431FAE
\r
19 for <notmuch@notmuchmail.org>; Thu, 5 Dec 2013 04:46:14 -0800 (PST)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id D24E01001E5; Thu, 5 Dec 2013 14:46:02 +0200 (EET)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: notmuch@notmuchmail.org
\r
24 Subject: [PATCH v3 part 3/3] test: implement and document NOTMUCH_TEST_QUIET
\r
26 Date: Thu, 5 Dec 2013 14:46:00 +0200
\r
27 Message-Id: <1386247560-31903-1-git-send-email-tomi.ollila@iki.fi>
\r
28 X-Mailer: git-send-email 1.8.0
\r
29 In-Reply-To: <1385399299-12936-1-git-send-email-tomi.ollila@iki.fi>
\r
30 References: <1385399299-12936-1-git-send-email-tomi.ollila@iki.fi>
\r
31 Cc: tomi.ollila@iki.fi
\r
32 X-BeenThere: notmuch@notmuchmail.org
\r
33 X-Mailman-Version: 2.1.13
\r
35 List-Id: "Use and development of the notmuch mail system."
\r
36 <notmuch.notmuchmail.org>
\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
38 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
40 List-Post: <mailto:notmuch@notmuchmail.org>
\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
44 X-List-Received-Date: Thu, 05 Dec 2013 12:46:19 -0000
\r
46 When NOTMUCH_TEST_QUIET environment variable is set to non-null value
\r
47 messages when new test script starts and when test PASSes are disabled.
\r
48 This eases picking the cases when tests FAIL (as those are still printed).
\r
51 Diffdiff of part 3 to previous.
\r
53 | diff --git a/test/test-lib.sh b/test/test-lib.sh
\r
54 | index 9d4a807..d8e0d91 100644
\r
55 | --- a/test/test-lib.sh
\r
56 | +++ b/test/test-lib.sh
\r
57 | @@ -733,9 +733,7 @@ test_failure_ () {
\r
60 | test_failure=$(($test_failure + 1))
\r
61 | - if test -n "$NOTMUCH_TEST_QUIET"; then
\r
62 | - print_test_description
\r
64 | + print_test_description
\r
65 | test_failure_message_ "FAIL" "$test_subtest_name" "$@"
\r
66 | test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
\r
70 test/README | 8 ++++++++
\r
72 test/test-lib.sh | 9 ++++++++-
\r
73 3 files changed, 18 insertions(+), 3 deletions(-)
\r
75 diff --git a/test/README b/test/README
\r
76 index d12cff2..79a9b1b 100644
\r
79 @@ -76,6 +76,14 @@ the tests in one of the following ways.
\r
80 TEST_EMACS=my-special-emacs TEST_EMACSCLIENT=my-emacsclient ./emacs
\r
81 make test TEST_EMACS=my-special-emacs TEST_EMACSCLIENT=my-emacsclient
\r
86 +Normally, when new script starts and when test PASSes you get a message
\r
87 +printed on screen. This printing can be disabled by setting the
\r
88 +NOTMUCH_TEST_QUIET variable to a non-null value. Message on test
\r
89 +failures and skips are still printed.
\r
93 If, for any reason, you need to skip one or more tests, you can do so
\r
94 diff --git a/test/basic b/test/basic
\r
95 index 64eb7d7..f7eed32 100755
\r
98 @@ -74,12 +74,12 @@ suppress_diff_date() {
\r
101 test_begin_subtest "Ensure that test output is suppressed unless the test fails"
\r
102 -output=$(cd $TEST_DIRECTORY; ./test-verbose 2>&1 | suppress_diff_date)
\r
103 +output=$(cd $TEST_DIRECTORY; NOTMUCH_TEST_QUIET= ./test-verbose 2>&1 | suppress_diff_date)
\r
104 expected=$(cat $EXPECTED/test-verbose-no | suppress_diff_date)
\r
105 test_expect_equal "$output" "$expected"
\r
107 test_begin_subtest "Ensure that -v does not suppress test output"
\r
108 -output=$(cd $TEST_DIRECTORY; ./test-verbose -v 2>&1 | suppress_diff_date)
\r
109 +output=$(cd $TEST_DIRECTORY; NOTMUCH_TEST_QUIET= ./test-verbose -v 2>&1 | suppress_diff_date)
\r
110 expected=$(cat $EXPECTED/test-verbose-yes | suppress_diff_date)
\r
111 # Do not include the results of test-verbose in totals
\r
112 rm $TEST_DIRECTORY/test-results/test-verbose
\r
113 diff --git a/test/test-lib.sh b/test/test-lib.sh
\r
114 index 34e0db6..d8e0d91 100644
\r
115 --- a/test/test-lib.sh
\r
116 +++ b/test/test-lib.sh
\r
117 @@ -198,7 +198,10 @@ print_test_description ()
\r
118 echo $this_test: "Testing ${test_description}"
\r
119 test_description_printed=1
\r
121 -print_test_description
\r
122 +if [ -z "$NOTMUCH_TEST_QUIET" ]
\r
124 + print_test_description
\r
129 @@ -717,6 +720,9 @@ test_ok_ () {
\r
132 test_success=$(($test_success + 1))
\r
133 + if test -n "$NOTMUCH_TEST_QUIET"; then
\r
136 say_color pass "%-6s" "PASS"
\r
137 echo " $test_subtest_name"
\r
139 @@ -727,6 +733,7 @@ test_failure_ () {
\r
142 test_failure=$(($test_failure + 1))
\r
143 + print_test_description
\r
144 test_failure_message_ "FAIL" "$test_subtest_name" "$@"
\r
145 test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }
\r