2 for i in `find . -name ".libs" -type d`; do \
7 # hangs spectacularly on some machines, so let's not do this by default yet
17 # run any given test by running make test.check
18 # if the test fails, run it again at at least debug level 2
20 @$(TESTS_ENVIRONMENT) \
21 CK_DEFAULT_TIMEOUT=20 \
23 $(TESTS_ENVIRONMENT) \
24 GST_DEBUG=$$GST_DEBUG,*:2 \
25 CK_DEFAULT_TIMEOUT=20 \
28 # run any given test in a loop
30 @for i in `seq 1 $(LOOPS)`; do \
31 $(TESTS_ENVIRONMENT) \
32 CK_DEFAULT_TIMEOUT=20 \
35 # run any given test in an infinite loop
38 $(TESTS_ENVIRONMENT) \
39 CK_DEFAULT_TIMEOUT=20 \
42 # valgrind any given test by running make test.valgrind
44 $(TESTS_ENVIRONMENT) \
45 CK_DEFAULT_TIMEOUT=360 \
46 G_SLICE=always-malloc \
47 libtool --mode=execute \
49 $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
50 --tool=memcheck --leak-check=full --trace-children=yes \
51 --leak-resolution=high --num-callers=20 \
52 ./$* 2>&1 | tee valgrind.log
53 @if grep "==" valgrind.log > /dev/null 2>&1; then \
59 # valgrind any given test and generate suppressions for it
60 %.valgrind.gen-suppressions: %
61 $(TESTS_ENVIRONMENT) \
62 CK_DEFAULT_TIMEOUT=360 \
63 G_SLICE=always-malloc \
64 libtool --mode=execute \
66 $(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
67 --tool=memcheck --leak-check=full --trace-children=yes \
68 --leak-resolution=high --num-callers=20 \
69 --gen-suppressions=all \
70 ./$* 2>&1 | tee suppressions.log
72 # valgrind any given test until failure by running make test.valgrind-forever
74 @while $(MAKE) $*.valgrind; do \
77 # gdb any given test by running make test.gdb
79 $(TESTS_ENVIRONMENT) \
81 libtool --mode=execute \
87 @echo "Torturing tests ..."
88 for i in `seq 1 $(LOOPS)`; do \
90 (echo "Failure after $$i runs"; exit 1) || \
93 @banner="All $(LOOPS) loops passed"; \
94 dashes=`echo "$$banner" | sed s/./=/g`; \
95 echo $$dashes; echo $$banner; echo $$dashes
100 @echo "Forever tests ..."
103 (echo "Failure"; exit 1) || \
109 @echo "Valgrinding tests ..."
111 for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \
112 $(MAKE) $$t.valgrind; \
113 if test "$$?" -ne 0; then \
114 echo "Valgrind error for test $$t"; \
115 failed=`expr $$failed + 1`; \
116 whicht="$$whicht $$t"; \
119 if test "$$failed" -ne 0; then \
120 echo "$$failed tests had leaks or errors under valgrind:"; \
125 # inspect every plugin feature
126 GST_INSPECT = $(GST_TOOLS_DIR)/gst-inspect-$(GST_MAJORMINOR)
128 @echo "Inspecting features ..."
129 for e in `$(TESTS_ENVIRONMENT) $(GST_INSPECT) | head -n -2 \
131 do echo Inspecting $$e; \
132 $(GST_INSPECT) $$e > /dev/null 2>&1; done
136 @echo "make check -- run all checks"
137 @echo "make torture -- run all checks $(LOOPS) times"
138 @echo "make (dir)/(test).check -- run the given check once"
139 @echo "make (dir)/(test).forever -- run the given check forever"
140 @echo "make (dir)/(test).torture -- run the given check $(LOOPS) times"
142 @echo "make (dir)/(test).gdb -- start up gdb for the given test"
144 @echo "make valgrind -- valgrind all tests"
145 @echo "make (dir)/(test).valgrind -- valgrind the given test"
146 @echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever"
147 @echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions"
148 @echo " and save to suppressions.log"
149 @echo "make inspect -- inspect all plugin features"
152 @echo "Additionally, you can use the GST_CHECKS environment variable to"
153 @echo "specify which test(s) should be run. This is useful if you are"
154 @echo "debugging a failure in one particular test, or want to reproduce"
155 @echo "a race condition in a single test."
159 @echo " GST_CHECKS=test_this,test_that make element/foobar.check"
160 @echo " GST_CHECKS=test_many_threads make element/foobar.forever"