summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 558bc86)
raw | patch | inline | side by side (parent: 558bc86)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 14 May 2014 19:49:36 +0000 (21:49 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 14 May 2014 19:49:36 +0000 (21:49 +0200) |
This is implemented through a wrapper script which will run its arguments
through valgrind if the first parameter matches "unit/". It is passed in to
'make test' using automake's TESTS_ENVIRONMENT variable.
through valgrind if the first parameter matches "unit/". It is passed in to
'make test' using automake's TESTS_ENVIRONMENT variable.
t/cibuild.sh | patch | blob | history | |
t/testwrapper.sh | [new file with mode: 0755] | patch | blob |
diff --git a/t/cibuild.sh b/t/cibuild.sh
index 61f4a8b09b658e3b13c75dd17cc7249517a275d7..9e21eb2b1fe15a75eb6fbe08f4f613b0cd110830 100755 (executable)
--- a/t/cibuild.sh
+++ b/t/cibuild.sh
# skip regular tests
;;
*)
- make test
+ make test TESTS_ENVIRONMENT="./testwrapper.sh"
;;
esac
diff --git a/t/testwrapper.sh b/t/testwrapper.sh
--- /dev/null
+++ b/t/testwrapper.sh
@@ -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 :
+