From: Junio C Hamano Date: Tue, 29 Nov 2016 21:28:00 +0000 (-0800) Subject: Merge branch 'nd/test-helpers' into maint X-Git-Tag: v2.10.3~9 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/91207f378460d91c2097e1135ac69fd73f797ff8?hp=6afadbd5ee4557982a7c049bb5bb539a5b21775f Merge branch 'nd/test-helpers' into maint Update to the test framework made in 2.9 timeframe broke running the tests under valgrind, which has been fixed. * nd/test-helpers: valgrind: support test helpers --- diff --git a/t/test-lib.sh b/t/test-lib.sh index 21e4aa2e54..b021329e03 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -809,7 +809,14 @@ then return; base=$(basename "$1") - symlink_target=$GIT_BUILD_DIR/$base + case "$base" in + test-*) + symlink_target="$GIT_BUILD_DIR/t/helper/$base" + ;; + *) + symlink_target="$GIT_BUILD_DIR/$base" + ;; + esac # do not override scripts if test -x "$symlink_target" && test ! -d "$symlink_target" && diff --git a/t/valgrind/valgrind.sh b/t/valgrind/valgrind.sh index 42153036dc..669ebaf68b 100755 --- a/t/valgrind/valgrind.sh +++ b/t/valgrind/valgrind.sh @@ -1,11 +1,19 @@ #!/bin/sh base=$(basename "$0") +case "$base" in +test-*) + program="$GIT_VALGRIND/../../t/helper/$base" + ;; +*) + program="$GIT_VALGRIND/../../$base" + ;; +esac TOOL_OPTIONS='--leak-check=no' test -z "$GIT_VALGRIND_ENABLED" && -exec "$GIT_VALGRIND"/../../"$base" "$@" +exec "$program" "$@" case "$GIT_VALGRIND_MODE" in memcheck-fast) @@ -29,4 +37,4 @@ exec valgrind -q --error-exitcode=126 \ --log-fd=4 \ --input-fd=4 \ $GIT_VALGRIND_OPTIONS \ - "$GIT_VALGRIND"/../../"$base" "$@" + "$program" "$@"