t: remove inappropriate uses of test_must_fail(), was Re: [PATCH v5 26/26] t7700: stop losing return codes of git commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

On Sat, Nov 30, 2019 at 09:00:08AM -0800, Junio C Hamano wrote:
>  * Or perhaps we can detect its use on anything that is not "git"
>    automatically?  This is merely to illustrate the idea (the
>    exemption of "env" shown here is too broad for production use)
> 
>    diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
>    index b299ecc326..7ab113cd50 100644
>    --- a/t/test-lib-functions.sh
>    +++ b/t/test-lib-functions.sh
>    @@ -828,6 +828,10 @@ test_must_fail () {
>                    _test_ok=
>                    ;;
>            esac
>    +	case "$1" in
>    +	git|test-tool|env) ;;
>    +	*) echo >&7 "warning: test_must_fail $*???" ;;
>    +	esac
>            "$@" 2>&7
>            exit_code=$?
>            if test $exit_code -eq 0 && ! list_contains "$_test_ok" success

I've been cooking a series that gets rid of inappropriate uses
test_must_fail() for a while now. As a finishing touch, I implemented
the idea Junio suggested above and it seems to be working well.

It's a pretty hefty series, weighing in at 46 patches. After the dust
settles on 'dl/test-cleanup' (once it gets merged to master), I'll
probably start sending out this test_must_fail() series around 10
patches at a time.

An advanced preview can be found here[1]. Or, if you'd like me to
privately mail you the series, I can do that too. Early comments would
be very appreciated.

Thanks,

Denton

[1]: https://github.com/Denton-L/git/commits/ready/cleanup-test-must-fail



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux