]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Add --enable-valgrind-tests that make it possible to enable/disable
authorSimon Josefsson <simon@josefsson.org>
Tue, 27 Jun 2006 13:16:00 +0000 (13:16 +0000)
committerSimon Josefsson <simon@josefsson.org>
Tue, 27 Jun 2006 13:16:00 +0000 (13:16 +0000)
use of valgrind on self tests specifically.  Defaults to enabled if
valgrind is installed and we aren't cross-compiling.

configure.in
tests/Makefile.am

index c447d998e9456dd388fcbdc26a904a0f2c7dfc0f..0d47276e4bf7e042e2aef660bb521e60c22b5708 100644 (file)
@@ -81,6 +81,21 @@ AC_ARG_ENABLE(profile-mode,
 opt_profiler_mode=$enableval)
 AC_MSG_RESULT($opt_profiler_mode)
 
+if test "$cross_compiling" != no; then
+  AC_CHECK_PROGS(VALGRIND, valgrind)
+fi
+if test -z "$VALGRIND"; then
+  opt_valgrind_tests=no
+else
+  opt_valgrind_tests=yes
+fi 
+AC_MSG_CHECKING([whether self tests are run under valgrind])
+AC_ARG_ENABLE(valgrind-tests,
+       AS_HELP_STRING([--enable-valgrind-tests],
+                       [run self tests under valgrind]),
+  opt_valgrind_tests=$enableval)
+AC_MSG_RESULT($opt_valgrind_tests)
+
 AC_MSG_RESULT([***
 *** Checking for compilation programs...
 ])
index 17a3a9573d270cdbb448bf515555c4d56c35a99f..632a7c8eaa908f29ae6604e6a33cca2aae82d44c 100644 (file)
@@ -45,9 +45,7 @@ dist_check_SCRIPTS = pkcs12_neon pkcs8
 
 TESTS = pkcs12_neon pkcs8 $(ctests)
 
-VALGRIND=valgrind --tool=memcheck --leak-check=full --leak-resolution=high \
-       --show-reachable=yes --num-callers=50
 TESTS_ENVIRONMENT = \
        PKCS12FILE=$(srcdir)/client.p12 \
        PKCS12PASSWORD=foobar \
-       `if $(VALGRIND) /bin/true > /dev/null 2>&1; then echo $(VALGRIND); else echo $$SHELL -c; fi`
+       $(VALGRIND)