diff options
author | Christian Persch <chpe@gnome.org> | 2012-10-23 22:12:01 +0200 |
---|---|---|
committer | Christian Persch <chpe@gnome.org> | 2012-10-23 22:21:32 +0200 |
commit | 12036c1f9cde101a13a4c212deaecf4e741e522d (patch) | |
tree | e87c8e1fb230c7ab0de229f934545cf42077ae30 | |
parent | f6d04abb156c6e6ef513c4c9edcd842cb3a5ed9d (diff) | |
download | gnome-common-12036c1f9cde101a13a4c212deaecf4e741e522d.tar.gz |
code coverage: Quiet lcov and add extra ignore patterns
Make lcov be quiet if V=0, and add a new CODE_COVERAGE_IGNORE_PATTERN
variable to be able to add extra files to ignore in code coverage reporting.
-rw-r--r-- | macros2/gnome-code-coverage.m4 | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/macros2/gnome-code-coverage.m4 b/macros2/gnome-code-coverage.m4 index cfaf25b..081e733 100644 --- a/macros2/gnome-code-coverage.m4 +++ b/macros2/gnome-code-coverage.m4 @@ -101,6 +101,7 @@ GNOME_CODE_COVERAGE_RULES=' # (Default: empty) # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml # instance. (Default: empty) +# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore # # The generated report will be titled using the $(PACKAGE_NAME) and # $(PACKAGE_VERSION). In order to add the current git hash to the title, @@ -112,6 +113,11 @@ CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage CODE_COVERAGE_LCOV_OPTIONS ?= CODE_COVERAGE_GENHTML_OPTIONS ?= +CODE_COVERAGE_IGNORE_PATTERN ?= + +code_coverage_quiet = $(code_coverage_quiet_$(V)) +code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) +code_coverage_quiet_0 = --quiet # Use recursive makes in order to ignore errors during check check-code-coverage: @@ -125,10 +131,10 @@ endif # Capture code coverage data code-coverage-capture: code-coverage-capture-hook ifdef CODE_COVERAGE_ENABLED - $(LCOV) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS) - $(LCOV) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" - -rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - LANG=C $(GENHTML) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS) + $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" else @echo "Need to reconfigure with --enable-code-coverage" |