Skip to content

Commit

Permalink
Make the coverage more useful
Browse files Browse the repository at this point in the history
* An accumulated coverage data is reset every 'make coverage' invocation
* A generation of manpages is no longer counted as "covered"
* The coverage for all source files is reported, not only for ones touched by
  the testsuite
  • Loading branch information
dottedmag committed Oct 21, 2011
1 parent f734692 commit 62f74d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ tests/unit/*_test
*.gcno
*.gcda
*.trace
cfengine-lcov-base.info
cfengine-lcov.info
coverage-html/

Expand Down
5 changes: 4 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MOSTLYCLEANFILES = *~
# Get everything removed down to where rebuilding requires:
# "make; make install"
#
CLEANFILES =
CLEANFILES = cfengine-lcov-base.info cfengine-lcov.info

#
# Get everything removed down to where rebuilding requires:
Expand Down Expand Up @@ -61,8 +61,11 @@ dist-hook:
#

coverage:
find -L $(srcdir) -name '*.gcda' -delete
-$(MAKE) check -k
$(LCOV) $(LCOV_FLAGS) --capture --initial --directory . --output-file cfengine-lcov-base.info
$(LCOV) $(LCOV_FLAGS) --capture --directory . --output-file cfengine-lcov.info --test-name CFENGINE --no-checksum --compat-libtool
$(LCOV) $(LCOV_FLAGS) -a cfengine-lcov-base.info -a cfengine-lcov.info --output-file cfengine-lcov.info
$(LCOV) $(LCOV_FLAGS) --remove cfengine-lcov.info '/usr/include/*' --output-file cfengine-lcov.info
LANG=C $(LCOV_GENHTML) $(LCOV_FLAGS) --prefix . --output-directory coverage-html --title "CFEngine Code Coverage" --legend --show-details cfengine-lcov.info
@echo
Expand Down

0 comments on commit 62f74d2

Please sign in to comment.