|
Packit Service |
963350 |
# keep target around, since it's referenced in the modules' Makefiles
|
|
Packit Service |
963350 |
clean-local-check:
|
|
Packit Service |
963350 |
@echo
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
if HAVE_VALGRIND
|
|
Packit Service |
963350 |
# hangs spectacularly on some machines, so let's not do this by default yet
|
|
Packit Service |
963350 |
check-valgrind:
|
|
Packit Service |
963350 |
$(MAKE) valgrind
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
check-valgrind:
|
|
Packit Service |
963350 |
@true
|
|
Packit Service |
963350 |
endif
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
LOOPS ?= 10
|
|
Packit Service |
963350 |
AM_TESTS_ENVIRONMENT = CK_DEFAULT_TIMEOUT=20
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# run any given test by running make test.check
|
|
Packit Service |
963350 |
# if the test fails, run it again at at least debug level 2
|
|
Packit Service |
963350 |
%.check: %
|
|
Packit Service |
963350 |
@$(AM_TESTS_ENVIRONMENT) \
|
|
Packit Service |
963350 |
$* || \
|
|
Packit Service |
963350 |
$(AM_TESTS_ENVIRONMENT) \
|
|
Packit Service |
963350 |
GST_DEBUG=$$GST_DEBUG,*:2 \
|
|
Packit Service |
963350 |
$*
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# just like 'check', but don't run it again if it fails (useful for debugging)
|
|
Packit Service |
963350 |
%.check-norepeat: %
|
|
Packit Service |
963350 |
@$(AM_TESTS_ENVIRONMENT) \
|
|
Packit Service |
963350 |
$*
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# run any given test in a loop
|
|
Packit Service |
963350 |
%.torture: %
|
|
Packit Service |
963350 |
@for i in `seq 1 $(LOOPS)`; do \
|
|
Packit Service |
963350 |
$(AM_TESTS_ENVIRONMENT) \
|
|
Packit Service |
963350 |
$*; done
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# run any given test in an infinite loop
|
|
Packit Service |
963350 |
%.forever: %
|
|
Packit Service |
963350 |
@while true; do \
|
|
Packit Service |
963350 |
$(AM_TESTS_ENVIRONMENT) \
|
|
Packit Service |
963350 |
$* || break; done
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# valgrind any given test by running make test.valgrind
|
|
Packit Service |
963350 |
%.valgrind: %
|
|
Packit Service |
963350 |
@valgrind_log=$(subst /,-,$*-valgrind.log); \
|
|
Packit Service |
963350 |
$(AM_TESTS_ENVIRONMENT) \
|
|
Packit Service |
963350 |
CK_DEFAULT_TIMEOUT=360 \
|
|
Packit Service |
963350 |
G_SLICE=always-malloc \
|
|
Packit Service |
963350 |
$(LIBTOOL) --mode=execute \
|
|
Packit Service |
963350 |
$(VALGRIND_PATH) -q \
|
|
Packit Service |
963350 |
$(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
|
|
Packit Service |
963350 |
--tool=memcheck --leak-check=full --trace-children=yes \
|
|
Packit Service |
963350 |
--show-possibly-lost=no \
|
|
Packit Service |
963350 |
--leak-resolution=high --num-callers=20 \
|
|
Packit Service |
963350 |
./$* 2>&1 | tee $$valgrind_log ; \
|
|
Packit Service |
963350 |
if grep "^==" $$valgrind_log > /dev/null 2>&1; then \
|
|
Packit Service |
963350 |
rm $$valgrind_log; \
|
|
Packit Service |
963350 |
exit 1; \
|
|
Packit Service |
963350 |
fi ; \
|
|
Packit Service |
963350 |
rm $$valgrind_log
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# valgrind any given test and generate suppressions for it
|
|
Packit Service |
963350 |
%.valgrind.gen-suppressions: %
|
|
Packit Service |
963350 |
@$(AM_TESTS_ENVIRONMENT) \
|
|
Packit Service |
963350 |
CK_DEFAULT_TIMEOUT=360 \
|
|
Packit Service |
963350 |
G_SLICE=always-malloc \
|
|
Packit Service |
963350 |
$(LIBTOOL) --mode=execute \
|
|
Packit Service |
963350 |
$(VALGRIND_PATH) -q \
|
|
Packit Service |
963350 |
$(foreach s,$(SUPPRESSIONS),--suppressions=$(s)) \
|
|
Packit Service |
963350 |
--tool=memcheck --leak-check=full --trace-children=yes \
|
|
Packit Service |
963350 |
--show-possibly-lost=no \
|
|
Packit Service |
963350 |
--leak-resolution=high --num-callers=20 \
|
|
Packit Service |
963350 |
--gen-suppressions=all \
|
|
Packit Service |
963350 |
./$* 2>&1 | tee suppressions.log
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# valgrind torture any given test
|
|
Packit Service |
963350 |
%.valgrind-torture: %
|
|
Packit Service |
963350 |
@for i in `seq 1 $(LOOPS)`; do \
|
|
Packit Service |
963350 |
$(MAKE) $*.valgrind || \
|
|
Packit Service |
963350 |
(echo "Failure after $$i runs"; exit 1) || \
|
|
Packit Service |
963350 |
exit 1; \
|
|
Packit Service |
963350 |
done
|
|
Packit Service |
963350 |
@banner="All $(LOOPS) loops passed"; \
|
|
Packit Service |
963350 |
dashes=`echo "$$banner" | sed s/./=/g`; \
|
|
Packit Service |
963350 |
echo $$dashes; echo $$banner; echo $$dashes
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# valgrind any given test until failure by running make test.valgrind-forever
|
|
Packit Service |
963350 |
%.valgrind-forever: %
|
|
Packit Service |
963350 |
@while $(MAKE) $*.valgrind; do \
|
|
Packit Service |
963350 |
true; done
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# gdb any given test by running make test.gdb
|
|
Packit Service |
963350 |
%.gdb: %
|
|
Packit Service |
963350 |
@$(AM_TESTS_ENVIRONMENT) \
|
|
Packit Service |
963350 |
CK_FORK=no \
|
|
Packit Service |
963350 |
$(LIBTOOL) --mode=execute \
|
|
Packit Service |
963350 |
gdb $(GDB_ARGS) $*
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
%.gdb-forever: %
|
|
Packit Service |
963350 |
@while $(MAKE) GDB_ARGS="-ex run -ex quit" $*.gdb ; do \
|
|
Packit Service |
963350 |
sleep 1; done
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
%.lcov-reset:
|
|
Packit Service |
963350 |
$(MAKE) $*.lcov-run
|
|
Packit Service |
963350 |
$(MAKE) $*.lcov-report
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
%.lcov: %
|
|
Packit Service |
963350 |
$(MAKE) $*.lcov-reset
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
if GST_GCOV_ENABLED
|
|
Packit Service |
963350 |
%.lcov-clean:
|
|
Packit Service |
963350 |
$(MAKE) -C $(top_builddir) lcov-clean
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
%.lcov-run:
|
|
Packit Service |
963350 |
$(MAKE) $*.lcov-clean
|
|
Packit Service |
963350 |
$(MAKE) $*.check
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
%.lcov-report:
|
|
Packit Service |
963350 |
$(MAKE) -C $(top_builddir) lcov-report
|
|
Packit Service |
963350 |
else
|
|
Packit Service |
963350 |
%.lcov-run:
|
|
Packit Service |
963350 |
echo "Need to reconfigure with --enable-gcov"
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
%.lcov-report:
|
|
Packit Service |
963350 |
echo "Need to reconfigure with --enable-gcov"
|
|
Packit Service |
963350 |
endif
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# torture tests
|
|
Packit Service |
963350 |
torture: $(TESTS)
|
|
Packit Service |
963350 |
-rm test-registry.*
|
|
Packit Service |
963350 |
@echo "Torturing tests ..."
|
|
Packit Service |
963350 |
@for i in `seq 1 $(LOOPS)`; do \
|
|
Packit Service |
963350 |
$(MAKE) check || \
|
|
Packit Service |
963350 |
(echo "Failure after $$i runs"; exit 1) || \
|
|
Packit Service |
963350 |
exit 1; \
|
|
Packit Service |
963350 |
done
|
|
Packit Service |
963350 |
@banner="All $(LOOPS) loops passed"; \
|
|
Packit Service |
963350 |
dashes=`echo "$$banner" | sed s/./=/g`; \
|
|
Packit Service |
963350 |
echo $$dashes; echo $$banner; echo $$dashes
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# forever tests
|
|
Packit Service |
963350 |
forever: $(TESTS)
|
|
Packit Service |
963350 |
-rm test-registry.*
|
|
Packit Service |
963350 |
@echo "Forever tests ..."
|
|
Packit Service |
963350 |
@while true; do \
|
|
Packit Service |
963350 |
$(MAKE) check || \
|
|
Packit Service |
963350 |
(echo "Failure"; exit 1) || \
|
|
Packit Service |
963350 |
exit 1; \
|
|
Packit Service |
963350 |
done
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# valgrind all tests
|
|
Packit Service |
963350 |
valgrind: $(TESTS)
|
|
Packit Service |
963350 |
@echo "Valgrinding tests ..."
|
|
Packit Service |
963350 |
@failed=0; valgrind_targets=""; \
|
|
Packit Service |
963350 |
for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \
|
|
Packit Service |
963350 |
valgrind_targets="$$valgrind_targets $$t.valgrind"; \
|
|
Packit Service |
963350 |
done; \
|
|
Packit Service |
963350 |
if ! $(MAKE) $$valgrind_targets ; then \
|
|
Packit Service |
963350 |
echo "Some tests had leaks or errors under valgrind"; \
|
|
Packit Service |
963350 |
false; \
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# valgrind all tests until failure
|
|
Packit Service |
963350 |
valgrind-forever: $(TESTS)
|
|
Packit Service |
963350 |
-rm test-registry.*
|
|
Packit Service |
963350 |
@echo "Forever valgrinding tests ..."
|
|
Packit Service |
963350 |
@while true; do \
|
|
Packit Service |
963350 |
$(MAKE) valgrind || \
|
|
Packit Service |
963350 |
(echo "Failure"; exit 1) || \
|
|
Packit Service |
963350 |
exit 1; \
|
|
Packit Service |
963350 |
done
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# valgrind torture all tests
|
|
Packit Service |
963350 |
valgrind-torture: $(TESTS)
|
|
Packit Service |
963350 |
-rm test-registry.*
|
|
Packit Service |
963350 |
@echo "Torturing and valgrinding tests ..."
|
|
Packit Service |
963350 |
@for i in `seq 1 $(LOOPS)`; do \
|
|
Packit Service |
963350 |
$(MAKE) valgrind || \
|
|
Packit Service |
963350 |
(echo "Failure after $$i runs"; exit 1) || \
|
|
Packit Service |
963350 |
exit 1; \
|
|
Packit Service |
963350 |
done
|
|
Packit Service |
963350 |
@banner="All $(LOOPS) loops passed"; \
|
|
Packit Service |
963350 |
dashes=`echo "$$banner" | sed s/./=/g`; \
|
|
Packit Service |
963350 |
echo $$dashes; echo $$banner; echo $$dashes
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# valgrind all tests and generate suppressions
|
|
Packit Service |
963350 |
valgrind.gen-suppressions: $(TESTS)
|
|
Packit Service |
963350 |
@echo "Valgrinding tests ..."
|
|
Packit Service |
963350 |
@failed=0; \
|
|
Packit Service |
963350 |
for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \
|
|
Packit Service |
963350 |
$(MAKE) $$t.valgrind.gen-suppressions; \
|
|
Packit Service |
963350 |
if test "$$?" -ne 0; then \
|
|
Packit Service |
963350 |
echo "Valgrind error for test $$t"; \
|
|
Packit Service |
963350 |
failed=`expr $$failed + 1`; \
|
|
Packit Service |
963350 |
whicht="$$whicht $$t"; \
|
|
Packit Service |
963350 |
fi; \
|
|
Packit Service |
963350 |
done; \
|
|
Packit Service |
963350 |
if test "$$failed" -ne 0; then \
|
|
Packit Service |
963350 |
echo "$$failed tests had leaks or errors under valgrind:"; \
|
|
Packit Service |
963350 |
echo "$$whicht"; \
|
|
Packit Service |
963350 |
false; \
|
|
Packit Service |
963350 |
fi
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# inspect every plugin feature
|
|
Packit Service |
963350 |
GST_INSPECT = $(GST_TOOLS_DIR)/gst-inspect-$(GST_API_VERSION)
|
|
Packit Service |
963350 |
inspect:
|
|
Packit Service |
963350 |
@echo "Inspecting features ..."
|
|
Packit Service |
963350 |
@for e in `$(AM_TESTS_ENVIRONMENT) $(GST_INSPECT) | head -n -2 \
|
|
Packit Service |
963350 |
| cut -d: -f2`; \
|
|
Packit Service |
963350 |
do echo Inspecting $$e; \
|
|
Packit Service |
963350 |
$(GST_INSPECT) $$e > /dev/null 2>&1; done
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
# build all tests
|
|
Packit Service |
963350 |
build-checks: $(TESTS)
|
|
Packit Service |
963350 |
|
|
Packit Service |
963350 |
help:
|
|
Packit Service |
963350 |
@echo
|
|
Packit Service |
963350 |
@echo "make check -- run all checks"
|
|
Packit Service |
963350 |
@echo "make torture -- run all checks $(LOOPS) times"
|
|
Packit Service |
963350 |
@echo "make (dir)/(test).check -- run the given check once, repeat with GST_DEBUG=*:2 if it fails"
|
|
Packit Service |
963350 |
@echo "make (dir)/(test).check-norepeat -- run the given check once, but don't run it again if it fails"
|
|
Packit Service |
963350 |
@echo "make (dir)/(test).forever -- run the given check forever"
|
|
Packit Service |
963350 |
@echo "make (dir)/(test).torture -- run the given check $(LOOPS) times"
|
|
Packit Service |
963350 |
@echo
|
|
Packit Service |
963350 |
@echo "make (dir)/(test).gdb -- start up gdb for the given test"
|
|
Packit Service |
963350 |
@echo
|
|
Packit Service |
963350 |
@echo "make valgrind -- valgrind all tests"
|
|
Packit Service |
963350 |
@echo "make valgrind-forever -- valgrind all tests forever"
|
|
Packit Service |
963350 |
@echo "make valgrind-torture -- valgrind all tests $(LOOPS) times"
|
|
Packit Service |
963350 |
@echo "make valgrind.gen-suppressions -- generate suppressions for all tests"
|
|
Packit Service |
963350 |
@echo " and save to suppressions.log"
|
|
Packit Service |
963350 |
@echo "make (dir)/(test).valgrind -- valgrind the given test"
|
|
Packit Service |
963350 |
@echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever"
|
|
Packit Service |
963350 |
@echo "make (dir)/(test).valgrind-torture -- valgrind the given test $(LOOPS) times"
|
|
Packit Service |
963350 |
@echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions"
|
|
Packit Service |
963350 |
@echo " and save to suppressions.log"
|
|
Packit Service |
963350 |
@echo "make inspect -- inspect all plugin features"
|
|
Packit Service |
963350 |
@echo "make build-checks -- build all checks (but don't run them)"
|
|
Packit Service |
963350 |
@echo
|
|
Packit Service |
963350 |
@echo
|
|
Packit Service |
963350 |
@echo "Additionally, you can use the GST_CHECKS environment variable to"
|
|
Packit Service |
963350 |
@echo "specify which test(s) should be run. This is useful if you are"
|
|
Packit Service |
963350 |
@echo "debugging a failure in one particular test, or want to reproduce"
|
|
Packit Service |
963350 |
@echo "a race condition in a single test."
|
|
Packit Service |
963350 |
@echo
|
|
Packit Service |
963350 |
@echo "Examples:"
|
|
Packit Service |
963350 |
@echo
|
|
Packit Service |
963350 |
@echo " GST_CHECKS=test_this,test_that make element/foobar.check"
|
|
Packit Service |
963350 |
@echo " GST_CHECKS=test_many_threads make element/foobar.forever"
|
|
Packit Service |
963350 |
@echo
|
|
Packit Service |
963350 |
|