From 84e4a325d7056a6504e01e8889c56a16a21deeed Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 14 Feb 2013 16:53:42 +1100 Subject: [PATCH] Add "make valgrind" This runs the test suite under valgrind and complains if any errors are detected. Signed-off-by: NeilBrown --- Makefile | 3 +++ dotest | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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 -- 2.39.5