Re: [PATCH] t7006: guard cleanup with test_expect_success

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

 



Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@xxxxxxxxx> writes:

[...]
>> +cleanup_fail() {
>> +	echo >&2 cleanup failed
>> +	exit 1
>> +}
>
> I think you meant to say "false" or "(exit 1)" here.  To see why...
[...]
> ... try your patch with "rm -f stdout_is_tty" replaced with "(exit 1)" to
> see how your cleanup_fail behaves.

Good catch; thanks.  Here’s a patch for squashing in case you would
like one.

diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh
index 62595ab..a3d0210 100755
--- a/t/t7006-pager.sh
+++ b/t/t7006-pager.sh
@@ -6,7 +6,7 @@ test_description='Test automatic use of a pager.'
 
 cleanup_fail() {
 	echo >&2 cleanup failed
-	exit 1
+	return 1
 }
 
 test_expect_success 'set up terminal for tests' '
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]