summaryrefslogtreecommitdiff
path: root/regress/valgrind-unit.sh
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2015-02-25 16:58:22 -0800
committerDamien Miller <djm@mindrot.org>2015-02-26 14:55:55 -0800
commitbd58853102cee739f0e115e6d4b5334332ab1442 (patch)
treec214663c1fa4b28cc687faba24183f36085a3141 /regress/valgrind-unit.sh
parentf43d17269194761eded9e89f17456332f4c83824 (diff)
valgrind support
Diffstat (limited to 'regress/valgrind-unit.sh')
-rwxr-xr-xregress/valgrind-unit.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/regress/valgrind-unit.sh b/regress/valgrind-unit.sh
new file mode 100755
index 000000000..433cb069a
--- /dev/null
+++ b/regress/valgrind-unit.sh
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3UNIT_BINARY="$1"
4shift
5UNIT_ARGS="$@"
6
7test "x$OBJ" = "x" && OBJ=$PWD
8
9# This mostly replicates the logic in test-exec.sh for running the
10# regress tests under valgrind.
11VG_TEST=`basename $UNIT_BINARY`
12VG_LOG="$OBJ/valgrind-out/${VG_TEST}.%p"
13VG_OPTS="--track-origins=yes --leak-check=full --log-file=${VG_LOG}"
14VG_OPTS="$VG_OPTS --trace-children=yes"
15VG_PATH="valgrind"
16if [ "x$VALGRIND_PATH" != "x" ]; then
17 VG_PATH="$VALGRIND_PATH"
18fi
19
20exec $VG_PATH $VG_OPTS $UNIT_BINARY $UNIT_ARGS