From: Simon Josefsson Date: Tue, 28 Oct 2008 21:53:47 +0000 (+0100) Subject: top/maint.mk: Add coverage rules, inspired by scripts in gnupdf. X-Git-Tag: v0.1~6747 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=cdccece5811c28f3ac95e1ae226967de25a8c387;p=gnulib.git top/maint.mk: Add coverage rules, inspired by scripts in gnupdf. --- diff --git a/ChangeLog b/ChangeLog index a35a54bdd..55e7f7edd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-10-28 Simon Josefsson + * top/maint.mk: Add coverage rules, inspired by scripts in gnupdf. + +2008-10-28 Simon Josefsson + * MODULES.html.sh (Support for systems lacking POSIX:2001): Mention times and sys_times. * modules/sys_times, modules/sys_times-tests: New modules. diff --git a/top/maint.mk b/top/maint.mk index 24b76503d..2eea98d5d 100644 --- a/top/maint.mk +++ b/top/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)/