tests: make test_might_fail more verbose
Let test_might_fail say something about its failures for consistency with test_must_fail. Cc: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Aug 31, 2010 at 12:10 UTC
5c8e141414058430155ea179bce38ceb8d750c5d
1 file changed
+6
-1
t/test-lib.sh
+6
-1
@@ -618,7 +618,12 @@ test_must_fail () {
618
619
test_might_fail () {
620
"$@"
621
- test $? -ge 0 -a $? -le 129 -o $? -gt 192
621
+ exit_code=$?
622
+ if test $exit_code -gt 129 -a $exit_code -le 192; then
623
+ echo >&2 "test_might_fail: died by signal: $*"
624
+ return 1
625
+ fi
626
+ return 0
627
}
628
629
# test_cmp is a helper function to compare actual and expected output.