summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-05-08 13:26:19 -0400
committerDan Winship <danw@gnome.org>2013-05-08 13:29:46 -0400
commit47e94cb99140d8a1f01182c0b52f25915bad01e2 (patch)
treeac1e4ee2f57ef0d4be09654fb6d9f03f4e9145a1
parentee22cb117f3b2e192dc88550ff7bff73886b382c (diff)
downloadgnome-common-47e94cb99140d8a1f01182c0b52f25915bad01e2.tar.gz
code-coverage: fix conditionalization
The "make clean" rule added by gnome-code-coverage.m4 was not conditionalized (making it spew errors on "make clean" when built without coverage support, since $(LCOV) expanded to ""), and the other rules were conditionalized incorrectly (testing "ifdef CODE_COVERAGE_ENABLED", when that variable was always set, just sometimes to "no"). Fix both problems. https://bugzilla.gnome.org/show_bug.cgi?id=699943
-rw-r--r--macros2/gnome-code-coverage.m46
1 files changed, 4 insertions, 2 deletions
diff --git a/macros2/gnome-code-coverage.m4 b/macros2/gnome-code-coverage.m4
index 9a1fe09..62375e6 100644
--- a/macros2/gnome-code-coverage.m4
+++ b/macros2/gnome-code-coverage.m4
@@ -120,7 +120,7 @@ code_coverage_quiet_0 = --quiet
# Use recursive makes in order to ignore errors during check
check-code-coverage:
-ifdef CODE_COVERAGE_ENABLED
+ifeq ($(CODE_COVERAGE_ENABLED),yes)
-$(MAKE) $(AM_MAKEFLAGS) -k check
$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
else
@@ -129,7 +129,7 @@ endif
# Capture code coverage data
code-coverage-capture: code-coverage-capture-hook
-ifdef CODE_COVERAGE_ENABLED
+ifeq ($(CODE_COVERAGE_ENABLED),yes)
$(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
@@ -142,11 +142,13 @@ endif
# Hook rule executed before code-coverage-capture, overridable by the user
code-coverage-capture-hook:
+ifeq ($(CODE_COVERAGE_ENABLED),yes)
clean: code-coverage-clean
code-coverage-clean:
-$(LCOV) --directory $(top_builddir) -z
-rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
-find . -name "*.gcda" -o -name "*.gcov" -delete
+endif
GITIGNOREFILES ?=
GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)