parse output of valgrind and check for definitely lost, and error out; somehow I...
authorThomas Vander Stichele <thomas@apestaart.org>
Sun, 21 Aug 2005 10:29:47 +0000 (10:29 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Sun, 21 Aug 2005 10:29:47 +0000 (10:29 +0000)
Original commit message from CVS:
parse output of valgrind and check for definitely lost, and error
out; somehow I was led to believe valgrind returns non-zero for
leaks, but I can't make it do that, so let's parse

ChangeLog
check.mak

index 1a297b7..623078b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-08-21  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * check.mak:
+         parse output of valgrind and check for definitely lost, and error
+         out; somehow I was led to believe valgrind returns non-zero for
+         leaks, but I can't make it do that, so let's parse
+
 2005-08-20  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * check.mak:
index 952fd29..1defa18 100644 (file)
--- a/check.mak
+++ b/check.mak
@@ -23,7 +23,13 @@ endif
        libtool --mode=execute                                  \
        $(VALGRIND_PATH) -q --suppressions=$(SUPPRESSIONS)      \
        --tool=memcheck --leak-check=yes --trace-children=yes   \
-       $*
+       $* > valgrind.log 2>&1
+       @if grep "tely lost" valgrind.log; then                 \
+           cat valgrind.log;                                   \
+           rm valgrind.log;                                    \
+           exit 1;                                             \
+       fi
+       rm valgrind.log
 
 # valgrind all tests
 valgrind: $(TESTS)
@@ -35,9 +41,11 @@ valgrind: $(TESTS)
                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 under valgrind";         \
+               echo "$$failed tests had leaks under valgrind:";        \
+               echo "$$whicht";                                        \
                false;                                                  \
        fi