diff mbox series

[PULL,25/28] Makefile.target: support per-target coverage reports

Message ID 20190528094953.14898-26-alex.bennee@linaro.org
State New
Headers show
Series [PULL,01/28] semihosting: move semihosting configuration into its own directory | expand

Commit Message

Alex Bennée May 28, 2019, 9:49 a.m. UTC
Add support for generating a single targets coverage report. Execute:

  make coverage-report

In the target build directory. This coverage report only cares about
target specific blobs so only searches the target build subdirectory.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
diff mbox series

Patch

diff --git a/Makefile.target b/Makefile.target
index 4ef4ce59969..ecd856e3a3f 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -238,3 +238,19 @@  endif
 
 generated-files-y += config-target.h
 Makefile: $(generated-files-y)
+
+# Reports/Analysis
+#
+# The target specific coverage report only cares about target specific
+# blobs and not the shared code.
+#
+
+%/coverage-report.html:
+	@mkdir -p $*
+	$(call quiet-command,\
+		gcovr -r $(SRC_PATH) --object-directory $(CURDIR) \
+		-p --html --html-details -o $@, \
+		"GEN", "coverage-report.html")
+
+.PHONY: coverage-report
+coverage-report: $(CURDIR)/reports/coverage/coverage-report.html