From 3a000ecaa475106b76c64b80647b36b2d9b75f71 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 9 Feb 2009 13:23:45 +0100 Subject: [PATCH] Add a rule to generate valgrind suppressions for a single test. --- testsuite/Makefile.am | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am index 1d57607..831f5d2 100644 --- a/testsuite/Makefile.am +++ b/testsuite/Makefile.am @@ -60,7 +60,7 @@ endif GSTSUPP = $(top_srcdir)/common/gst.supp PYTHONSUPP = $(top_srcdir)/testsuite/python.supp GSTPYTHONSUPP = $(top_srcdir)/testsuite/gstpython.supp -TESTS_ENVIRONMENT = PYTHONPATH=$(top_srcdir)/:$(PYTHONPATH) +TESTS_ENVIRONMENT = PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs:`pwd`:$(top_srcdir):$(PYTHONPATH) # gdb any given test_x.py by running make test_x.py.gdb %.gdb: % @@ -87,6 +87,25 @@ TESTS_ENVIRONMENT = PYTHONPATH=$(top_srcdir)/:$(PYTHONPATH) fi @rm valgrind.log +# valgrind any given test_x.py by running make test_x.py.valgrind +%.gen-suppressions: % + $(TESTS_ENVIRONMENT) \ + G_DEBUG=gc-friendly G_SLICE=always-malloc \ + $(VALGRIND_PATH) -q \ + --suppressions=$(GSTSUPP) \ + --suppressions=$(PYTHONSUPP) \ + --suppressions=$(GSTPYTHONSUPP) \ + --tool=memcheck --leak-check=full --trace-children=yes \ + --leak-resolution=high --num-callers=50 \ + --gen-suppressions=all \ + $(PYTHON) \ + $* 2>&1 | tee valgrind.log + @if grep "tely lost" valgrind.log; then \ + rm valgrind.log; \ + exit 1; \ + fi + @rm valgrind.log + %.check: % @PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs:`pwd`:$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(srcdir)/cleanup.py @PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs:`pwd`:$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(srcdir)/runtests.py $* -- 2.7.4