[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH] Enable code profiling and code coverage



moli:

This won't apply directly to 1.16, but it should give you some ideas
about making code profiling and code coverage more automatic.

The trick to making OCaml programs link turns out to be `-cclib -lgcov'.
See the configure.ac patch for the details.

I will apply something like this upstream once I've done some more
testing.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
>From 570332972df156cae8187da51b2f4bc7291e7912 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones redhat com>
Date: Tue, 4 Dec 2012 11:37:15 +0000
Subject: [PATCH] configure: Add --enable-code-profiling and
 --enable-code-coverage flags.

These configure flags enable code profiling (with gprof) and code
coverage (with gcov) respectively.
---
 .gitignore                    |  2 ++
 align/Makefile.am             |  1 +
 cat/Makefile.am               |  3 +++
 configure.ac                  | 24 ++++++++++++++++++++++++
 df/Makefile.am                |  1 +
 edit/Makefile.am              |  5 +++--
 erlang/Makefile.am            |  3 ++-
 examples/Makefile.am          | 21 ++++++++++++++-------
 fish/Makefile.am              |  1 +
 format/Makefile.am            |  1 +
 fuse/Makefile.am              |  5 +++--
 inspector/Makefile.am         |  5 +++--
 rescue/Makefile.am            |  5 +++--
 resize/Makefile.am            |  5 ++++-
 sparsify/Makefile.am          |  5 ++++-
 src/Makefile.am               |  8 +++++---
 sysprep/Makefile.am           |  5 ++++-
 test-tool/Makefile.am         |  3 ++-
 tests/c-api/Makefile.am       | 39 ++++++++++++++++++++++++++-------------
 tests/charsets/Makefile.am    |  3 ++-
 tests/mount-local/Makefile.am |  5 +++--
 tests/parallel/Makefile.am    |  3 ++-
 tests/regressions/Makefile.am |  6 ++++--
 23 files changed, 117 insertions(+), 42 deletions(-)

diff --git a/.gitignore b/.gitignore
index f80359b..42245d7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
 *.cmxa
 *.diff
 *.eml
+*.gcno
 *.hi
 *.jar
 *.la
@@ -23,6 +24,7 @@ bindtests.tmp
 cscope.out
 .deps
 .gdb_history
+gmon.out
 .libs
 Makefile
 Makefile.in
diff --git a/align/Makefile.am b/align/Makefile.am
index c44b8e3..74cb2b5 100644
--- a/align/Makefile.am
+++ b/align/Makefile.am
@@ -46,6 +46,7 @@ virt_alignment_scan_CFLAGS = \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 	$(LIBCONFIG_CFLAGS) \
 	$(LIBVIRT_CFLAGS)
 
diff --git a/cat/Makefile.am b/cat/Makefile.am
index daea446..23b8096 100644
--- a/cat/Makefile.am
+++ b/cat/Makefile.am
@@ -48,6 +48,7 @@ virt_cat_CFLAGS = \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 	$(LIBCONFIG_CFLAGS)
 
 virt_cat_LDADD = \
@@ -66,6 +67,7 @@ virt_filesystems_CFLAGS = \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 	$(LIBCONFIG_CFLAGS)
 
 virt_filesystems_LDADD = \
@@ -84,6 +86,7 @@ virt_ls_CFLAGS = \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 	$(LIBCONFIG_CFLAGS)
 
 virt_ls_LDADD = \
diff --git a/configure.ac b/configure.ac
index 249c261..25b1f5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -815,6 +815,30 @@ AS_IF([test "x$VALGRIND" != "xno"],[
 AC_SUBST([VG])
 AM_SUBST_NOTMAKE([VG])
 
+dnl Enable profiling?
+AC_ARG_ENABLE([code-profiling],
+    AS_HELP_STRING([--enable-code-profiling], [enable code profiling]),
+    [],
+    [enable_code_profiling=no])
+AS_IF([test "x$enable_code_profiling" != "xno"],[
+    GPROF_CFLAGS="-pg"
+    AC_SUBST([GPROF_CFLAGS])
+])
+
+dnl Enable code coverage?
+AC_ARG_ENABLE([code-coverage],
+    AS_HELP_STRING([--enable-code-coverage], [enable code coverage]),
+    [],
+    [enable_code_coverage=no])
+AS_IF([test "x$enable_code_coverage" != "xno"],[
+    GCOV_CFLAGS="-fprofile-arcs -ftest-coverage"
+    AC_SUBST([GCOV_CFLAGS])
+    dnl This is a hack to make OCaml programs work when they
+    dnl link to C code that is compiled with gcov flags.
+    OCAML_GCOV_LDFLAGS="-cclib -lgcov"
+    AC_SUBST([OCAML_GCOV_LDFLAGS])
+])
+
 dnl Check for OCaml (optional, for OCaml bindings and OCaml tools).
 OCAMLC=no
 OCAMLFIND=no
diff --git a/df/Makefile.am b/df/Makefile.am
index 52ec9b7..f52d275 100644
--- a/df/Makefile.am
+++ b/df/Makefile.am
@@ -49,6 +49,7 @@ virt_df_CFLAGS = \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 	$(LIBCONFIG_CFLAGS) \
 	$(LIBVIRT_CFLAGS)
 
diff --git a/edit/Makefile.am b/edit/Makefile.am
index 223322c..b6e8987 100644
--- a/edit/Makefile.am
+++ b/edit/Makefile.am
@@ -43,8 +43,9 @@ virt_edit_CFLAGS = \
 	-I$(top_srcdir)/fish \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
-	$(LIBCONFIG_CFLAGS) \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
+	$(LIBCONFIG_CFLAGS)
 
 virt_edit_LDADD = \
 	$(LIBCONFIG_LIBS) \
diff --git a/erlang/Makefile.am b/erlang/Makefile.am
index 7ebc444..a2495ec 100644
--- a/erlang/Makefile.am
+++ b/erlang/Makefile.am
@@ -45,7 +45,8 @@ erl_guestfs_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-I$(ERLANG_LIB_DIR_erl_interface)/include \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 
 erl_guestfs_LDADD = \
 	$(ERLANG_LIB_DIR_erl_interface)/lib/liberl_interface.a \
diff --git a/examples/Makefile.am b/examples/Makefile.am
index bf2db45..37f8cc4 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -48,7 +48,8 @@ copy_over_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
 	$(LIBVIRT_CFLAGS) \
 	-pthread \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 copy_over_LDADD = \
 	$(top_builddir)/src/libguestfs.la \
 	$(LIBVIRT_LIBS)
@@ -59,7 +60,8 @@ libvirt_auth_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
 	$(LIBVIRT_CFLAGS) \
 	-pthread \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 libvirt_auth_LDADD = \
 	$(top_builddir)/src/libguestfs.la \
 	$(LIBVIRT_LIBS)
@@ -69,7 +71,8 @@ create_disk_SOURCES = create_disk.c
 create_disk_CFLAGS = \
 	-DGUESTFS_WARN_DEPRECATED=1 \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 create_disk_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
@@ -77,7 +80,8 @@ display_icon_SOURCES = display_icon.c
 display_icon_CFLAGS = \
 	-DGUESTFS_WARN_DEPRECATED=1 \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 display_icon_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
@@ -85,7 +89,8 @@ inspect_vm_SOURCES = inspect_vm.c
 inspect_vm_CFLAGS = \
 	-DGUESTFS_WARN_DEPRECATED=1 \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 inspect_vm_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
@@ -95,7 +100,8 @@ mount_local_CFLAGS = \
 	-DGUESTFS_WARN_DEPRECATED=1 \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
 	$(FUSE_CFLAGS) \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 mount_local_LDADD = \
 	$(FUSE_LIBS) \
 	$(top_builddir)/src/libguestfs.la
@@ -106,7 +112,8 @@ virt_dhcp_address_SOURCES = virt-dhcp-address.c
 virt_dhcp_address_CFLAGS = \
 	-DGUESTFS_WARN_DEPRECATED=1 \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 virt_dhcp_address_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 endif
diff --git a/fish/Makefile.am b/fish/Makefile.am
index b0bf658..072000b 100644
--- a/fish/Makefile.am
+++ b/fish/Makefile.am
@@ -127,6 +127,7 @@ guestfish_CFLAGS = \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 	$(LIBCONFIG_CFLAGS)
 
 guestfish_LDADD = \
diff --git a/format/Makefile.am b/format/Makefile.am
index 560598d..cded8a8 100644
--- a/format/Makefile.am
+++ b/format/Makefile.am
@@ -43,6 +43,7 @@ virt_format_CFLAGS = \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 	$(LIBCONFIG_CFLAGS) \
 	$(LIBVIRT_CFLAGS)
 
diff --git a/fuse/Makefile.am b/fuse/Makefile.am
index 1295298..1b1358c 100644
--- a/fuse/Makefile.am
+++ b/fuse/Makefile.am
@@ -46,9 +46,10 @@ guestmount_CFLAGS = \
 	-I$(top_srcdir)/fish \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
-	$(FUSE_CFLAGS) \
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 	$(LIBCONFIG_CFLAGS) \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(FUSE_CFLAGS)
 
 guestmount_LDADD = \
 	$(FUSE_LIBS) \
diff --git a/inspector/Makefile.am b/inspector/Makefile.am
index 6004f12..b4d19df 100644
--- a/inspector/Makefile.am
+++ b/inspector/Makefile.am
@@ -69,9 +69,10 @@ virt_inspector_CFLAGS = \
 	-I$(top_srcdir)/fish \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 	$(LIBXML2_CFLAGS) \
-	$(LIBCONFIG_CFLAGS) \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(LIBCONFIG_CFLAGS)
 
 virt_inspector_LDADD = \
 	$(LIBCONFIG_LIBS) \
diff --git a/rescue/Makefile.am b/rescue/Makefile.am
index 6e775d0..9a3af67 100644
--- a/rescue/Makefile.am
+++ b/rescue/Makefile.am
@@ -43,8 +43,9 @@ virt_rescue_CFLAGS = \
 	-I$(top_srcdir)/fish \
 	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
-	$(LIBCONFIG_CFLAGS) \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
+	$(LIBCONFIG_CFLAGS)
 
 virt_rescue_LDADD = \
 	$(LIBCONFIG_LIBS) \
diff --git a/resize/Makefile.am b/resize/Makefile.am
index 8ba4c5b..c69ab44 100644
--- a/resize/Makefile.am
+++ b/resize/Makefile.am
@@ -66,7 +66,10 @@ OCAMLOPTFLAGS = $(OCAMLCFLAGS)
 
 virt-resize: $(OBJECTS)
 	$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
-	  mlguestfs.cmxa -linkpkg $^ -cclib -lncurses -o $@
+	  mlguestfs.cmxa -linkpkg $^ \
+	  -cclib -lncurses \
+	  $(OCAML_GCOV_LDFLAGS) \
+	  -o $@
 
 .mli.cmi:
 	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
index 3d42887..b5eba63 100644
--- a/sparsify/Makefile.am
+++ b/sparsify/Makefile.am
@@ -62,7 +62,10 @@ OCAMLOPTFLAGS = $(OCAMLCFLAGS)
 
 virt-sparsify: $(OBJECTS)
 	$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
-	  mlguestfs.cmxa -linkpkg $^ -cclib -lncurses -o $@
+	  mlguestfs.cmxa -linkpkg $^ \
+	  -cclib -lncurses \
+	  $(OCAML_GCOV_LDFLAGS) \
+	  -o $@
 
 .mli.cmi:
 	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
diff --git a/src/Makefile.am b/src/Makefile.am
index 198b4f2..dafc488 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -196,10 +196,12 @@ libguestfs_la_CFLAGS = \
 	-DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"' \
 	-DGUESTFS_WARN_DEPRECATED=1 \
 	-DLIBOSINFO_DB_PATH='"$(datadir)/libosinfo/db"' \
-	$(PCRE_CFLAGS) \
-	$(LIBVIRT_CFLAGS) $(LIBXML2_CFLAGS) \
 	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
-	$(GCC_VISIBILITY_HIDDEN)
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
+	$(GCC_VISIBILITY_HIDDEN) \
+	$(PCRE_CFLAGS) \
+	$(LIBVIRT_CFLAGS) \
+	$(LIBXML2_CFLAGS)
 
 libguestfs_la_CPPFLAGS = -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib
 
diff --git a/sysprep/Makefile.am b/sysprep/Makefile.am
index fafb929..e16a19d 100644
--- a/sysprep/Makefile.am
+++ b/sysprep/Makefile.am
@@ -112,7 +112,10 @@ OCAMLOPTFLAGS = $(OCAMLCFLAGS)
 
 virt-sysprep: $(OBJECTS)
 	$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
-	  mlguestfs.cmxa -linkpkg $^ -cclib -lncurses -o $@
+	  mlguestfs.cmxa -linkpkg $^ \
+	  -cclib -lncurses \
+	  $(OCAML_GCOV_LDFLAGS) \
+	  -o $@
 
 .mli.cmi:
 	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am
index 50dc8b1..a50c818 100644
--- a/test-tool/Makefile.am
+++ b/test-tool/Makefile.am
@@ -29,7 +29,8 @@ libguestfs_test_tool_CFLAGS = \
 	-DGUESTFS_WARN_DEPRECATED=1 \
 	-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 libguestfs_test_tool_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
diff --git a/tests/c-api/Makefile.am b/tests/c-api/Makefile.am
index 5f684f7..762c0de 100644
--- a/tests/c-api/Makefile.am
+++ b/tests/c-api/Makefile.am
@@ -68,8 +68,10 @@ TESTS_ENVIRONMENT = \
 #SKIP_TEST_CHECKSUM_8=$(shell if test `find ../initramfs -name squashfs.ko | wc -l` -eq 0; then echo 1; fi)
 
 tests_SOURCES = tests.c
-tests_CFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src \
-  $(WARN_CFLAGS) $(WERROR_CFLAGS)
+tests_CFLAGS = \
+	-I$(top_srcdir)/src -I$(top_builddir)/src \
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 tests_LDADD = $(top_builddir)/src/libguestfs.la
 
 # This binary must be statically linked.  It is used for testing
@@ -83,7 +85,8 @@ test_command_LDFLAGS = -all-static
 test_just_header_SOURCES = test-just-header.c
 test_just_header_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_just_header_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
@@ -91,7 +94,8 @@ if HAVE_CXX
 test_just_header_cxx_SOURCES = test-just-header-cxx.cpp
 test_just_header_cxx_CXXFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_just_header_cxx_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 endif
@@ -99,35 +103,40 @@ endif
 test_create_handle_SOURCES = test-create-handle.c
 test_create_handle_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_create_handle_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
 test_config_SOURCES = test-config.c
 test_config_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_config_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
 test_add_drive_opts_SOURCES = test-add-drive-opts.c
 test_add_drive_opts_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_add_drive_opts_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
 test_last_errno_SOURCES = test-last-errno.c
 test_last_errno_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_last_errno_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
 test_private_data_SOURCES = test-private-data.c
 test_private_data_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_private_data_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
@@ -135,7 +144,8 @@ test_user_cancel_SOURCES = test-user-cancel.c
 test_user_cancel_CFLAGS = \
 	-pthread \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_user_cancel_LDADD = \
 	$(top_builddir)/src/libguestfs.la -lm
 
@@ -144,7 +154,8 @@ test_debug_to_file_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
 	-I$(top_srcdir)/gnulib/lib \
 	-I$(top_builddir)/gnulib/lib \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_debug_to_file_LDADD = \
 	$(top_builddir)/src/libguestfs.la \
 	$(top_builddir)/gnulib/lib/libgnu.la
@@ -154,7 +165,8 @@ test_environment_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
 	-I$(top_srcdir)/gnulib/lib \
 	-I$(top_builddir)/gnulib/lib \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_environment_LDADD = \
 	$(top_builddir)/src/libguestfs.la \
 	$(top_builddir)/gnulib/lib/libgnu.la
@@ -164,7 +176,8 @@ test_environment_LDADD = \
 #test_add_libvirt_dom_CFLAGS = \
 #	-I$(top_srcdir)/src -I$(top_builddir)/src -I$(top_srcdir)/gnulib/lib \
 #	$(LIBVIRT_CFLAGS) \
-#	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+#	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+#	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 #test_add_libvirt_dom_LDADD = \
 #	$(top_builddir)/src/libguestfs.la $(LIBVIRT_LIBS) \
 #	$(LTLIBTHREAD) $(top_builddir)/gnulib/lib/libgnu.la
diff --git a/tests/charsets/Makefile.am b/tests/charsets/Makefile.am
index c160024..baf78b3 100644
--- a/tests/charsets/Makefile.am
+++ b/tests/charsets/Makefile.am
@@ -27,6 +27,7 @@ check_PROGRAMS = $(TESTS)
 test_charset_fidelity_SOURCES = test-charset-fidelity.c
 test_charset_fidelity_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
 test_charset_fidelity_LDADD = \
 	$(top_builddir)/src/libguestfs.la
diff --git a/tests/mount-local/Makefile.am b/tests/mount-local/Makefile.am
index aa91014..3537a2f 100644
--- a/tests/mount-local/Makefile.am
+++ b/tests/mount-local/Makefile.am
@@ -31,8 +31,9 @@ test_parallel_mount_local_CFLAGS = \
 	-pthread \
 	-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(FUSE_CFLAGS) \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
+	$(FUSE_CFLAGS)
 test_parallel_mount_local_LDADD = \
 	$(FUSE_LIBS) \
 	$(top_builddir)/src/libguestfs.la \
diff --git a/tests/parallel/Makefile.am b/tests/parallel/Makefile.am
index 0e59268..7854375 100644
--- a/tests/parallel/Makefile.am
+++ b/tests/parallel/Makefile.am
@@ -31,7 +31,8 @@ test_parallel_CFLAGS = \
 	-pthread \
 	-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 test_parallel_LDADD = \
 	$(top_builddir)/src/libguestfs.la \
 	$(top_builddir)/gnulib/lib/libgnu.la
diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
index 78706e7..fd4c310 100644
--- a/tests/regressions/Makefile.am
+++ b/tests/regressions/Makefile.am
@@ -45,7 +45,8 @@ check_PROGRAMS = \
 rhbz501893_SOURCES = rhbz501893.c
 rhbz501893_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 rhbz501893_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
@@ -53,7 +54,8 @@ rhbz790721_SOURCES = rhbz790721.c
 rhbz790721_CFLAGS = \
 	-pthread \
 	-I$(top_srcdir)/src -I$(top_builddir)/src \
-	$(WARN_CFLAGS) $(WERROR_CFLAGS)
+	$(WARN_CFLAGS) $(WERROR_CFLAGS) \
+	$(GPROF_CFLAGS) $(GCOV_CFLAGS)
 rhbz790721_LDADD = \
 	$(top_builddir)/src/libguestfs.la
 
-- 
1.8.0.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]