summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPavel Šimerda <psimerda@redhat.com>2013-07-26 14:16:47 +0200
committerPavel Šimerda <psimerda@redhat.com>2013-07-26 19:08:03 +0200
commitb38f76cdb4d5b2d475e443a2c41f268928a6be7a (patch)
tree6f0720bd572784c09d2a6fda6e89615f9469eb69 /tools
parent7b2a4054b0fc077ce4213909c5587865c7d6300b (diff)
downloadNetworkManager-b38f76cdb4d5b2d475e443a2c41f268928a6be7a.tar.gz
build: use a helper script for all valgrind tests
Diffstat (limited to 'tools')
-rwxr-xr-xtools/run-test-valgrind.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/run-test-valgrind.sh b/tools/run-test-valgrind.sh
new file mode 100755
index 0000000000..abd32860ff
--- /dev/null
+++ b/tools/run-test-valgrind.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+LIBTOOL="$1"; shift
+VALGRIND="$1"; shift
+SUPPRESSIONS="$1"; shift
+TEST="$1"; shift
+
+LOGFILE="valgrind-`echo "$TEST" | tr -cd '[:alpha:]-'`.log"
+
+export G_SLICE=always-malloc
+export G_DEBUG=gc-friendly
+$LIBTOOL --mode=execute "$VALGRIND" \
+ --quiet \
+ --error-exitcode=1 \
+ --leak-check=full \
+ --gen-suppressions=all \
+ --suppressions="$SUPPRESSIONS" \
+ --log-file="$LOGFILE" \
+ "$TEST"
+RESULT=$?
+
+if [ $RESULT -ne 0 ]; then
+ echo "Don't forget to check the valgrind log at '$LOGFILE'." >&2
+fi
+
+exit $RESULT