Skip to content

Commit

Permalink
tests: notice valgrind error in test_must_fail
Browse files Browse the repository at this point in the history
We tell valgrind to return 126 if it notices that something is wrong,
but we did not actually handle this in test_must_fail, leading to
false negatives.  Catch and report it.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Apr 1, 2013
1 parent 95d9d5e commit eeb6913
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions t/test-lib-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ test_must_fail () {
elif test $exit_code = 127; then
echo >&2 "test_must_fail: command not found: $*"
return 1
elif test $exit_code = 126; then
echo >&2 "test_must_fail: valgrind error: $*"
return 1
fi
return 0
}
Expand Down

0 comments on commit eeb6913

Please sign in to comment.