Skip to content

Commit 5c8e141

Browse files
jrngitster
authored andcommitted
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>
1 parent a54ce3c commit 5c8e141

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

t/test-lib.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,12 @@ test_must_fail () {
618618

619619
test_might_fail () {
620620
"$@"
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
622627
}
623628

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

0 commit comments

Comments
 (0)