diff --git a/docs/guestfs-hacking.pod b/docs/guestfs-hacking.pod index c35771732..419a4c29b 100644 --- a/docs/guestfs-hacking.pod +++ b/docs/guestfs-hacking.pod @@ -274,8 +274,7 @@ the automake documentation for details. Runs a subset of the test suite under valgrind. -Any F in the tree that has a C target -will be run by this rule. +See L below. =item C @@ -383,6 +382,35 @@ Do: =back +=head2 VALGRIND + +When you do C, it searches for any F +in the tree that has a C target and runs it. + +Writing the F and tests correctly to use valgrind and +working with automake parallel tests is subtle. + +If your tests are run via a shell script wrapper, then in the wrapper +use: + + $VG virt-foo + +and in the F use: + + check-valgrind: + make VG="$(top_builddir)/run @VG@" check + +However, if your binaries run directly from the C rule, you +have to modify the F like this: + + LOG_COMPILER = $(VG) + + check-valgrind: + make VG="@VG@" check + +In either case, check that the right program is being tested by +examining the F log files carefully. + =head1 SUBMITTING PATCHES Submit patches to the mailing list: diff --git a/run.in b/run.in index ed4109c80..c91183416 100755 --- a/run.in +++ b/run.in @@ -33,13 +33,10 @@ # # The script should also be used for tests like this: # -# TESTS_ENVIRONMENT = ... $(top_builddir)/run --test [$(VG)] +# TESTS_ENVIRONMENT = ... $(top_builddir)/run --test # # The --test parameter introduces a timeout, stopping tests from # running forever. -# -# Use the optional $(VG) when the tests must also be run under -# valgrind. #----------------------------------------------------------------------