From: NeilBrown Date: Thu, 14 Feb 2013 05:53:42 +0000 (+1100) Subject: Add "make valgrind" X-Git-Tag: v1.0~60 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=84e4a325d7056a6504e01e8889c56a16a21deeed;p=wiggle.git Add "make valgrind" This runs the test suite under valgrind and complains if any errors are detected. Signed-off-by: NeilBrown --- diff --git a/Makefile b/Makefile index 46ab769..212b13a 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,9 @@ split.o :: ccan/hash/hash.h config.h test: wiggle dotest ./dotest +valgrind: wiggle dotest + ./dotest valgrind + wiggle.man : wiggle.1 nroff -man wiggle.1 > wiggle.man diff --git a/dotest b/dotest index 62ba094..0f62211 100755 --- a/dotest +++ b/dotest @@ -29,7 +29,11 @@ if $TIME true > /dev/null 2>&1 then : else TIME= fi -#TIME=valgrind +vallog=/tmp/valg.log-$$ +> $vallog +if [ " $1" = " valgrind" ]; then + TIME="valgrind --log-file=$vallog" +fi status=0 ok=0 fail=0 @@ -94,6 +98,9 @@ do ;; esac if [ $xit = 0 ]; then msg=SUCCEEDED; else msg=FAILED; fi + if grep 'ERROR SUMMARY: [1-9]' $vallog > /dev/null 2>&1 + then msg="$msg WITH VALGRIND ERRORS"; xit=1 + fi echo $path $msg `grep -v 'Command exited' .time 2> /dev/null` rm -f .time exit $xit