From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A224C431FBC for ; Wed, 13 Nov 2013 00:37:02 -0800 (PST) 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 uXrxqhfSkeYL for ; Wed, 13 Nov 2013 00:36:57 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id BA489431FB6 for ; Wed, 13 Nov 2013 00:36:57 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id B61A1100033; Wed, 13 Nov 2013 10:36:49 +0200 (EET) From: Tomi Ollila To: Austin Clements Subject: Re: [PATCH 3/3] test: implement and document NOTMUCH_TEST_QUIET variable usage In-Reply-To: <20131112230259.GD13399@mit.edu> References: <1384288868-23903-1-git-send-email-tomi.ollila@iki.fi> <1384288868-23903-3-git-send-email-tomi.ollila@iki.fi> <20131112230259.GD13399@mit.edu> User-Agent: Notmuch/0.16+119~g219c55f (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain Cc: notmuch@notmuchmail.org 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: Wed, 13 Nov 2013 08:37:02 -0000 On Wed, Nov 13 2013, Austin Clements wrote: > Quoth Tomi Ollila on Nov 12 at 10:41 pm: >> return >> fi >> test_success=$(($test_success + 1)) >> + if test -n "$NOTMUCH_TEST_QUIET"; then >> + return 0 >> + fi >> say_color pass "%-6s" "PASS" >> echo " $test_subtest_name" >> } >> @@ -713,6 +719,9 @@ test_failure_ () { >> return >> fi >> test_failure=$(($test_failure + 1)) >> + if test -n "$NOTMUCH_TEST_QUIET"; then >> + print_test_description > > This prints the test description for *every* failing test. Was that > intentional? I would think that, ideally, it would be only printed > before the first failing subtest in a test (maybe by setting a > variable in print_test_description on the first call and making it > return immediately if this variable is set? Then you wouldn't even > need the condition here, just the call to print_test_description.) Your observation is correct.. I thought about it but dropped -- but as it *increases* the output it should be addressed. My first solution would be to do: print_test_description () { echo echo $this_test: "Testing ${test_description}" print_test_description () { : already printed ; } } But I presume this receives some resistance from the audience ;/ I think this a bit -- this is post 0.17 release stuff anyway... > >> + fi >> test_failure_message_ "FAIL" "$test_subtest_name" "$@" >> test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; } >> return 1 > > Stylistic nit: The three if's above use two different styles ([ vs > test and hanging 'then'). OTOH, maybe this is consistent with > test-lib's inconsistent style. It is consistent with test-lib's inconsistent style: most often if [] is used but those places where I used if test just a line before the diff context there were if test -format used. Tomi