summaryrefslogtreecommitdiff
path: root/test/valgrind_common.mk
diff options
context:
space:
mode:
Diffstat (limited to 'test/valgrind_common.mk')
-rw-r--r--test/valgrind_common.mk21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/valgrind_common.mk b/test/valgrind_common.mk
new file mode 100644
index 0000000..4b0cc5b
--- /dev/null
+++ b/test/valgrind_common.mk
@@ -0,0 +1,21 @@
+SUPPRESSIONS = $(top_srcdir)/test/valgrind.supp
+
+%.valgrind: %
+ @$(TESTS_ENVIRONMENT) \
+ CK_FORK=no \
+ CK_DEFAULT_TIMEOUT=120 \
+ G_SLICE=always-malloc \
+ $(LIBTOOL) --mode=execute \
+ valgrind -q \
+ $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
+ --tool=memcheck --leak-check=full --trace-children=yes \
+ --leak-resolution=high --num-callers=20 \
+ --error-exitcode=1 \
+ ./$*
+
+valgrind: $(check_PROGRAMS)
+ for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(check_PROGRAMS)); do \
+ $(MAKE) $$t.valgrind; \
+ done;
+
+