Browse Source

[2036] Introduce --enable-valgrind-suppressions configure switch

The rationale for this is:

* Developers configure with `--enable-valgrind` and run `make check` to
  see all the error reports (`make check` continues testing even if
  there are Valgrind issues). This encourages us to fix these issues,
  especially if we are modifying those parts of the code as part of
  another bug.

* Builders configure with `--enable-valgrind
  --enable-valgrind-suppressions` and run `make check` with
  suppressions. `make check` doesn't show existing suppressed issues and
  stops building if it finds a new Valgrind issue that is not
  suppressed.
Mukund Sivaraman 13 years ago
parent
commit
3039e3cd0a
1 changed files with 13 additions and 3 deletions
  1. 13 3
      configure.ac

+ 13 - 3
configure.ac

@@ -988,10 +988,19 @@ AM_CONDITIONAL(HAVE_VALGRIND, test "x$VALGRIND" != "xno")
 
 
 AC_ARG_ENABLE(valgrind, [AC_HELP_STRING([--enable-valgrind],
 AC_ARG_ENABLE(valgrind, [AC_HELP_STRING([--enable-valgrind],
   [run tests under Valgrind [default=no]])], enable_valgrind=$enableval, enable_valgrind=no)
   [run tests under Valgrind [default=no]])], enable_valgrind=$enableval, enable_valgrind=no)
-AM_CONDITIONAL(ENABLE_VALGRIND, test "x$enable_valgrind" != "xno")
+AC_ARG_ENABLE(valgrind-suppressions, [AC_HELP_STRING([--enable-valgrind-suppressions],
+  [enable Valgrind suppressions [default=no]])], enable_valgrind_suppressions=$enableval, enable_valgrind_suppressions=no)
+
+use_valgrind=no
+use_valgrind_suppressions=no
 
 
 if test "x$VALGRIND" != "xno" -a "x$enable_valgrind" != "xno"; then
 if test "x$VALGRIND" != "xno" -a "x$enable_valgrind" != "xno"; then
-   VALGRIND_COMMAND="$VALGRIND -q --error-exitcode=1 --gen-suppressions=all --suppressions=\$(top_srcdir)/src/valgrind-suppressions --suppressions=\$(top_srcdir)/src/valgrind-suppressions.revisit --num-callers=48 --leak-check=full --fullpath-after="
+   if test "x$enable_valgrind_suppressions" != "xno"; then
+      VALGRIND_SUPPRESSIONS="--error-exitcode=1 --suppressions=\$(top_srcdir)/src/valgrind-suppressions --suppressions=\$(top_srcdir)/src/valgrind-suppressions.revisit"
+      use_valgrind_suppressions=yes
+   fi
+   VALGRIND_COMMAND="$VALGRIND -q --gen-suppressions=all $VALGRIND_SUPPRESSIONS --num-callers=48 --leak-check=full --fullpath-after="
+   use_valgrind=yes
 fi
 fi
 AC_SUBST(VALGRIND_COMMAND)
 AC_SUBST(VALGRIND_COMMAND)
 
 
@@ -1305,7 +1314,8 @@ Features:
 
 
 Developer:
 Developer:
   Google Tests:  $gtest_path
   Google Tests:  $gtest_path
-  Valgrind: $enable_valgrind
+  Valgrind: $use_valgrind
+  Valgrind Suppressions: $use_valgrind_suppressions
   C++ Code Coverage: $USE_LCOV
   C++ Code Coverage: $USE_LCOV
   Python Code Coverage: $USE_PYCOVERAGE
   Python Code Coverage: $USE_PYCOVERAGE
   Generate Manuals:  $enable_man
   Generate Manuals:  $enable_man