From: Jonathan Nieder <jrnieder@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] tests: use shell negation instead of test_must_fail for test_cmp
Date: Fri, 6 Oct 2017 13:21:08 -0700 [thread overview]
Message-ID: <20171006202108.GX19555@aiede.mtv.corp.google.com> (raw)
In-Reply-To: <20171006190006.19623-1-sbeller@google.com>
Stefan Beller wrote:
> The `test_must_fail` should only be used to indicate a git command is
> failing. `test_cmp` is not a git command, such that it doesn't need the
> special treatment of `test_must_fail` (which e.g. includes checking for
> segfault).
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> t/t3504-cherry-pick-rerere.sh | 2 +-
> t/t5512-ls-remote.sh | 2 +-
> t/t5612-clone-refspec.sh | 2 +-
> t/t7508-status.sh | 2 +-
> t/t9164-git-svn-dcommit-concurrent.sh | 2 +-
> 5 files changed, 5 insertions(+), 5 deletions(-)
Thanks. I agree that this is more readable, and it matches the advice
in t/README:
On the other hand, don't use test_must_fail for running regular
platform commands; just use '! cmd'. We are not in the business
of verifying that the world given to us sanely works.
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
I wonder if it would be useful to have a nod to that advice in the
docstring in t/test-lib-functions.sh, too.
prev parent reply other threads:[~2017-10-06 20:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 19:00 [PATCH 1/2] tests: use shell negation instead of test_must_fail for test_cmp Stefan Beller
2017-10-06 19:00 ` [PATCH 2/2] tests: fix diff order arguments in test_cmp Stefan Beller
2017-10-06 22:01 ` Jonathan Nieder
2017-10-06 22:10 ` Stefan Beller
2017-10-07 1:18 ` Junio C Hamano
2017-10-07 2:29 ` Junio C Hamano
2017-10-06 19:22 ` [PATCH 1/2] tests: use shell negation instead of test_must_fail for test_cmp Jeff King
2017-10-06 19:41 ` Stefan Beller
2017-10-06 21:59 ` Jonathan Nieder
2017-10-07 2:12 ` Junio C Hamano
2017-10-06 20:21 ` Jonathan Nieder [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171006202108.GX19555@aiede.mtv.corp.google.com \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=sbeller@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).