check.mak: Add a "make valgrind.gen-suppressions" rule
authorEdward Hervey <bilboed@bilboed.com>
Wed, 24 Mar 2010 16:32:07 +0000 (17:32 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 24 Mar 2010 16:32:07 +0000 (17:32 +0100)
This allows generating suppressions for all tests

check.mak

index 0abd609..9686841 100644 (file)
--- a/check.mak
+++ b/check.mak
@@ -121,6 +121,24 @@ valgrind: $(TESTS)
                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 "$$whicht";                                        \
+               false;                                                  \
+       fi
+
 # inspect every plugin feature
 GST_INSPECT = $(GST_TOOLS_DIR)/gst-inspect-$(GST_MAJORMINOR)
 inspect:
@@ -141,6 +159,8 @@ help:
        @echo "make (dir)/(test).gdb              -- start up gdb for the given test"
        @echo
        @echo "make valgrind                      -- valgrind all tests"
+       @echo "make valgrind.gen-suppressionsx    -- 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"