Next: , Previous: , Up: Running self-tests under valgrind   [Contents][Index]

19.7.2 Valgrind options

The VALGRIND variable holds the name of the valgrind binary and some options passed to valgrind. You may provide additional options that are passed to valgrind using the ‘VALGRINDFLAGS’ variable, for example:

./configure VALGRINDFLAGS="--suppressions=~/local.supp"

Alternatively during build phase:

make check VALGRINDFLAGS="--suppressions=~/local.supp"

This is useful if you have a valgrind suppression files that are needed to avoid triggering errors for known errors, typically in system libraries.

The VALGRIND variable include options that are useful when valgrind is run non-interactively through the test harness. The default parameters are -q to silence the output, --error-exitcode=1 to cause valgrind errors to be treated as fatal errors, and --leak-check=full to check for memory leaks.

These options can be controlled through the DEFAULT_VALGRINDFLAGS variable. For example, when configuring the package:

./configure DEFAULT_VALGRINDFLAGS="--quiet"

Alternatively, during the build phase:

make check DEFAULT_VALGRINDFLAGS="--quiet"

That would have the effect of removing --error-exitcode=1 and --leak-check=full from the default options, thus causing any valgrind errors to be silently ignored, instead of causing fatal test failures.

As a developer you may use the variables in before calling gl_INIT, like this if your program has deeply-nested call chains:


Note that any user-supplied VALGRINDFLAGS value is preserved, which is usually what you want.

Finally, as a developer you may want to provide additional per-directory options to valgrind and the AM_VALGRINDFLAGS variable can be used for this. For example:

AM_VALGRINDFLAGS = --suppressions=$(srcdir)/local-valgrind.supp

Next: Using valgrind at the developer’s discretion, Previous: Using valgrind without developer intervention, Up: Running self-tests under valgrind   [Contents][Index]