Add a rule to generate valgrind suppressions for a single test.

This commit is contained in:
Edward Hervey 2009-02-09 13:23:45 +01:00
parent 9291aa202f
commit 3a000ecaa4

View file

@ -60,7 +60,7 @@ endif
GSTSUPP = $(top_srcdir)/common/gst.supp GSTSUPP = $(top_srcdir)/common/gst.supp
PYTHONSUPP = $(top_srcdir)/testsuite/python.supp PYTHONSUPP = $(top_srcdir)/testsuite/python.supp
GSTPYTHONSUPP = $(top_srcdir)/testsuite/gstpython.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 any given test_x.py by running make test_x.py.gdb
%.gdb: % %.gdb: %
@ -87,6 +87,25 @@ TESTS_ENVIRONMENT = PYTHONPATH=$(top_srcdir)/:$(PYTHONPATH)
fi fi
@rm valgrind.log @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: % %.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)/cleanup.py
@PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs:`pwd`:$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(srcdir)/runtests.py $* @PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs:`pwd`:$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(srcdir)/runtests.py $*