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

19.7.1 Using valgrind without developer intervention

The valgrind-tests module searches for Valgrind at configure time and declares the LOG_VALGRIND automake variable for use with automake’s LOG_COMPILER.

After importing the valgrind-tests module to your project, you use it by adding the following to the that runs the self-tests:


This will run all self-checks under valgrind.

Replace LOG_COMPILER with TESTS_ENVIRONMENT if you are using the old serial test harness. The parallel test harness has been the default in automake since version 1.11.3, but if you are using an older automake, or put ‘serial-tests’ in ‘AM_INIT_AUTOMAKE’/‘AUTOMAKE_OPTIONS’ you would still be using the serial test harness.

If you desire a project-wide decision that valgrind is not enabled by default, but still allow users to enable it with --enable-valgrind-tests you may put the following in before gl_INIT.