From c419731e3a04333aea7d1af7e1069221a34344a5 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Sat, 9 May 2009 13:40:31 +0100 Subject: [PATCH] Add 'make valgrind' target to run tests under valgrind. --- Makefile.am | 6 ++++++ ocaml/Makefile.am | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 2286dd5..8f81a07 100644 --- a/Makefile.am +++ b/Makefile.am @@ -94,9 +94,15 @@ tests_CFLAGS = \ tests_LDADD = $(top_builddir)/src/libguestfs.la TESTS = $(check_PROGRAMS) +TESTS_ENVIRONMENT = $(VG) $(TESTS): $(INITRAMFS) $(VMLINUZ) +# Run the tests under valgrind. + +valgrind: + $(MAKE) check VG="valgrind --quiet --leak-check=full" + # Manual pages. # guestfs-actions.pod and guestfs-structs are autogenerated. There is # no include mechanism for POD, so we have to do it by hand. diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am index 079ce74..b3ca8ed 100644 --- a/ocaml/Makefile.am +++ b/ocaml/Makefile.am @@ -44,7 +44,8 @@ guestfs_c_actions.o: guestfs_c_actions.c TESTS_ENVIRONMENT = \ LD_LIBRARY_PATH=$(abs_top_builddir)/src/.libs \ - LIBGUESTFS_PATH=$(abs_top_builddir) + LIBGUESTFS_PATH=$(abs_top_builddir) \ + $(VG) TESTS = t/guestfs_005_load t/guestfs_010_launch t/guestfs_050_lvcreate noinst_DATA += $(TESTS) -- 1.8.3.1