Skip to content

Commit

Permalink
tests: make test_might_fail more verbose
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Aug 31, 2010
1 parent a54ce3c commit 5c8e141
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,12 @@ test_must_fail () {

test_might_fail () {
"$@"
test $? -ge 0 -a $? -le 129 -o $? -gt 192
exit_code=$?
if test $exit_code -gt 129 -a $exit_code -le 192; then
echo >&2 "test_might_fail: died by signal: $*"
return 1
fi
return 0
}

# test_cmp is a helper function to compare actual and expected output.
Expand Down

0 comments on commit 5c8e141

Please sign in to comment.