From 44c1d728b11fb970d040313d519a6372ac77652c Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 08:34:51 -1000 Subject: Keep cgit under Valgrind whichever way it is asked The library runs a script again for --tee, --verbose-log and --stress with the arguments setup.sh left it, and --valgrind was no longer among them, so -V --valgrind ran cgit bare. --valgrind= reached the library instead, which then wrapped every Git command and left cgit alone. --valgrind-only is refused, as it would need the library's own per-test switching. --- tests/valgrind/bin/cgit | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'tests/valgrind') diff --git a/tests/valgrind/bin/cgit b/tests/valgrind/bin/cgit index e35e220..e5666b5 100755 --- a/tests/valgrind/bin/cgit +++ b/tests/valgrind/bin/cgit @@ -4,12 +4,25 @@ # when setup.sh puts this directory ahead of the build on PATH. Git's own # suppression file is reused rather than kept in a copy here, so GIT_VALGRIND # points into the bundled Git tree while CGIT_VALGRIND points back at this -# wrapper's home. -exec valgrind -q --error-exitcode=126 \ +# wrapper's home. The tool comes from --valgrind= and its options follow +# Git's own wrapper, with any in GIT_VALGRIND_OPTIONS added after them. +case "$CGIT_TEST_VALGRIND" in +memcheck) + tool_options="--leak-check=no --track-origins=yes" + ;; +memcheck-fast) + tool_options="--leak-check=no" + ;; +*) + tool_options="--tool=$CGIT_TEST_VALGRIND" + ;; +esac + +exec "$CGIT_VALGRIND_PROGRAM" -q --error-exitcode=126 \ --suppressions="$GIT_VALGRIND/default.supp" \ --gen-suppressions=all \ - --leak-check=no \ - --track-origins=yes \ + $tool_options \ --log-fd=4 \ --input-fd=4 \ + $GIT_VALGRIND_OPTIONS \ "$CGIT_VALGRIND/../../build/cgit" "$@" -- cgit 2.12.1