Code

t/: Run all unit tests through valgrind.
[sysdb.git] / t / testwrapper.sh
diff --git a/t/testwrapper.sh b/t/testwrapper.sh
new file mode 100755 (executable)
index 0000000..ccdbc6d
--- /dev/null
@@ -0,0 +1,23 @@
+#! /bin/bash
+#
+# SysDB -- t/testwrapper.sh
+#
+# A wrapper script for running tests.
+
+set -e
+
+MEMCHECK="valgrind --quiet --tool=memcheck --error-exitcode=1"
+MEMCHECK="$MEMCHECK --trace-children=yes"
+MEMCHECK="$MEMCHECK --leak-check=full"
+
+case "$1" in
+       *unit/*)
+               exec $MEMCHECK "$@"
+               ;;
+       *)
+               exec "$@"
+               ;;
+esac
+
+# vim: set tw=78 sw=4 ts=4 noexpandtab :
+