]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
configure: add option for building with gcov coverage support
authorJosh Durgin <josh.durgin@dreamhost.com>
Sat, 28 May 2011 00:37:43 +0000 (17:37 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 7 Jun 2011 19:02:40 +0000 (12:02 -0700)
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
.gitignore
configure.ac
src/Makefile.am

index 43bd2d80efb08b4758e69725fc1419be14e2ddb6..73a9ea05dfa937ec51236d7202a0238d58591722 100644 (file)
@@ -8,6 +8,8 @@
 *.dsc
 *.changes
 ./config.*
+*.gcda
+*.gcov
 *.gcno
 .deps
 web/*.html
index 552fb913a95edb265495b1cf5064a6b9ab18457c..3d32d1ceab674666bb57a3ef2b6497499a190db2 100644 (file)
@@ -141,6 +141,13 @@ AM_CONDITIONAL(WITH_DEBUG, test "$with_debug" = "yes")
 
 AC_DEFINE([DEBUG_GATHER], [1], [Define if you want C_Gather debugging])
 
+# code coverage?
+AC_ARG_ENABLE([coverage],
+            [AS_HELP_STRING([--enable-coverage], [enable code coverage tracking])],
+            [],
+            [enable_coverage=no])
+AM_CONDITIONAL(ENABLE_COVERAGE, test "x$enable_coverage" != xno)
+
 # radosgw?
 AC_ARG_WITH([radosgw],
             [AS_HELP_STRING([--with-radosgw], [build RADOS gateway])],
index 12b804d09dd83aac9c0ec4744f2795dd01c88dfa..17756b779b43ebe6c8b6c045e0876d585e56a3d9 100644 (file)
@@ -503,6 +503,11 @@ if WITH_LIBATOMIC
 AM_LDFLAGS += -latomic_ops
 endif
 
+if ENABLE_COVERAGE
+AM_CFLAGS += -fprofile-arcs -ftest-coverage
+AM_CXXFLAGS += -fprofile-arcs -ftest-coverage -O0
+EXTRALIBS += -lgcov
+endif
 
 noinst_LIBRARIES = \
        libcommon.a \