[epiphany] Add code coverage support



commit 18b87ec8068c5bf98aed9f507d43cba451dab665
Author: Xan Lopez <xan igalia com>
Date:   Mon Sep 3 23:11:11 2012 +0200

    Add code coverage support
    
    Needs a fairly recent gnome-common. To use do:
    
    - Run configure with --enable-code-coverage
    - Type 'make check-code-coverage'
    - Open the HTML results
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683297

 Makefile.am               |    2 ++
 configure.ac              |   19 +++++++++++--------
 doc/reference/Makefile.am |    2 ++
 embed/Makefile.am         |    1 +
 lib/Makefile.am           |    5 ++++-
 lib/egg/Makefile.am       |    1 +
 lib/history/Makefile.am   |    1 +
 lib/widgets/Makefile.am   |    1 +
 src/Makefile.am           |    2 ++
 src/bookmarks/Makefile.am |    1 +
 tests/Makefile.am         |    2 ++
 11 files changed, 28 insertions(+), 9 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 575f4ea..7204530 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,8 @@ DISTCHECK_CONFIGURE_FLAGS = \
 	--enable-debug			\
 	--enable-gtk-doc
 
+ GNOME_CODE_COVERAGE_RULES@
+
 # Ignore gtk theme cache files on distcheck
 distuninstallcheck_listfiles = find . -type f -print | grep -v 'icon-theme.cache'
 
diff --git a/configure.ac b/configure.ac
index 10946e8..b547181 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,8 @@ GNOME_DEBUG_CHECK
 GNOME_COMPILE_WARNINGS([maximum])
 GNOME_MAINTAINER_MODE_DEFINES
 
+GNOME_CODE_COVERAGE
+
 MORE_WARN_FLAGS="-Wdeclaration-after-statement"
 DEPRECATION_FLAGS=
 
@@ -302,13 +304,14 @@ AC_OUTPUT
 echo "
 Epiphany was configured with the following options:
         
-	Source code location       : $srcdir
-	Compiler                   : $CC
-	Prefix                     : $prefix
-	Extra debugging support    : $enable_debug
-
- 	GObject introspection      : $found_introspection
- 	NSS support                : $enable_nss
+	Source code location	   : $srcdir
+	Compiler		   : $CC
+	Prefix			   : $prefix
+	Extra debugging support	   : $enable_debug
 	Build tests		   : $enable_tests
-	WebKit2                    : $with_webkit2
+	Code coverage		   : $enable_code_coverage
+
+	GObject introspection	   : $found_introspection
+	NSS support		   : $enable_nss
+	WebKit2			   : $with_webkit2
 "
diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am
index 605d142..72cf06c 100644
--- a/doc/reference/Makefile.am
+++ b/doc/reference/Makefile.am
@@ -107,6 +107,7 @@ GTKDOC_CFLAGS = -DEPIPHANY_COMPILATION \
 		-I$(top_srcdir)/lib/history \
 		$(DEPENDENCIES_CFLAGS) \
 		$(DBUS_CFLAGS) \
+		$(CODE_COVERAGE_CFLAGS) \
 		$(INCINTL)
 
 GTKDOC_LIBS = \
@@ -119,6 +120,7 @@ GTKDOC_LIBS = \
 	$(top_builddir)/lib/egg/libegg.la \
         $(DEPENDENCIES_LIBS) \
 	$(DBUS_LIBS) \
+	$(CODE_COVERAGE_LDFLAGS) \
 	$(LIBINTL)
 
 # If you need to override some of the declarations, place them in the
diff --git a/embed/Makefile.am b/embed/Makefile.am
index 610a710..900bbd0 100644
--- a/embed/Makefile.am
+++ b/embed/Makefile.am
@@ -77,6 +77,7 @@ endif
 libephyembed_la_CFLAGS = \
 	-DSHARE_DIR=\"$(pkgdatadir)\"	\
 	$(DEPENDENCIES_CFLAGS) 	\
+	$(CODE_COVERAGE_CFLAGS) \
 	$(AM_CFLAGS)
 
 CLEANFILES = $(stamp_files) $(BUILT_SOURCES)
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7c9401d..8d0dca2 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -95,9 +95,12 @@ libephymisc_la_CPPFLAGS = \
 
 libephymisc_la_CFLAGS = \
 	$(DEPENDENCIES_CFLAGS)	\
+	$(CODE_COVERAGE_CFLAGS) \
 	$(AM_CFLAGS)
 
-libephymisc_la_LIBADD = -lm
+libephymisc_la_LIBADD = \
+	-lm \
+	$(CODE_COVERAGE_LDFLAGS)
 
 bin_PROGRAMS = ephy-profile-migrator
 
diff --git a/lib/egg/Makefile.am b/lib/egg/Makefile.am
index 5415230..33c6548 100644
--- a/lib/egg/Makefile.am
+++ b/lib/egg/Makefile.am
@@ -26,5 +26,6 @@ libegg_la_CPPFLAGS = \
 
 libegg_la_CFLAGS = \
 	$(DEPENDENCIES_CFLAGS)		\
+	$(CODE_COVERAGE_CFLAGS)		\
 	$(AM_CFLAGS)
 
diff --git a/lib/history/Makefile.am b/lib/history/Makefile.am
index 06654fa..ed134f2 100644
--- a/lib/history/Makefile.am
+++ b/lib/history/Makefile.am
@@ -22,6 +22,7 @@ libephyhistory_la_CPPFLAGS = \
 
 libephyhistory_la_CFLAGS = \
 	$(DEPENDENCIES_CFLAGS)	\
+	$(CODE_COVERAGE_CFLAGS) \
 	$(AM_CFLAGS)
 
 TYPES_H_FILES = ephy-history-types.h
diff --git a/lib/widgets/Makefile.am b/lib/widgets/Makefile.am
index bc53ec8..3259bb7 100644
--- a/lib/widgets/Makefile.am
+++ b/lib/widgets/Makefile.am
@@ -126,4 +126,5 @@ libephywidgets_la_CPPFLAGS = \
 
 libephywidgets_la_CFLAGS = \
 	$(DEPENDENCIES_CFLAGS)	\
+	$(CODE_COVERAGE_CFLAGS) \
 	$(AM_CFLAGS)
diff --git a/src/Makefile.am b/src/Makefile.am
index 0a01e93..ada8e47 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -108,6 +108,7 @@ endif
 libephymain_la_CFLAGS = \
 	$(DEPENDENCIES_CFLAGS) 	  \
 	$(WEBKIT_CFLAGS)	  \
+	$(CODE_COVERAGE_CFLAGS)   \
 	$(AM_CFLAGS)
 
 UI_FILES = \
@@ -168,6 +169,7 @@ epiphany_LDADD = \
 	$(top_builddir)/lib/libephymisc.la \
 	$(top_builddir)/lib/egg/libegg.la \
 	$(DEPENDENCIES_LIBS) \
+	$(CODE_COVERAGE_LDFLAGS) \
 	$(LIBINTL)
 
 if !WITH_WEBKIT2
diff --git a/src/bookmarks/Makefile.am b/src/bookmarks/Makefile.am
index eafa820..5b42f0d 100644
--- a/src/bookmarks/Makefile.am
+++ b/src/bookmarks/Makefile.am
@@ -111,6 +111,7 @@ libephybookmarks_la_CPPFLAGS = \
 
 libephybookmarks_la_CFLAGS = \
 	$(DEPENDENCIES_CFLAGS) 	\
+	$(CODE_COVERAGE_CFLAGS) \
 	$(AM_CFLAGS)
 
 libephybookmarks_la_LIBADD =
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5c49dac..b480cdc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -100,6 +100,7 @@ INCLUDES = \
 
 CFLAGS = \
 	$(DEPENDENCIES_CFLAGS) \
+	$(CODE_COVERAGE_CFLAGS) \
 	$(AM_CFLAGS)
 
 LDADD = \
@@ -111,6 +112,7 @@ LDADD = \
 	$(top_builddir)/lib/libephymisc.la \
 	$(top_builddir)/lib/egg/libegg.la \
 	$(DBUS_LIBS) \
+	$(CODE_COVERAGE_LDFLAGS) \
 	$(DEPENDENCIES_LIBS) 
 
 test_ephy_download_SOURCES = \



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