From d20720d373d8563ee737d1a45dc5e0804d622dbc Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 11 Jul 2018 09:56:36 +1000 Subject: disable valgrind memleak checking by default Add VALGRIND_CHECK_LEAKS knob to turn it back on. --- regress/valgrind-unit.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'regress/valgrind-unit.sh') diff --git a/regress/valgrind-unit.sh b/regress/valgrind-unit.sh index 433cb069a..c353c2cbc 100755 --- a/regress/valgrind-unit.sh +++ b/regress/valgrind-unit.sh @@ -8,9 +8,13 @@ test "x$OBJ" = "x" && OBJ=$PWD # This mostly replicates the logic in test-exec.sh for running the # regress tests under valgrind. +VG_LEAK="--leak-check=no" +if [ x"$VALGRIND_CHECK_LEAKS" = "x" ]; then + VG_LEAK="--leak-check=full" +fi VG_TEST=`basename $UNIT_BINARY` VG_LOG="$OBJ/valgrind-out/${VG_TEST}.%p" -VG_OPTS="--track-origins=yes --leak-check=full --log-file=${VG_LOG}" +VG_OPTS="--track-origins=yes $VG_LEAK --log-file=${VG_LOG}" VG_OPTS="$VG_OPTS --trace-children=yes" VG_PATH="valgrind" if [ "x$VALGRIND_PATH" != "x" ]; then -- cgit v1.2.3 From fccfa239def497615f92ed28acc57cfe63da3666 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 11 Jul 2018 10:19:56 +1000 Subject: VALGRIND_CHECK_LEAKS logic was backwards :( --- regress/test-exec.sh | 2 +- regress/valgrind-unit.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'regress/valgrind-unit.sh') diff --git a/regress/test-exec.sh b/regress/test-exec.sh index ed235cfaf..f09fe0ec4 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh @@ -164,7 +164,7 @@ if [ "x$USE_VALGRIND" != "x" ]; then if [ x"$VG_SKIP" = "x" ]; then VG_LEAK="--leak-check=no" - if [ x"$VALGRIND_CHECK_LEAKS" = "x" ]; then + if [ x"$VALGRIND_CHECK_LEAKS" != "x" ]; then VG_LEAK="--leak-check=full" fi VG_IGNORE="/bin/*,/sbin/*,/usr/*,/var/*" diff --git a/regress/valgrind-unit.sh b/regress/valgrind-unit.sh index c353c2cbc..d1c110008 100755 --- a/regress/valgrind-unit.sh +++ b/regress/valgrind-unit.sh @@ -9,7 +9,7 @@ test "x$OBJ" = "x" && OBJ=$PWD # This mostly replicates the logic in test-exec.sh for running the # regress tests under valgrind. VG_LEAK="--leak-check=no" -if [ x"$VALGRIND_CHECK_LEAKS" = "x" ]; then +if [ x"$VALGRIND_CHECK_LEAKS" != "x" ]; then VG_LEAK="--leak-check=full" fi VG_TEST=`basename $UNIT_BINARY` -- cgit v1.2.3 From 2f6accff5085eb79b0dbe262d8b85ed017d1a51c Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 13 Jul 2018 11:39:25 +1000 Subject: Enable leak checks for unit tests with valgrind Leave the leak checking on unconditionally when running with valgrind. The unit tests are leak-free and I want them to stay that way. --- regress/valgrind-unit.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'regress/valgrind-unit.sh') diff --git a/regress/valgrind-unit.sh b/regress/valgrind-unit.sh index d1c110008..4143ead4b 100755 --- a/regress/valgrind-unit.sh +++ b/regress/valgrind-unit.sh @@ -7,11 +7,9 @@ UNIT_ARGS="$@" test "x$OBJ" = "x" && OBJ=$PWD # This mostly replicates the logic in test-exec.sh for running the -# regress tests under valgrind. -VG_LEAK="--leak-check=no" -if [ x"$VALGRIND_CHECK_LEAKS" != "x" ]; then - VG_LEAK="--leak-check=full" -fi +# regress tests under valgrind, except that we unconditionally enable +# leak checking because the unit tests should be clean. +VG_LEAK="--leak-check=full" VG_TEST=`basename $UNIT_BINARY` VG_LOG="$OBJ/valgrind-out/${VG_TEST}.%p" VG_OPTS="--track-origins=yes $VG_LEAK --log-file=${VG_LOG}" -- cgit v1.2.3