valgrind: $(TESTS)
@echo "Valgrinding tests ..."
@failed=0; \
- @for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \
+ for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \
$(MAKE) $$t.valgrind; \
if test "$$?" -ne 0; then \
- echo "Valgrind error for test $$t"; \
+ echo "Valgrind error for test $$t"; \
failed=`expr $$failed + 1`; \
whicht="$$whicht $$t"; \
- fi; \
+ fi; \
+ done; \
+ if test "$$failed" -ne 0; then \
+ echo "$$failed tests had leaks or errors under valgrind:"; \
+ echo "$$whicht"; \
+ false; \
+ fi
+
+# valgrind all tests and generate suppressions
+valgrind.gen-suppressions: $(TESTS)
+ @echo "Valgrinding tests ..."
+ @failed=0; \
+ for t in $(filter-out $(VALGRIND_TESTS_DISABLE),$(TESTS)); do \
+ $(MAKE) $$t.valgrind.gen-suppressions; \
+ 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 or errors under valgrind:"; \
@echo "make (dir)/(test).gdb -- start up gdb for the given test"
@echo
@echo "make valgrind -- valgrind all tests"
+ @echo "make valgrind.gen-suppressions -- generate suppressions for all tests"
+ @echo " and save to suppressions.log"
@echo "make (dir)/(test).valgrind -- valgrind the given test"
@echo "make (dir)/(test).valgrind-forever -- valgrind the given test forever"
@echo "make (dir)/(test).valgrind.gen-suppressions -- generate suppressions"