[evolution-data-server] Use code coverage macros from gnome-common.



commit 455f368e58088f968d13e24441a6963d6c0f9fbe
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Oct 27 12:27:04 2012 -0400

    Use code coverage macros from gnome-common.
    
    The GNOME_CODE_COVERAGE macro in gnome-common automates the process
    nicely.  Just run "make check-code-coverage" from the top-level source
    directory (or from any of the "tests" subdirectories) and open the nice
    coverage analysis report:
    
        evolution-data-server-x.y.z-coverage/index.html

 Makefile.am                      |    2 +
 configure.ac                     |   22 +------
 tests/Makefile.am                |    2 +
 tests/libebook/Makefile.am       |    2 +
 tests/libecal/Makefile.am        |    2 +
 tests/libedata-cal/Makefile.am   |  114 ++++++++++++++-----------------------
 tests/libedataserver/Makefile.am |    2 +
 7 files changed, 57 insertions(+), 89 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 18ba847..799a237 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,6 +10,8 @@ SUBDIRS += vala
 endif
 endif
 
+ GNOME_CODE_COVERAGE_RULES@
+
 %-$(API_VERSION).pc: %.pc
 	 cp $< $@
 
diff --git a/configure.ac b/configure.ac
index 9c671a0..a8a8512 100644
--- a/configure.ac
+++ b/configure.ac
@@ -256,6 +256,10 @@ LT_INIT(disable-static win32-dll)
 
 PKG_PROG_PKG_CONFIG
 
+dnl This relies on $SED, which is defined in ltmain.sh, which
+dnl is invoked by LT_INIT (at least I think that's how it works).
+GNOME_CODE_COVERAGE
+
 dnl ******************************
 dnl Gtk Doc stuff
 dnl ******************************
@@ -1241,24 +1245,6 @@ EVO_MARSHAL_RULE=$srcdir/marshal.mk
 AC_SUBST_FILE(EVO_MARSHAL_RULE)
 
 dnl ******************************
-dnl Code coverage flags
-dnl ******************************
-
-AC_ARG_ENABLE([code-coverage],
-	AS_HELP_STRING([--enable-code-coverage], [compile with code coverage code]),
-	[enable_code_coverage=$enableval], [enable_code_coverage=no])
-
-if test "x$GCC" = "xyes"; then
-	if test "x$enable_code_coverage" = "xyes"; then
-		CODE_COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage -O0 -ggdb"
-		CODE_COVERAGE_LDFLAGS="-lgcov"
-	fi
-fi
-
-AC_SUBST([CODE_COVERAGE_CFLAGS])
-AC_SUBST([CODE_COVERAGE_LDFLAGS])
-
-dnl ******************************
 dnl Utility macro to set compiler flags for a specific lib.
 dnl EVO_SET_COMPILE_FLAGS(VAR-PREFIX, DEPS, EXTRA-CFLAGS, EXTRA-LIBS)
 dnl ******************************
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bb1ea20..9c4d922 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,3 +1,5 @@
 SUBDIRS = libedataserver libedataserverui libebook libecal libedata-cal
 
+ GNOME_CODE_COVERAGE_RULES@
+
 -include $(top_srcdir)/git.mk
diff --git a/tests/libebook/Makefile.am b/tests/libebook/Makefile.am
index ada931d..e1325f1 100644
--- a/tests/libebook/Makefile.am
+++ b/tests/libebook/Makefile.am
@@ -1,5 +1,7 @@
 SUBDIRS = vcard client
 
+ GNOME_CODE_COVERAGE_RULES@
+
 if HAVE_E_BOOK_DISABLE_DEPRECATED
 
 TEST_CPPFLAGS =					\
diff --git a/tests/libecal/Makefile.am b/tests/libecal/Makefile.am
index 584e0e9..88ecc02 100644
--- a/tests/libecal/Makefile.am
+++ b/tests/libecal/Makefile.am
@@ -1,5 +1,7 @@
 SUBDIRS = client
 
+ GNOME_CODE_COVERAGE_RULES@
+
 if !HAVE_E_CAL_DISABLE_DEPRECATED
 
 noinst_LTLIBRARIES = libecal-test-utils.la
diff --git a/tests/libedata-cal/Makefile.am b/tests/libedata-cal/Makefile.am
index 147b1c4..145c13b 100644
--- a/tests/libedata-cal/Makefile.am
+++ b/tests/libedata-cal/Makefile.am
@@ -1,73 +1,45 @@
-noinst_PROGRAMS =							\
-	test-e-sexp							\
-	test-intervaltree						\
-	test-intervaltree-coverage
-
-test_e_sexp_SOURCES = test-cal-backend-sexp.c
-
-test_e_sexp_CPPFLAGS =							\
-	$(AM_CPPFLAGS)							\
-	-I$(top_srcdir)							\
-	-I$(top_srcdir)/calendar					\
-	-I$(top_builddir)/calendar					\
-	$(EVOLUTION_CALENDAR_CFLAGS)					\
-	$(CAMEL_CFLAGS)
-
-test_e_sexp_LDADD =							\
-	$(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la	\
-	$(top_builddir)/calendar/libecal/libecal-1.2.la 		\
-	$(top_builddir)/libebackend/libebackend-1.2.la		\
-	$(top_builddir)/libedataserver/libedataserver-1.2.la		\
-	$(EVOLUTION_CALENDAR_LIBS)					\
-	$(E_DATA_SERVER_LIBS)						\
-	$(CAMEL_LIBS)
-
-test_intervaltree_SOURCES = test-intervaltree.c
-
-test_intervaltree_CPPFLAGS =						\
-	$(AM_CPPFLAGS)							\
-	-I$(top_srcdir)							\
-	-I$(top_srcdir)/calendar					\
-	-I$(top_builddir)/calendar					\
-	$(EVOLUTION_CALENDAR_CFLAGS)					\
-	$(CAMEL_CFLAGS)
-
-test_intervaltree_LDADD =						\
-	$(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la	\
-	$(top_builddir)/calendar/libecal/libecal-1.2.la			\
-	$(top_builddir)/libebackend/libebackend-1.2.la		\
-	$(top_builddir)/libedataserver/libedataserver-1.2.la		\
-	$(EVOLUTION_CALENDAR_LIBS)					\
-	$(CAMEL_LIBS)
-
-test_intervaltree_coverage_SOURCES = test-intervaltree.c
-
-test_intervaltree_coverage_CPPFLAGS =					\
-	$(AM_CPPFLAGS)							\
-	-I$(top_srcdir)							\
-	-I$(top_srcdir)/calendar					\
-	-I$(top_builddir)/calendar					\
-	$(EVOLUTION_CALENDAR_CFLAGS)					\
-	$(CAMEL_CFLAGS)
-
-test_intervaltree_coverage_LDADD = \
-	$(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la	\
-	$(top_builddir)/calendar/libecal/libecal-1.2.la			\
-	$(top_builddir)/libebackend/libebackend-1.2.la		\
-	$(top_builddir)/libedataserver/libedataserver-1.2.la		\
-	$(EVOLUTION_CALENDAR_LIBS)					\
-	$(CAMEL_LIBS)							\
-	$(CODE_COVERAGE_LDFLAGS)
-
-.PHONY: coverage
-coverage: 
-	mkdir -p ./coverage
-	lcov --directory . --zerocounters
-	./test-intervaltree-coverage
-	lcov --directory . --capture --output-file ./coverage/*.info
-	genhtml -o ./coverage --legend --num-spaces 2 ./coverage/*.info
-
-clean-local:
-	rm -f *.gcda *.gcno
+NULL =
+
+ GNOME_CODE_COVERAGE_RULES@
+
+TESTS = \
+	test-e-sexp \
+	test-intervaltree \
+	$(NULL)
+
+noinst_PROGRAMS = $(TESTS)
+
+test_CPPFLAGS = \
+	$(AM_CPPFLAGS) \
+	-I$(top_srcdir) \
+	-I$(top_srcdir)/calendar \
+	-I$(top_builddir)/calendar \
+	$(EVOLUTION_CALENDAR_CFLAGS) \
+	$(CAMEL_CFLAGS) \
+	$(NULL)
+
+test_LDADD = \
+	$(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la \
+	$(top_builddir)/calendar/libecal/libecal-1.2.la  \
+	$(top_builddir)/libebackend/libebackend-1.2.la \
+	$(top_builddir)/libedataserver/libedataserver-1.2.la \
+	$(EVOLUTION_CALENDAR_LIBS) \
+	$(E_DATA_SERVER_LIBS) \
+	$(CAMEL_LIBS) \
+	$(NULL)
+
+test_e_sexp_SOURCES = \
+	test-cal-backend-sexp.c \
+	$(NULL)
+
+test_intervaltree_SOURCES = \
+	test-intervaltree.c \
+	$(NULL)
+
+test_e_sexp_CPPFLAGS = $(test_CPPFLAGS)
+test_e_sexp_LDADD = $(test_LDADD)
+
+test_intervaltree_CPPFLAGS = $(test_CPPFLAGS)
+test_intervaltree_LDADD = $(test_LDADD)
 
 -include $(top_srcdir)/git.mk
diff --git a/tests/libedataserver/Makefile.am b/tests/libedataserver/Makefile.am
index 0646998..fe1ab3f 100644
--- a/tests/libedataserver/Makefile.am
+++ b/tests/libedataserver/Makefile.am
@@ -1,5 +1,7 @@
 NULL =
 
+ GNOME_CODE_COVERAGE_RULES@
+
 TESTS = \
 	e-source-test \
 	e-source-registry-test \



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