mirror of https://github.com/djcb/mu.git
Makefile.meson: add support for coverage reports
This commit is contained in:
parent
98a6dfd3fa
commit
a8cbac04fc
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
NINJA ?= ninja
|
NINJA ?= ninja
|
||||||
BUILDDIR ?= $(CURDIR)/build
|
BUILDDIR ?= $(CURDIR)/build
|
||||||
|
COVERAGE_BUILDDIR ?= $(CURDIR)/build-coverage
|
||||||
MESON ?= meson
|
MESON ?= meson
|
||||||
V ?= 0
|
V ?= 0
|
||||||
|
|
||||||
|
@ -55,6 +56,19 @@ test-helgrind: $(BUILDDIR)
|
||||||
--wrap='valgrind --tool=helgrind --error-exitcode=1' \
|
--wrap='valgrind --tool=helgrind --error-exitcode=1' \
|
||||||
--timeout-multiplier 100
|
--timeout-multiplier 100
|
||||||
|
|
||||||
|
$(COVERAGE_BUILDDIR):
|
||||||
|
$(MESON) -Db_coverage=true --buildtype=debug $(COVERAGE_BUILDDIR)
|
||||||
|
|
||||||
|
covfile:=$(COVERAGE_BUILDDIR)/meson-logs/coverage.info
|
||||||
|
|
||||||
|
# generate by hand, meson's built-ins are unflexible
|
||||||
|
coverage: $(COVERAGE_BUILDDIR)
|
||||||
|
ninja -C $(COVERAGE_BUILDDIR) test
|
||||||
|
lcov --capture --directory . --output-file $(covfile)
|
||||||
|
lcov --remove $(covfile) '/usr/*' '*guile*' '*thirdparty*' '*/tests/*' --output $(covfile)
|
||||||
|
mkdir -p $(COVERAGE_BUILDDIR)/meson-logs/coverage
|
||||||
|
genhtml $(covfile) --output-directory $(COVERAGE_BUILDDIR)/meson-logs/coverage/
|
||||||
|
|
||||||
dist: $(BUILDDIR)
|
dist: $(BUILDDIR)
|
||||||
@cd $(BUILDDIR); $(MESON) dist
|
@cd $(BUILDDIR); $(MESON) dist
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue