Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
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=<tool> 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.
Diffstat (limited to 'tests/valgrind/bin')
| -rwxr-xr-x | tests/valgrind/bin/cgit | 21 |
1 file changed, 17 insertions, 4 deletions
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=<tool> 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" "$@" |
