]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Enable leak checks for unit tests with valgrind
authorDamien Miller <djm@mindrot.org>
Fri, 13 Jul 2018 01:39:25 +0000 (11:39 +1000)
committerDamien Miller <djm@mindrot.org>
Fri, 13 Jul 2018 01:41:33 +0000 (11:41 +1000)
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

index d1c11000847cc82ceb81c3502a545e8c41c2d7d5..4143ead4b62eae15fb1b34607dfa2a29958dc8fb 100755 (executable)
@@ -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}"