From 1352385432a3a670f5211482f8de440d0c3bdb2f Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 24 Nov 2021 18:44:13 +0100 Subject: build: update to use the latest valgrind-tests module from Gnulib This adjust the existing valgrind invocations in the test suite with: https://www.gnu.org/software/gnulib/manual/html_node/Valgrind-options.html - make --suppressions option to per directory, using AM_VALGRINDFLAGS - use LOG_VALGRIND for LOG_COMPILER - quote '$(LOG_VALGRIND)' in TESTS_ENVIRONMENT - move gl_VALGRIND_TESTS_DEFAULT_NO call before gl_INIT Signed-off-by: Daiki Ueno --- configure.ac | 6 +++--- tests/Makefile.am | 4 +++- tests/cert-tests/Makefile.am | 5 ++++- tests/suite/Makefile.am | 6 ++++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index b689a5f94a..a871199823 100644 --- a/configure.ac +++ b/configure.ac @@ -459,7 +459,9 @@ fi AM_CONDITIONAL(HAVE_LIBUNISTRING, test "$ac_have_unistring" = "yes") # specify our own suppressions file; this needs to be set before gl_INIT -DEFAULT_VALGRINDFLAGS='-q --error-exitcode=1 --leak-check=full --track-origins=yes --gen-suppressions=all --suppressions=\$(srcdir)/suppressions.valgrind' +DEFAULT_VALGRINDFLAGS='-q --error-exitcode=1 --leak-check=full --track-origins=yes --gen-suppressions=all' + +gl_VALGRIND_TESTS_DEFAULT_NO dnl Note that g*l_INIT are run after we check for library capabilities, dnl to prevent issues from caching lib dependencies. See discussion @@ -559,8 +561,6 @@ if test "$gl_gcc_warnings" = yes; then gl_WARN_ADD([-fdiagnostics-show-option]) fi -gl_VALGRIND_TESTS_DEFAULT_NO - if test "$gl_cv_opt_valgrind_tests" != no; then gl_WARN_ADD([-fno-builtin-strcmp]) fi diff --git a/tests/Makefile.am b/tests/Makefile.am index e9ee9e9de2..d15595a657 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -620,7 +620,9 @@ endif TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) -LOG_COMPILER = $(VALGRIND) + +AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind +LOG_COMPILER = $(LOG_VALGRIND) distclean-local: rm -rf softhsm-*.db softhsm-*.config *.tmp tmp-* x509-crt-list-import-url.config.db port.lock.d diff --git a/tests/cert-tests/Makefile.am b/tests/cert-tests/Makefile.am index fe196917bb..f1de1bef27 100644 --- a/tests/cert-tests/Makefile.am +++ b/tests/cert-tests/Makefile.am @@ -152,7 +152,7 @@ TESTS = $(dist_check_SCRIPTS) # which are not trivial, and makes no point to address. TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \ LC_ALL="C" \ - VALGRIND="$(VALGRIND)" \ + VALGRIND='$(LOG_VALGRIND)' \ LIBTOOL="$(LIBTOOL)" \ top_builddir="$(top_builddir)" \ abs_top_builddir="$(abs_top_builddir)" \ @@ -180,5 +180,8 @@ if DISABLE_BASH_TESTS TESTS_ENVIRONMENT += DISABLE_BASH_TESTS=1 endif +AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind +LOG_COMPILER = $(LOG_VALGRIND) + distclean-local: rm -rf tmp-* *.tmp diff --git a/tests/suite/Makefile.am b/tests/suite/Makefile.am index 2bfb3cd5fd..aaac8c08b2 100644 --- a/tests/suite/Makefile.am +++ b/tests/suite/Makefile.am @@ -61,7 +61,7 @@ scripts_to_test = chain.sh \ TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \ LC_ALL="C" \ PYTHON="$(PYTHON)" \ - VALGRIND="$(VALGRIND)" \ + VALGRIND='$(LOG_VALGRIND)' \ top_builddir="$(top_builddir)" \ abs_top_builddir="$(abs_top_builddir)" \ srcdir="$(srcdir)" \ @@ -117,4 +117,6 @@ prime_check_CPPFLAGS = $(AM_CPPFLAGS) $(NETTLE_CFLAGS) TEST_EXTENSIONS = .sh SH_LOG_COMPILER = $(SHELL) -LOG_COMPILER = $(VALGRIND) + +AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind +LOG_COMPILER = $(LOG_VALGRIND) -- cgit v1.2.1