]> Savannah Git Hosting - gnulib.git/commitdiff
valgrind-tests: Really enable the valgrind options test.
authorBruno Haible <bruno@clisp.org>
Sun, 3 Jan 2021 01:03:33 +0000 (02:03 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 3 Jan 2021 01:03:33 +0000 (02:03 +0100)
* m4/valgrind-tests.m4 (gl_VALGRIND_TESTS): Don't assume that the
valgrind options --error-exitcode=1 --leak-check=full always work.

ChangeLog
m4/valgrind-tests.m4

index 183e8770338e3125ca1fbcc672ad18cec8a9ce96..9d9c280324b55255b166207f9d4607d9039a2f6d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-02  Bruno Haible  <bruno@clisp.org>
+
+       valgrind-tests: Really enable the valgrind options test.
+       * m4/valgrind-tests.m4 (gl_VALGRIND_TESTS): Don't assume that the
+       valgrind options --error-exitcode=1 --leak-check=full always work.
+
 2021-01-02  Bruno Haible  <bruno@clisp.org>
 
        utimensat: Fix test failures on macOS 10.13.
index c642f4e72e650e179b31dc1c704272c99fdf8bcf..499759dd55ee52270dec5056314b4bdb365786d4 100644 (file)
@@ -1,4 +1,4 @@
-# valgrind-tests.m4 serial 4
+# valgrind-tests.m4 serial 5
 dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -23,10 +23,13 @@ AC_DEFUN([gl_VALGRIND_TESTS],
     if test "$VALGRIND"; then
       AC_CACHE_CHECK([for valgrind options for tests],
         [gl_cv_opt_valgrind_tests],
-        [gl_cv_opt_valgrind_tests="-q --error-exitcode=1 --leak-check=full"
-         $VALGRIND $gl_valgrind_opts ls > /dev/null 2>&1 ||
-           gl_cv_opt_valgrind_tests=no])
-
+        [gl_valgrind_opts='-q --error-exitcode=1 --leak-check=full'
+         if $VALGRIND $gl_valgrind_opts ls > /dev/null 2>&1; then
+           gl_cv_opt_valgrind_tests="$gl_valgrind_opts"
+         else
+           gl_cv_opt_valgrind_tests=no
+         fi
+        ])
       if test "$gl_cv_opt_valgrind_tests" != no; then
         VALGRIND="$VALGRIND $gl_cv_opt_valgrind_tests"
       else