1 # keep target around, since it's referenced in the modules' Makefiles
6 # hangs spectacularly on some machines, so let's not do this by default yet
16 # run any given test by running make test.check
17 # if the test fails, run it again at at least debug level 2
19 @$(TESTS_ENVIRONMENT) \
20 CK_DEFAULT_TIMEOUT=20 \
22 $(TESTS_ENVIRONMENT) \
23 GST_DEBUG=$$GST_DEBUG,*:2 \
24 CK_DEFAULT_TIMEOUT=20 \
27 # run any given test in a loop
29 @for i in `seq 1 $(LOOPS)`; do \
30 $(TESTS_ENVIRONMENT) \
31 CK_DEFAULT_TIMEOUT=20 \
34 # run any given test in an infinite loop
37 $(TESTS_ENVIRONMENT) \
38 CK_DEFAULT_TIMEOUT=20 \
41 # valgrind any given test by running make test.valgrind
43 @$(TESTS_ENVIRONMENT) \
44 CK_DEFAULT_TIMEOUT=360 \
45 G_SLICE=always-malloc \
46 $(LIBTOOL) --mode=execute \
48 $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
49 --tool=memcheck --leak-check=full --trace-children=yes \
50 --leak-resolution=high --num-callers=20 \
51 ./$* 2>&1 | tee valgrind.log
52 @if grep "==" valgrind.log > /dev/null 2>&1; then \
58 # valgrind any given test and generate suppressions for it
59 %.valgrind.gen-suppressions: %
60 @$(TESTS_ENVIRONMENT) \
61 CK_DEFAULT_TIMEOUT=360 \
62 G_SLICE=always-malloc \
63 $(LIBTOOL) --mode=execute \
65 $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
66 --tool=memcheck --leak-check=full --trace-children=yes \
67 --leak-resolution=high --num-callers=20 \
68 --gen-suppressions=all \
69 ./$* 2>&1 | tee suppressions.log
71 # valgrind any given test until failure by running make test.valgrind-forever
73 @while $(MAKE) $*.valgrind; do \
76 # gdb any given test by running make test.gdb
78 @$(TESTS_ENVIRONMENT) \
80 $(LIBTOOL) --mode=execute \
86 @echo "Torturing tests ..."
87 @for i in `seq 1 $(LOOPS)`; do \
89 (echo "Failure after $$i runs"; exit 1) || \
92 @banner="All $(LOOPS) loops passed"; \
93 dashes=`echo "$$banner" | sed s/./=/g`; \
94 echo $$dashes; echo $$banner; echo $$dashes
99 @echo "Forever tests ..."
102 (echo "Failure"; exit 1) || \
108 @echo "Valgrinding tests ..."
110 for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \
111 $(MAKE) $$t.valgrind; \
112 if test "$$?" -ne 0; then \
113 echo "Valgrind error for test $$t"; \
114 failed=`expr $$failed + 1`; \
115 whicht="$$whicht $$t"; \
118 if test "$$failed" -ne 0; then \
119 echo "$$failed tests had leaks or errors under valgrind:"; \
124 # inspect every plugin feature
125 GST_INSPECT = $(GST_TOOLS_DIR)/gst-inspect-$(GST_MAJORMINOR)
127 @echo "Inspecting features ..."
128 @for e in `$(TESTS_ENVIRONMENT) $(GST_INSPECT) | head -n -2 \
130 do echo Inspecting $$e; \
131 $(GST_INSPECT) $$e > /dev/null 2>&1; done
135 @echo "make check -- run all checks"
136 @echo "make torture -- run all checks $(LOOPS) times"
137 @echo "make (dir)/(test).check -- run the given check once"
138 @echo "make (dir)/(test).forever -- run the given check forever"
139 @echo "make (dir)/(test).torture -- run the given check $(LOOPS) times"
141 @echo "make (dir)/(test).gdb -- start up gdb for the given test"
143 @echo "make valgrind -- valgrind all tests"
144 @echo "make (dir)/(test).valgrind -- valgrind the given test"
145 @echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever"
146 @echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions"
147 @echo " and save to suppressions.log"
148 @echo "make inspect -- inspect all plugin features"
151 @echo "Additionally, you can use the GST_CHECKS environment variable to"
152 @echo "specify which test(s) should be run. This is useful if you are"
153 @echo "debugging a failure in one particular test, or want to reproduce"
154 @echo "a race condition in a single test."
158 @echo " GST_CHECKS=test_this,test_that make element/foobar.check"
159 @echo " GST_CHECKS=test_many_threads make element/foobar.forever"