Skip to content

Commit 91207f3

Browse files
committed
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
2 parents 6afadbd + 28fab7b commit 91207f3

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

t/test-lib.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,14 @@ then
809809
return;
810810

811811
base=$(basename "$1")
812-
symlink_target=$GIT_BUILD_DIR/$base
812+
case "$base" in
813+
test-*)
814+
symlink_target="$GIT_BUILD_DIR/t/helper/$base"
815+
;;
816+
*)
817+
symlink_target="$GIT_BUILD_DIR/$base"
818+
;;
819+
esac
813820
# do not override scripts
814821
if test -x "$symlink_target" &&
815822
test ! -d "$symlink_target" &&

t/valgrind/valgrind.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#!/bin/sh
22

33
base=$(basename "$0")
4+
case "$base" in
5+
test-*)
6+
program="$GIT_VALGRIND/../../t/helper/$base"
7+
;;
8+
*)
9+
program="$GIT_VALGRIND/../../$base"
10+
;;
11+
esac
412

513
TOOL_OPTIONS='--leak-check=no'
614

715
test -z "$GIT_VALGRIND_ENABLED" &&
8-
exec "$GIT_VALGRIND"/../../"$base" "$@"
16+
exec "$program" "$@"
917

1018
case "$GIT_VALGRIND_MODE" in
1119
memcheck-fast)
@@ -29,4 +37,4 @@ exec valgrind -q --error-exitcode=126 \
2937
--log-fd=4 \
3038
--input-fd=4 \
3139
$GIT_VALGRIND_OPTIONS \
32-
"$GIT_VALGRIND"/../../"$base" "$@"
40+
"$program" "$@"

0 commit comments

Comments
 (0)