diff options
author | Stef Walter <stefw@redhat.com> | 2013-04-24 10:52:42 +0200 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2013-10-15 16:18:54 -0400 |
commit | d6223be50b7acc4f225c9bc9a7ee764fd2bcf63b (patch) | |
tree | 579689fccc11313373b7b143fe81bf91442b41c3 | |
parent | fee34e4a5e5d752baf74e2f7065e2d953d652d35 (diff) | |
download | accountsservice-d6223be50b7acc4f225c9bc9a7ee764fd2bcf63b.tar.gz |
Add --enable-coverage option for building with code coverage
Also clean coverage files on 'make clean'
https://bugs.freedesktop.org/show_bug.cgi?id=63868
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | configure.ac | 20 | ||||
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/libaccountsservice/Makefile.am | 5 |
4 files changed, 31 insertions, 2 deletions
@@ -3,6 +3,8 @@ *-enum-types.h *-generated.c *-generated.h +*.gcda +*.gcno *.gir *.gmo *.la diff --git a/configure.ac b/configure.ac index 47e9c67..cb1fcda 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,26 @@ AC_ARG_ENABLE(user-heuristics, fi]) dnl --------------------------------------------------------------------------- +dnl - coverage +dnl --------------------------------------------------------------------------- + +AC_MSG_CHECKING([whether to build with gcov testing]) +AC_ARG_ENABLE([coverage], + AS_HELP_STRING([--enable-coverage], + [Whether to enable gcov code coverage]), + [], [enable_coverage=no]) +AC_MSG_RESULT([$enable_coverage]) + +if test "$enable_coverage" = "yes"; then + if test "$GCC" != "yes"; then + AC_MSG_ERROR(Coverage testing requires GCC) + fi + CFLAGS="$CFLAGS -O0 -g --coverage" +fi + +AM_CONDITIONAL([WITH_COVERAGE], [test "$enable_coverage" = "yes"]) + +dnl --------------------------------------------------------------------------- dnl - Warnings dnl --------------------------------------------------------------------------- diff --git a/src/Makefile.am b/src/Makefile.am index a5bfcf9..6940f2d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,7 +47,11 @@ accounts_daemon_LDADD = \ libaccounts-generated.la \ $(POLKIT_LIBS) -CLEANFILES = $(BUILT_SOURCES) +CLEANFILES = \ + $(BUILT_SOURCES) \ + *.gcda \ + *.gcno \ + $(NULL) install-data-hook: $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/AccountsService/users" diff --git a/src/libaccountsservice/Makefile.am b/src/libaccountsservice/Makefile.am index 5c1684e..408d91f 100644 --- a/src/libaccountsservice/Makefile.am +++ b/src/libaccountsservice/Makefile.am @@ -1,7 +1,10 @@ END_OF_LIST = BUILT_SOURCES = $(END_OF_LIST) -CLEANFILES = $(END_OF_LIST) +CLEANFILES = \ + *.gcda \ + *.gcno \ + $(END_OF_LIST) AM_CPPFLAGS = \ -I. \ |