From: Josh Durgin Date: Sat, 28 May 2011 00:37:43 +0000 (-0700) Subject: configure: add option for building with gcov coverage support X-Git-Tag: v0.30~108^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=24195b9c873cc6622b746d7e9d120ebd29914d6f;p=ceph.git configure: add option for building with gcov coverage support Signed-off-by: Josh Durgin --- diff --git a/.gitignore b/.gitignore index 43bd2d80efb08..73a9ea05dfa93 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ *.dsc *.changes ./config.* +*.gcda +*.gcov *.gcno .deps web/*.html diff --git a/configure.ac b/configure.ac index 552fb913a95ed..3d32d1ceab674 100644 --- a/configure.ac +++ b/configure.ac @@ -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])], diff --git a/src/Makefile.am b/src/Makefile.am index 12b804d09dd83..17756b779b43e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 \