summaryrefslogtreecommitdiffstats
path: root/tests/shell/helpers/nft-valgrind-wrapper.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/helpers/nft-valgrind-wrapper.sh')
-rwxr-xr-xtests/shell/helpers/nft-valgrind-wrapper.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/shell/helpers/nft-valgrind-wrapper.sh b/tests/shell/helpers/nft-valgrind-wrapper.sh
new file mode 100755
index 00000000..9da50d4d
--- /dev/null
+++ b/tests/shell/helpers/nft-valgrind-wrapper.sh
@@ -0,0 +1,17 @@
+#!/bin/bash -e
+
+SUFFIX="$(date '+%Y%m%d-%H%M%S.%6N')"
+
+rc=0
+libtool \
+ --mode=execute \
+ valgrind \
+ --log-file="$NFT_TEST_TESTTMPDIR/valgrind.$SUFFIX.%p.log" \
+ --trace-children=yes \
+ --leak-check=full \
+ --show-leak-kinds=all \
+ "$NFT_REAL" \
+ "$@" \
+ || rc=$?
+
+exit $rc