aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/valgrind
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-09-20 13:42:59 -0700
committerGravatar Carl Worth <cworth@cworth.org>2010-09-20 13:44:32 -0700
commit60c599036e528bc8a856c3312f0222cc7b1fd32a (patch)
tree53013d16b4a1d219ba59ecb351ce8e0682ca3322 /test/valgrind
parent265de5006f08a90371cc9caec0c0e6f702f42204 (diff)
test: Fix test suite so that --valgrind option works.
The output is ugly, and we need a better suppressions file, but this is at least a start.
Diffstat (limited to 'test/valgrind')
-rw-r--r--test/valgrind/default.supp0
-rwxr-xr-xtest/valgrind/valgrind.sh22
2 files changed, 22 insertions, 0 deletions
diff --git a/test/valgrind/default.supp b/test/valgrind/default.supp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/valgrind/default.supp
diff --git a/test/valgrind/valgrind.sh b/test/valgrind/valgrind.sh
new file mode 100755
index 00000000..582b4dca
--- /dev/null
+++ b/test/valgrind/valgrind.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+base=$(basename "$0")
+
+TRACK_ORIGINS=
+
+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" ||
+TRACK_ORIGINS=--track-origins=yes
+
+exec valgrind -q --error-exitcode=126 \
+ --leak-check=no \
+ --suppressions="$GIT_VALGRIND/default.supp" \
+ --gen-suppressions=all \
+ $TRACK_ORIGINS \
+ --log-fd=4 \
+ --input-fd=4 \
+ $GIT_VALGRIND_OPTIONS \
+ "$GIT_VALGRIND"/../../"$base" "$@"