tests: notice valgrind error in test_must_fail

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>

Thomas Rast committed Mar 31, 2013 at 10:37 UTC eeb69131ed7f3cb7a191d5bf0e3ce8fdd726a539
1 file changed +3
t/test-lib-functions.sh
+3
@@ -536,6 +536,9 @@ test_must_fail () {
536 elif test $exit_code = 127; then
537 echo >&2 "test_must_fail: command not found: $*"
538 return 1
539 + elif test $exit_code = 126; then
540 + echo >&2 "test_must_fail: valgrind error: $*"
541 + return 1
542 fi
543 return 0
544 }