Re: Re* [PATCH 0/4] t: replace incorrect test_must_fail usage (part 5)
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 29, 2020, 22:00 UTC
- Message-ID
- <CAPig+cT5DH2KW4nnQxUMaZzLR0JSLovGbpGC=3vYOWY2QWyKsw@mail.gmail.com>
- In-Reply-To
- <xmqqblnaufyt.fsf_-_@gitster.c.googlers.com>
On Wed, Apr 29, 2020 at 5:42 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Subject: [PATCH] t/README: document when not to use test_might_fail
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> diff --git a/t/README b/t/README
> @@ -875,7 +875,9 @@ library for your script to use.
> - test_might_fail [<options>] <git-command>
>
> Similar to test_must_fail, but tolerate success, too. Use this
> - instead of "<git-command> || :" to catch failures due to segv.
> + instead of "<git-command> || :" to catch failures due to segv,
> + but do use "{ <non-git-command> || :; }" to ignore a failure from
> + a command that is not git.This seems like a good addition and perhaps may help reduce reviewer burden (not that this comes up very often, but I've recommended it here and there when reviewing patches). Here's a possible alternate wording:
Similar to test_must_fail, but tolerate success, too. Use this
instead of "<git-command> || :" to catch failures due to segv.
To ignore failure of non-git commands, however, use
"{ <non-git-command> || :; }".