From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id C97DD6DE0EDB for ; Sun, 10 Mar 2019 13:43:02 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.458 X-Spam-Level: X-Spam-Status: No, score=0.458 tagged_above=-999 required=5 tests=[AWL=-0.194, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qcvhF3ih994v for ; Sun, 10 Mar 2019 13:43:02 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 0B9E66DE0EA6 for ; Sun, 10 Mar 2019 13:43:02 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id D28AE10008E; Sun, 10 Mar 2019 22:42:59 +0200 (EET) From: Tomi Ollila To: Luis Ressel , notmuch@notmuchmail.org Subject: Re: [PATCH] test/T030-config: Separate stdout and stderr output In-Reply-To: <20190310164202.4798-1-aranea@aixah.de> References: <20190310164202.4798-1-aranea@aixah.de> User-Agent: Notmuch/0.28.3+42~g7b16377 (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Sun, 10 Mar 2019 20:43:02 -0000 On Sun, Mar 10 2019, Luis Ressel wrote: > POSIX doesn't specify the flushing behaviour of the STDOUT stream, so > it's invalid to assume a particular order between the stdout and stderr > output. The current test breaks on musl due to this. > --- > test/T030-config.sh | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/test/T030-config.sh b/test/T030-config.sh > index f36695c6..9404390b 100755 > --- a/test/T030-config.sh > +++ b/test/T030-config.sh > @@ -43,7 +43,9 @@ notmuch config set foo.nonexistent > test_expect_equal "$(notmuch config get foo.nonexistent)" "" > > test_begin_subtest "List all items" > -notmuch config list 2>&1 | notmuch_config_sanitize > OUTPUT > +notmuch config list 2>OUTPUT-ERR | notmuch_config_sanitize > OUTPUT > +echo "====" >> OUTPUT > +notmuch_config_sanitize < OUTPUT-ERR >> OUTPUT IMO the above would be better (model/pattern for further use) as: notmuch config list >STDOUT 2>STDERR { cat STDOUT; echo "===="; cat STDERR; } | notmuch_config_sanitize > OUTPUT (I would like to put that cat-echo-cat into function but naming is hard...) alternatives: 1) drop ====, then one cat STDOUT STDERR ... would be enough 2) printf '%s====\n%s' "$(< STDOUT)" "$(< STDERR)" 3) head -1000 STDOUT STDERR -- in case of (3) are we sure that all head(1) implementations print the filenames (and formats (possible) extra newlines) the same way. -- ( (2) brings $(< ...) (faster replacement for $(cat ...) which we haven't used in notmuch test suite so far -- but we could!) Tomi