Makefile.meson: add support for coverage reports

pull/2267/head
Dirk-Jan C. Binnema 8 months ago
parent 98a6dfd3fa
commit a8cbac04fc
  1. 22
      Makefile.meson

@ -16,10 +16,11 @@
# Makefile with some useful targets for meson/ninja
NINJA ?= ninja
BUILDDIR ?= $(CURDIR)/build
MESON ?= meson
V ?= 0
NINJA ?= ninja
BUILDDIR ?= $(CURDIR)/build
COVERAGE_BUILDDIR ?= $(CURDIR)/build-coverage
MESON ?= meson
V ?= 0
ifneq ($(V),0)
VERBOSE=--verbose
@ -55,6 +56,19 @@ test-helgrind: $(BUILDDIR)
--wrap='valgrind --tool=helgrind --error-exitcode=1' \
--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)
@cd $(BUILDDIR); $(MESON) dist

Loading…
Cancel
Save