[PATCH 1/2] t/test-lib.sh: Let test_must_fail fail on signals only

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

 



The test_must_fail function in test-lib.sh has been designed
to distinguish segmentation faults from controlled errors.
But in the current implementation this only works if a git
command does not return a small negative value, like -1, -2
or -3. But some git commands do.

Because any signal (like SIGSEGV) will result in an exit status
less than 193, this patch just adds a further check for the exit
status.

Signed-off-by: Stephan Beyer <s-beyer@xxxxxxx>
---
 t/test-lib.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 8e2849b..11c0275 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -379,7 +379,7 @@ test_external_without_stderr () {
 
 test_must_fail () {
 	"$@"
-	test $? -gt 0 -a $? -le 129
+	test $? -gt 0 -a $? -le 129 -o $? -gt 192
 }
 
 # test_cmp is a helper function to compare actual and expected output.
-- 
1.5.6.2.303.g79662

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

  Powered by Linux