]> git.ipfire.org Git - thirdparty/git.git/blame - t/valgrind/valgrind.sh
path.c: don't call the match function without value in trie_find()
[thirdparty/git.git] / t / valgrind / valgrind.sh
CommitLineData
4e1be63c
JS
1#!/bin/sh
2
3base=$(basename "$0")
28fab7b2
RS
4case "$base" in
5test-*)
6 program="$GIT_VALGRIND/../../t/helper/$base"
7 ;;
8*)
9 program="$GIT_VALGRIND/../../$base"
10 ;;
11esac
4e1be63c 12
952af351 13TOOL_OPTIONS='--leak-check=no'
5caa81d1 14
5dfc368f 15test -z "$GIT_VALGRIND_ENABLED" &&
28fab7b2 16exec "$program" "$@"
5dfc368f 17
952af351 18case "$GIT_VALGRIND_MODE" in
95d9d5ec
TR
19memcheck-fast)
20 ;;
952af351
TR
21memcheck)
22 VALGRIND_VERSION=$(valgrind --version)
23 VALGRIND_MAJOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*\([0-9]*\)')
24 VALGRIND_MINOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*[0-9]*\.\([0-9]*\)')
25 test 3 -gt "$VALGRIND_MAJOR" ||
26 test 3 -eq "$VALGRIND_MAJOR" -a 4 -gt "$VALGRIND_MINOR" ||
27 TOOL_OPTIONS="$TOOL_OPTIONS --track-origins=yes"
28 ;;
29*)
30 TOOL_OPTIONS="--tool=$GIT_VALGRIND_MODE"
31esac
5caa81d1 32
4e1be63c 33exec valgrind -q --error-exitcode=126 \
4e1be63c 34 --gen-suppressions=all \
952af351
TR
35 --suppressions="$GIT_VALGRIND/default.supp" \
36 $TOOL_OPTIONS \
4e1be63c
JS
37 --log-fd=4 \
38 --input-fd=4 \
39 $GIT_VALGRIND_OPTIONS \
28fab7b2 40 "$program" "$@"