aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-04-03 21:33:03 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-04-03 21:33:03 -0500
commit72c1f1c6b9f169dff5f70be3c7fcaac570254508 (patch)
treeb2fe38f07b9d0acc16636d9e12a82ee93bd41b83 /configure.ac
parent5c3834907b18b2c9230d39767ab9092e80c5c849 (diff)
parentc54e02d80857bd08071e2311f456ef992a9d7a01 (diff)
downloadlibdbusmenu-72c1f1c6b9f169dff5f70be3c7fcaac570254508.tar.gz
libdbusmenu-72c1f1c6b9f169dff5f70be3c7fcaac570254508.tar.bz2
libdbusmenu-72c1f1c6b9f169dff5f70be3c7fcaac570254508.zip
Merge lp:~allanlesage/dbusmenu/TDD to add gcov targets to autotools build for code-coverage reporting. For more information, see this blog post: http://qualityhour.wordpress.com/2012/01/29/test-coverage-tutorial-for-cc-autotools-projects/ .
To compile with coverage tooling, ./autogen.sh --enable-gcov, then make coverage-html . Note that you'll need lcov to autoconf. Also note that you'll get an error on make if you have no tests, as there are no coverage artifacts to generate the html report. For review, please pay special attention to flags added in the project's makefiles.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index a46901f..be12b31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -194,6 +194,18 @@ if test "x$with_massivedebugging" = "xyes"; then
fi
###########################
+# gcov coverage reporting
+###########################
+
+m4_include([m4/gcov.m4])
+AC_TDD_GCOV
+AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
+AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
+AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
+AC_SUBST(COVERAGE_CFLAGS)
+AC_SUBST(COVERAGE_LDFLAGS)
+
+###########################
# Files
###########################
@@ -251,3 +263,7 @@ AS_IF([test "x$have_dumper" = "xyes"],
AC_MSG_NOTICE([ Dumper: no])
)
+AS_IF([test "x$use_gcov" = "xyes"],
+ AC_MSG_NOTICE([ Coverage reporting: yes]),
+ AC_MSG_NOTICE([ Coverage reporting: no])
+)