2004-11-23 10:16:58 +00:00
|
|
|
INCLUDES = \
|
|
|
|
$(PYTHON_INCLUDES) \
|
2006-08-21 11:31:51 +00:00
|
|
|
$(PYGOBJET_CFLAGS) \
|
2004-11-23 10:16:58 +00:00
|
|
|
$(PYGST_CFLAGS) \
|
|
|
|
$(GST_CFLAGS)
|
|
|
|
|
|
|
|
noinst_LTLIBRARIES = testhelper.la
|
|
|
|
linked_LIBS = testhelper.la
|
|
|
|
|
|
|
|
testhelper_la_LDFLAGS = -module -avoid-version
|
|
|
|
testhelper_la_LIBADD = $(GLIB_LIBS)
|
2006-08-21 11:31:51 +00:00
|
|
|
testhelper_la_CFLAGS = $(PYGOBJECT_CFLAGS)
|
2004-11-23 10:16:58 +00:00
|
|
|
testhelper_la_SOURCES = \
|
|
|
|
testhelpermodule.c \
|
|
|
|
test-object.c
|
|
|
|
|
|
|
|
# This is a hack to make sure a shared library is built
|
|
|
|
testhelper.la: $(testhelper_la_OBJECTS) $(testhelper_la_DEPENDENCIES)
|
|
|
|
$(LINK) -rpath $(pkgpyexecdir) $(testhelper_la_LDFLAGS) $(testhelper_la_OBJECTS) $(testhelper_la_LIBADD) $(LIBS)
|
|
|
|
|
2005-10-07 16:21:22 +00:00
|
|
|
tests = \
|
2005-09-01 16:16:11 +00:00
|
|
|
test_bin.py \
|
2004-11-23 16:22:08 +00:00
|
|
|
test_buffer.py \
|
|
|
|
test_caps.py \
|
|
|
|
test_element.py \
|
2004-11-23 10:16:58 +00:00
|
|
|
test_event.py \
|
2005-10-05 21:51:36 +00:00
|
|
|
test_ghostpad.py \
|
2004-11-23 16:22:08 +00:00
|
|
|
test_interface.py \
|
2005-10-07 07:48:09 +00:00
|
|
|
test_message.py \
|
2004-11-23 16:22:08 +00:00
|
|
|
test_pad.py \
|
|
|
|
test_pipeline.py \
|
|
|
|
test_registry.py \
|
|
|
|
test_struct.py \
|
2006-12-19 11:38:01 +00:00
|
|
|
test_segment.py \
|
2004-11-05 17:43:05 +00:00
|
|
|
test_xml.py
|
2003-10-04 13:37:45 +00:00
|
|
|
|
2004-11-23 10:16:58 +00:00
|
|
|
check-local: testhelper.la
|
2006-06-12 16:51:36 +00:00
|
|
|
@PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs:`pwd`:$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(srcdir)/cleanup.py
|
2005-09-30 15:23:15 +00:00
|
|
|
@PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs:`pwd`:$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(srcdir)/runtests.py
|
2004-03-09 14:48:03 +00:00
|
|
|
@rm -fr *.pyc
|
2003-10-04 13:37:45 +00:00
|
|
|
|
2005-09-23 15:37:40 +00:00
|
|
|
check-verbose: testhelper.la
|
2006-06-12 16:51:36 +00:00
|
|
|
@VERBOSE=yes PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs:`pwd`:$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(srcdir)/cleanup.py
|
2005-09-30 15:23:15 +00:00
|
|
|
@VERBOSE=yes PYTHONPATH=$(top_builddir):$(top_builddir)/gst/.libs:`pwd`:$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(srcdir)/runtests.py
|
2005-09-23 15:37:40 +00:00
|
|
|
@rm -fr *.pyc
|
|
|
|
|
2006-06-12 16:51:36 +00:00
|
|
|
EXTRA_DIST = $(tests) common.py cleanup.py runtests.py test-object.h python.supp gstpython.supp
|
2004-11-23 10:16:58 +00:00
|
|
|
|
2005-10-07 07:19:17 +00:00
|
|
|
if HAVE_VALGRIND
|
|
|
|
check-valgrind:
|
2006-06-12 16:51:36 +00:00
|
|
|
$(PYTHON) cleanup.py
|
2005-10-07 07:19:17 +00:00
|
|
|
make valgrind
|
|
|
|
else
|
|
|
|
check-valgrind:
|
|
|
|
@true
|
|
|
|
endif
|
|
|
|
|
|
|
|
GSTSUPP = $(top_srcdir)/common/gst.supp
|
|
|
|
PYTHONSUPP = $(top_srcdir)/testsuite/python.supp
|
2005-10-07 13:48:20 +00:00
|
|
|
GSTPYTHONSUPP = $(top_srcdir)/testsuite/gstpython.supp
|
2006-04-07 15:41:00 +00:00
|
|
|
TESTS_ENVIRONMENT = PYTHONPATH=$(top_srcdir)/:$(PYTHONPATH)
|
2005-10-07 07:19:17 +00:00
|
|
|
|
2005-10-17 15:05:29 +00:00
|
|
|
# gdb any given test_x.py by running make test_x.py.gdb
|
|
|
|
%.gdb: %
|
|
|
|
$(TESTS_ENVIRONMENT) \
|
|
|
|
gdb --args \
|
|
|
|
$(PYTHON) \
|
|
|
|
$*
|
|
|
|
|
|
|
|
# valgrind any given test_x.py by running make test_x.py.valgrind
|
2005-10-07 07:19:17 +00:00
|
|
|
%.valgrind: %
|
|
|
|
$(TESTS_ENVIRONMENT) \
|
2006-06-12 16:51:36 +00:00
|
|
|
G_DEBUG=gc-friendly G_SLICE=always-malloc \
|
2005-10-07 07:19:17 +00:00
|
|
|
$(VALGRIND_PATH) -q \
|
|
|
|
--suppressions=$(GSTSUPP) \
|
|
|
|
--suppressions=$(PYTHONSUPP) \
|
2005-10-07 13:48:20 +00:00
|
|
|
--suppressions=$(GSTPYTHONSUPP) \
|
2006-06-09 14:15:53 +00:00
|
|
|
--tool=memcheck --leak-check=full --trace-children=yes \
|
|
|
|
--leak-resolution=high --num-callers=50 \
|
2005-10-07 07:19:17 +00:00
|
|
|
$(PYTHON) \
|
|
|
|
$* 2>&1 | tee valgrind.log
|
|
|
|
@if grep "tely lost" valgrind.log; then \
|
|
|
|
rm valgrind.log; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
@rm valgrind.log
|
|
|
|
|
|
|
|
# valgrind all tests
|
2005-10-11 12:42:53 +00:00
|
|
|
valgrind: $(tests)
|
2005-10-07 07:19:17 +00:00
|
|
|
@echo "Valgrinding tests ..."
|
|
|
|
@failed=0; \
|
2005-10-11 12:42:53 +00:00
|
|
|
for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(tests)); do \
|
2005-10-07 07:19:17 +00:00
|
|
|
make $$t.valgrind; \
|
|
|
|
if test "$$?" -ne 0; then \
|
|
|
|
echo "Valgrind error for test $$t"; \
|
|
|
|
failed=`expr $$failed + 1`; \
|
|
|
|
whicht="$$whicht $$t"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
if test "$$failed" -ne 0; then \
|
|
|
|
echo "$$failed tests had leaks under valgrind:"; \
|
|
|
|
echo "$$whicht"; \
|
|
|
|
false; \
|
|
|
|
fi
|