git-remote-mediawiki: un-brace file handles in binmode calls
[git/git-svn.git] / t / valgrind / valgrind.sh
blob6b87c91b60cde4b19d6644227548f1ba6b226545
1 #!/bin/sh
3 base=$(basename "$0")
5 TOOL_OPTIONS='--leak-check=no'
7 case "$GIT_VALGRIND_MODE" in
8 memcheck-fast)
9 ;;
10 memcheck)
11 VALGRIND_VERSION=$(valgrind --version)
12 VALGRIND_MAJOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*\([0-9]*\)')
13 VALGRIND_MINOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*[0-9]*\.\([0-9]*\)')
14 test 3 -gt "$VALGRIND_MAJOR" ||
15 test 3 -eq "$VALGRIND_MAJOR" -a 4 -gt "$VALGRIND_MINOR" ||
16 TOOL_OPTIONS="$TOOL_OPTIONS --track-origins=yes"
19 TOOL_OPTIONS="--tool=$GIT_VALGRIND_MODE"
20 esac
22 exec valgrind -q --error-exitcode=126 \
23 --gen-suppressions=all \
24 --suppressions="$GIT_VALGRIND/default.supp" \
25 $TOOL_OPTIONS \
26 --log-fd=4 \
27 --input-fd=4 \
28 $GIT_VALGRIND_OPTIONS \
29 "$GIT_VALGRIND"/../../"$base" "$@"