tests: notice valgrind error in test_must_fail
authorThomas Rast <trast@inf.ethz.ch>
Sun, 31 Mar 2013 08:37:25 +0000 (10:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Apr 2013 14:45:45 +0000 (07:45 -0700)
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>
t/test-lib-functions.sh
index fa62d010f68e3ee97e6754687ad4d08564d3c96b..6766553c31ff88e391e179c664756f908e74f4e4 100644 (file)
@@ -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
 }