mirror of
https://github.com/git/git.git
synced 2024-09-21 09:42:22 +02:00
952af3511c
Running tests under helgrind and DRD recently proved useful in tracking down thread interaction issues. This can unfortunately not be done through GIT_VALGRIND_OPTIONS because any tool other than memcheck would complain about unknown options. Let --valgrind take an optional parameter that describes the valgrind tool to invoke. The default mode is to run memcheck as before. 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>
28 lines
704 B
Bash
Executable File
28 lines
704 B
Bash
Executable File
#!/bin/sh
|
|
|
|
base=$(basename "$0")
|
|
|
|
TOOL_OPTIONS='--leak-check=no'
|
|
|
|
case "$GIT_VALGRIND_MODE" in
|
|
memcheck)
|
|
VALGRIND_VERSION=$(valgrind --version)
|
|
VALGRIND_MAJOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*\([0-9]*\)')
|
|
VALGRIND_MINOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*[0-9]*\.\([0-9]*\)')
|
|
test 3 -gt "$VALGRIND_MAJOR" ||
|
|
test 3 -eq "$VALGRIND_MAJOR" -a 4 -gt "$VALGRIND_MINOR" ||
|
|
TOOL_OPTIONS="$TOOL_OPTIONS --track-origins=yes"
|
|
;;
|
|
*)
|
|
TOOL_OPTIONS="--tool=$GIT_VALGRIND_MODE"
|
|
esac
|
|
|
|
exec valgrind -q --error-exitcode=126 \
|
|
--gen-suppressions=all \
|
|
--suppressions="$GIT_VALGRIND/default.supp" \
|
|
$TOOL_OPTIONS \
|
|
--log-fd=4 \
|
|
--input-fd=4 \
|
|
$GIT_VALGRIND_OPTIONS \
|
|
"$GIT_VALGRIND"/../../"$base" "$@"
|