diff options
author | Daniel Salzman <daniel.salzman@nic.cz> | 2014-04-29 14:27:44 +0200 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2014-04-29 14:27:44 +0200 |
commit | 31392b44e94379803483f77e5c0a736d2a17c3a8 (patch) | |
tree | 4fdf369127536571580c3adee9c51c248cbde03b /Makefile.am | |
parent | tests-extra: add simple failed log (diff) | |
download | knot-31392b44e94379803483f77e5c0a736d2a17c3a8.tar.xz knot-31392b44e94379803483f77e5c0a736d2a17c3a8.zip |
Makefile: improve code coverage usage
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am index 4885799b9..33f9e2bee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,16 +1,50 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = libtap src tests samples doc man patches -AM_DISTCHECK_CONFIGURE_FLAGS = \ +AM_DISTCHECK_CONFIGURE_FLAGS = \ --disable-code-coverage code_coverage_quiet = --quiet check-code-coverage: if CODE_COVERAGE_ENABLED + $(MAKE) $(AM_MAKEFLAGS) code-coverage-initial -$(MAKE) $(AM_MAKEFLAGS) -k check $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture $(MAKE) $(AM_MAKEFLAGS) code-coverage-html + $(MAKE) $(AM_MAKEFLAGS) code-coverage-summary +else + @echo "You need to run configure with --enable-code-coverage to enable code coverage" +endif + +code-coverage-initial: +if CODE_COVERAGE_ENABLED + $(LCOV) $(code_coverage_quiet) \ + --directory $(top_builddir)/src/common \ + --directory $(top_builddir)/src/knot \ + --directory $(top_builddir)/src/libknot \ + --capture --initial \ + --ignore-errors source \ + --base-directory $(top_builddir)/src \ + --output-file "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-src_base.info" \ + --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \ + --no-checksum --compat-libtool + $(LCOV) $(code_coverage_quiet) \ + --directory $(top_builddir)/src/knot/conf \ + --capture --initial \ + --ignore-errors source \ + --base-directory $(top_builddir)/src/knot/conf \ + --output-file "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-conf_base.info" \ + --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \ + --no-checksum --compat-libtool + $(LCOV) $(code_coverage_quiet) \ + --directory $(top_builddir)/src/zscanner \ + --capture --initial \ + --ignore-errors source \ + --base-directory $(top_builddir)/src/zscanner \ + --output-file "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-zscanner_base.info" \ + --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \ + --no-checksum --compat-libtool else @echo "You need to run configure with --enable-code-coverage to enable code coverage" endif @@ -44,11 +78,13 @@ if CODE_COVERAGE_ENABLED --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \ --no-checksum --compat-libtool $(LCOV) $(code_coverage_quiet) \ + --add-tracefile "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-src_base.info" \ + --add-tracefile "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-conf_base.info" \ + --add-tracefile "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-zscanner_base.info" \ --add-tracefile "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-src_capture.info" \ --add-tracefile "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-conf_capture.info" \ --add-tracefile "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-zscanner_capture.info" \ --output-file "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info" - -@rm -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)-*_base.info $(PACKAGE_NAME)-$(PACKAGE_VERSION)-*_capture.info else @echo "You need to run configure with --enable-code-coverage to enable code coverage" endif @@ -63,14 +99,24 @@ else @echo "You need to run configure with --enable-code-coverage to enable code coverage" endif +code-coverage-summary: +if CODE_COVERAGE_ENABLED + $(LCOV) \ + --summary "$(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info" +else + @echo "You need to run configure with --enable-code-coverage to enable code coverage" +endif + if CODE_COVERAGE_ENABLED clean-local: code-coverage-clean + -find . -name "*.gcno" -delete code-coverage-clean: -$(LCOV) --directory $(top_builddir) -z -rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)-*_base.info \ - $(PACKAGE_NAME)-$(PACKAGE_VERSION)-*_coverage.info \ + $(PACKAGE_NAME)-$(PACKAGE_VERSION)-*_capture.info \ + $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info \ $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage/ -find . -name "*.gcda" -o -name "*.gcov" -delete endif -.PHONY: check-code-coverage code-coverage-initial code-coverage-capture code-coverage-html code-coverage-clean +.PHONY: check-code-coverage code-coverage-initial code-coverage-capture code-coverage-html code-coverage-summary code-coverage-clean |