@matheusbsbs / matheus-bagliano / commits / 5a26973025
Fork 0

t/test-lib.sh: exit with small negagive int is ok with test_must_fail

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@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stephan Beyer committed Jul 12, 2008 at 17:47 UTC 5a26973025bce74782571844c7b8091d1cd7c405
1 file changed +1 -1
t/test-lib.sh
+1 -1
@@ -379,7 +379,7 @@ test_external_without_stderr () {
379
380 test_must_fail () {
381 "$@"
382 - test $? -gt 0 -a $? -le 129
382 + test $? -gt 0 -a $? -le 129 -o $? -gt 192
383 }
384
385 # test_cmp is a helper function to compare actual and expected output.