summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cfg.mk18
-rw-r--r--maint.mk24
2 files changed, 25 insertions, 17 deletions
diff --git a/cfg.mk b/cfg.mk
index 3037b1a223..fd04a90a61 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -46,25 +46,9 @@ bootstrap: autoreconf
# Code Coverage
-init-coverage:
- make clean
- lcov --directory . --zerocounters
+pre-coverage:
ln -sf /usr/local/share/gaa/gaa.skel src/gaa.skel
-COVERAGE_OPTS="-g -fprofile-arcs -ftest-coverage"
-
-build-coverage:
- make CFLAGS=$(COVERAGE_OPTS) CXXFLAGS=$(COVERAGE_OPTS) VALGRIND=
- make CFLAGS=$(COVERAGE_OPTS) CXXFLAGS=$(COVERAGE_OPTS) VALGRIND= check
- mkdir -p doc/coverage
- lcov --directory . --output-file doc/coverage/$(PACKAGE).info --capture
-
-gen-coverage:
- genhtml --output-directory doc/coverage doc/coverage/$(PACKAGE).info \
- --highlight --frames --legend --title "$(PACKAGE_NAME)"
-
-coverage: init-coverage build-coverage gen-coverage
-
web-coverage:
rm -fv `find $(htmldir)/coverage -type f | grep -v CVS`
cp -rv doc/coverage/* $(htmldir)/coverage/
diff --git a/maint.mk b/maint.mk
index 24b76503d4..2eea98d5d4 100644
--- a/maint.mk
+++ b/maint.mk
@@ -105,6 +105,30 @@ syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(ME))
syntax-check: $(syntax-check-rules)
+# Code Coverage
+
+init-coverage:
+ make clean
+ lcov --directory . --zerocounters
+
+COVERAGE_CCOPTS ?= "-g -fprofile-arcs -ftest-coverage"
+COVERAGE_OUT ?= doc/coverage
+
+build-coverage:
+ make CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS)
+ make CFLAGS=$(COVERAGE_CCOPTS) CXXFLAGS=$(COVERAGE_CCOPTS) check
+ mkdir -p $(COVERAGE_OUT)
+ lcov --directory . --output-file $(COVERAGE_OUT)/$(PACKAGE).info \
+ --capture
+
+gen-coverage:
+ genhtml --output-directory $(COVERAGE_OUT) \
+ $(COVERAGE_OUT)/$(PACKAGE).info \
+ --highlight --frames --legend \
+ --title "$(PACKAGE_NAME)"
+
+coverage: init-coverage build-coverage gen-coverage
+
# Update gettext files.
PACKAGE ?= $(shell basename $(PWD))
POURL = http://translationproject.org/latest/$(PACKAGE)/