grim/gplate

Parents 809a0bef00d1
Children 56ff99cc8799
Adding code coverage support with gcov and lcov. This will only be enabled if the compiler is gcc and --enable-debug is passed to configure. Aside from that, lcov is required to build the html pages which will be put into $(top_builddir)/html
--- a/.mtn-ignore Sun Jan 04 02:01:01 2009 -0600
+++ b/.mtn-ignore Mon Mar 09 02:01:15 2009 -0500
@@ -15,8 +15,9 @@
^doc/gplate/gplate\.(args|hierarchy|interfaces|prerequisites|signals)$
^doc/gplate/(ht|x)ml$
^doc/gplate/overview\.sgml$
-gplate.pc
+^gplate\.(info|pc)$
gtk-doc.make
+^html$
install-sh
intltool-.*
libtool
--- a/Makefile.am Sun Jan 04 02:01:01 2009 -0600
+++ b/Makefile.am Mon Mar 09 02:01:15 2009 -0500
@@ -39,3 +39,17 @@
release: check distcheck version-check $(DIST_ARCHIVES:%=%.asc)
+coverage: check
+if USE_LCOV
+ lcov -d $(top_srcdir)/gplate -d $(top_srcdir)/tests -c -o $(top_builddir)/gplate.info
+ genhtml -o $(top_builddir)/html $(top_builddir)/gplate.info
+else
+ @echo lcov wasn\'t found during configure, aborting
+ @false
+endif
+
+clean-local:
+if USE_LCOV
+ lcov -d $(top_srcdir) -z
+endif
+
--- a/configure.ac Sun Jan 04 02:01:01 2009 -0600
+++ b/configure.ac Mon Mar 09 02:01:15 2009 -0500
@@ -7,7 +7,8 @@
AC_PREREQ(2.50)
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR(config.h.in)
-AC_COPYRIGHT([Copyright 2007-2008 Gary Kramlich])
+AC_COPYRIGHT([Copyright 2007-2009 Gary Kramlich])
+AM_MAINTAINER_MODE
dnl ################################################################
dnl # Version information
@@ -106,6 +107,23 @@
AM_GLIB_GNU_GETTEXT
dnl #######################################################################
+dnl # helper apps
+dnl #######################################################################
+AC_PATH_PROG(XMLLINT, xmllint, [yes], [no])
+AM_CONDITIONAL(USE_XMLLINT, test x"$XMLLINT" = x"yes")
+
+AC_PATH_PROG(XSLTPROC, xsltproc, [yes], [no])
+AM_CONDITIONAL(USE_XSLTPROC, test x"$XSLTPROC" = x"yes")
+
+AC_PATH_PROG(FDP, fdp, [yes], [no])
+AM_CONDITIONAL(USE_FDP, test x"$FDP" = x"yes")
+
+AC_PATH_PROG(SED, [sedZ])
+
+AC_PATH_PROG(LCOV, [lcov], [yes], [np])
+AM_CONDITIONAL(USE_LCOV, test x"$LCOV" = x"yes")
+
+dnl #######################################################################
dnl # Look for the C compiler
dnl #######################################################################
AC_MSG_CHECKING([useful C based templating library so I don't have to write one])
@@ -119,6 +137,8 @@
,,enable_debug=no)
if test x"$enable_debug" = x"yes" ; then
+ CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
+ CFLAGS=`echo $CFLAGS | sed 's/-O2//'`
AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.])
fi
@@ -162,18 +182,6 @@
GTK_DOC_CHECK([1.0])
dnl #######################################################################
-dnl # helper apps
-dnl #######################################################################
-AC_PATH_PROG(XMLLINT, xmllint, [yes], [np])
-AM_CONDITIONAL(USE_XMLLINT, test x"$XMLLINT" = x"yes")
-
-AC_PATH_PROG(XSLTPROC, xsltproc, [yes], [no])
-AM_CONDITIONAL(USE_XSLTPROC, test x"$XSLTPROC" = x"yes")
-
-AC_PATH_PROG(FDP, fdp, [yes], [np])
-AM_CONDITIONAL(USE_FDP, test x"$FDP" = x"yes")
-
-dnl #######################################################################
dnl # Finish up
dnl #######################################################################
AC_OUTPUT([Makefile
@@ -196,13 +204,29 @@
dnl #######################################################################
dnl # Ouput!!
dnl #######################################################################
-echo;
-echo AC_PACKAGE_NAME AC_PACKAGE_VERSION Configuration complete
-echo;
-echo Debugging enabled................: $enable_debug
-echo Build tests......................: $enable_tests
-echo;
-echo Build documentation..............: $enable_gtk_doc
-echo;
-echo Type make to compile
-echo;
+echo "
+AC_PACKAGE_NAME AC_PACKAGE_VERSION Configuration complete
+
+Debugging enabled: $enable_debug
+Build tests: $enable_tests
+
+Build documentation: $enable_gtk_doc
+
+prefix: ${prefix}
+libdir: ${libdir}
+libexecdir: ${libexecdir}
+bindir: ${bindir}
+datadir: ${datadir}
+sysconfdir: ${sysconfdir}
+localstatedir: ${localstatedir}
+docdir: ${docdir}
+
+compiler: ${CC}
+cflags: ${CFLAGS}
+cppflags: ${CPPFLAGS}
+
+maintainer mode: ${USE_MAINTAINER_MODE}
+
+Type make to compile
+
+"
--- a/gplate/Makefile.am Sun Jan 04 02:01:01 2009 -0600
+++ b/gplate/Makefile.am Mon Mar 09 02:01:15 2009 -0500
@@ -1,9 +1,5 @@
EXTRA_DIST=
-CLEANFILES=\
- *.gcda \
- *.gcno
-
SUBDIRS=configs functions tags variables
gplateincdir=$(includedir)/gplate-1.0/gplate
@@ -52,3 +48,12 @@
-DLOCALEDIR=\"$(datadir)/locale\" \
$(GLIB_CFLAGS)
+CLEANFILES=\
+ *.gcda \
+ *.gcno \
+ $(libgplate_la_SOURCES:%=%.gcov.html) \
+ index.html
+
+foo:
+ echo $(CLEANFILES)
+
--- a/gplate/functions/Makefile.am Sun Jan 04 02:01:01 2009 -0600
+++ b/gplate/functions/Makefile.am Mon Mar 09 02:01:15 2009 -0500
@@ -1,9 +1,5 @@
EXTRA_DIST=
-CLEANFILES=\
- *.gcda \
- *.gcno
-
gplatefunctionsincdir=$(includedir)/gplate-1.0/gplate/functions
gplatefunctionsinc_HEADERS=\
@@ -30,3 +26,9 @@
-DLOCALEDIR=\"$(datadir)/locale\" \
$(GLIB_CFLAGS)
+CLEANFILES=\
+ *.gcda \
+ *.gcno \
+ $(libgplate_functions_la_SOURCES:%=%.gcov.html) \
+ index.html
+
--- a/gplate/tags/Makefile.am Sun Jan 04 02:01:01 2009 -0600
+++ b/gplate/tags/Makefile.am Mon Mar 09 02:01:15 2009 -0500
@@ -1,9 +1,5 @@
EXTRA_DIST=
-CLEANFILES=\
- *.gcda \
- *.gcno
-
gplatetagsincdir=$(includedir)/gplate-1.0/gplate/tags
gplatetagsinc_HEADERS=\
@@ -28,3 +24,9 @@
-DLOCALEDIR=\"$(datadir)/locale\" \
$(GLIB_CFLAGS)
+CLEANFILES=\
+ *.gcda \
+ *.gcno \
+ $(libgplate_tags_la_SOURCES:%=%.gcov.html) \
+ index.html
+
--- a/gplate/variables/Makefile.am Sun Jan 04 02:01:01 2009 -0600
+++ b/gplate/variables/Makefile.am Mon Mar 09 02:01:15 2009 -0500
@@ -1,9 +1,5 @@
EXTRA_DIST=
-CLEANFILES=\
- *.gcda \
- *.gcno
-
gplatevariablesincdir=$(includedir)/gplate-1.0/gplate/variables
gplatevariablesinc_HEADERS=\
@@ -28,3 +24,9 @@
-DLOCALEDIR=\"$(datadir)/locale\" \
$(GLIB_CFLAGS)
+CLEANFILES=\
+ *.gcda \
+ *.gcno \
+ $(libgplate_variables_la_SOURCES:%=%.gcov.html) \
+ index.html
+
--- a/tests/Makefile.am Sun Jan 04 02:01:01 2009 -0600
+++ b/tests/Makefile.am Mon Mar 09 02:01:15 2009 -0500
@@ -6,9 +6,7 @@
SUBDIRS=templates
-CLEANFILES=\
- *.gcda \
- *.gcno
+CLEANFILES=
if BUILD_TESTS
@@ -41,4 +39,10 @@
$(CHECK_CFLAGS) \
$(GLIB_CFLAGS)
+CLEANFILES +=\
+ *.gcda \
+ *.gcno \
+ $(test_SOURCES:%=%.gcov.html) \
+ index.html
+
endif