summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-05-27 19:47:25 -0400
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-05-27 19:47:25 -0400
commitbf3667b8b76eefd95e33e32b4f5abbf2de0e2065 (patch)
tree241b909f0d68f3c0f355ad924375c2fa5b9a19ae /GNUmakefile
parent42fb27570262b52e2ca889030c621b5f4af76fe1 (diff)
parent968f7710458f44d5e62d2624461f4e8459c04168 (diff)
Merge branch 'lukeshu/cover'
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 9836b33..146f725 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -101,8 +101,16 @@ check:
$(MAKE) -k INNER=t $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/check))
.PHONY: check
+# `gcc` writes .gcno
+# Running the program writes .gcda (updates existing files, concurrent-safe)
+# GCC `gcov` post-processes .gcno+.gcda to .gcov
+# `gcovr` is a Python script that calls `gcov` and merges and post-processes the .gcov files to other formats
+gcovr_flags = --txt=$(@D)/coverage.txt
+gcovr_flags += --html=$(@D)/coverage.html --html-details --html-single-page=js-enabled
$(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/check)): build/%/check: build/%/build
+ ./build-aux/gcov-prune $(@D)
+cd $(@D) && ctest --output-on-failure $(if $(filter --jobserver-auth=%,$(MAKEFLAGS)),--parallel)
+ gcovr $(gcovr_flags) -- $(@D)
.PHONY: $(foreach t,$(build_types),$(foreach p,$(platforms),build/$p-$t/check))
# `lint` and `format` ##########################################################