mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
gh-94759: Create LCOV report with branch coverage (GH-94793)
This commit is contained in:
parent
fc21a43b1f
commit
f5c02afaff
1 changed files with 8 additions and 7 deletions
|
@ -318,7 +318,8 @@ PROFILE_TASK= @PROFILE_TASK@
|
||||||
# report files for gcov / lcov coverage report
|
# report files for gcov / lcov coverage report
|
||||||
COVERAGE_INFO= $(abs_builddir)/coverage.info
|
COVERAGE_INFO= $(abs_builddir)/coverage.info
|
||||||
COVERAGE_REPORT=$(abs_builddir)/lcov-report
|
COVERAGE_REPORT=$(abs_builddir)/lcov-report
|
||||||
COVERAGE_REPORT_OPTIONS=--no-branch-coverage --title "CPython lcov report"
|
COVERAGE_LCOV_OPTIONS=--rc lcov_branch_coverage=1
|
||||||
|
COVERAGE_REPORT_OPTIONS=--rc lcov_branch_coverage=1 --branch-coverage --title "CPython $(VERSION) LCOV report [commit $(shell $(GITVERSION))]"
|
||||||
|
|
||||||
|
|
||||||
# === Definitions added by makesetup ===
|
# === Definitions added by makesetup ===
|
||||||
|
@ -651,25 +652,24 @@ profile-opt: profile-run-stamp
|
||||||
coverage:
|
coverage:
|
||||||
@echo "Building with support for coverage checking:"
|
@echo "Building with support for coverage checking:"
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
$(MAKE) @DEF_MAKE_RULE@ CFLAGS="$(CFLAGS) -O0 -pg --coverage" LIBS="$(LIBS) --coverage"
|
$(MAKE) @DEF_MAKE_RULE@ CFLAGS="$(CFLAGS) -O0 -pg --coverage" LDFLAGS="$(LDFLAGS) --coverage"
|
||||||
|
|
||||||
coverage-lcov:
|
coverage-lcov:
|
||||||
@echo "Creating Coverage HTML report with LCOV:"
|
@echo "Creating Coverage HTML report with LCOV:"
|
||||||
@rm -f $(COVERAGE_INFO)
|
@rm -f $(COVERAGE_INFO)
|
||||||
@rm -rf $(COVERAGE_REPORT)
|
@rm -rf $(COVERAGE_REPORT)
|
||||||
@lcov --capture --directory $(abs_builddir) \
|
@lcov $(COVERAGE_LCOV_OPTIONS) --capture \
|
||||||
|
--directory $(abs_builddir) \
|
||||||
--base-directory $(realpath $(abs_builddir)) \
|
--base-directory $(realpath $(abs_builddir)) \
|
||||||
--path $(realpath $(abs_srcdir)) \
|
--path $(realpath $(abs_srcdir)) \
|
||||||
--output-file $(COVERAGE_INFO)
|
--output-file $(COVERAGE_INFO)
|
||||||
@ # remove 3rd party modules, system headers and internal files with
|
@ # remove 3rd party modules, system headers and internal files with
|
||||||
@ # debug, test or dummy functions.
|
@ # debug, test or dummy functions.
|
||||||
@lcov --remove $(COVERAGE_INFO) \
|
@lcov $(COVERAGE_LCOV_OPTIONS) --remove $(COVERAGE_INFO) \
|
||||||
'*/Modules/_blake2/impl/*' \
|
'*/Modules/_blake2/impl/*' \
|
||||||
'*/Modules/_ctypes/libffi*/*' \
|
'*/Modules/_ctypes/libffi*/*' \
|
||||||
'*/Modules/_decimal/libmpdec/*' \
|
'*/Modules/_decimal/libmpdec/*' \
|
||||||
'*/Modules/expat/*' \
|
'*/Modules/expat/*' \
|
||||||
'*/Modules/zlib/*' \
|
|
||||||
'*/Include/*' \
|
|
||||||
'*/Modules/xx*.c' \
|
'*/Modules/xx*.c' \
|
||||||
'*/Python/pyfpe.c' \
|
'*/Python/pyfpe.c' \
|
||||||
'*/Python/pystrcmp.c' \
|
'*/Python/pystrcmp.c' \
|
||||||
|
@ -677,7 +677,8 @@ coverage-lcov:
|
||||||
'/usr/local/include/*' \
|
'/usr/local/include/*' \
|
||||||
'/usr/lib/gcc/*' \
|
'/usr/lib/gcc/*' \
|
||||||
--output-file $(COVERAGE_INFO)
|
--output-file $(COVERAGE_INFO)
|
||||||
@genhtml $(COVERAGE_INFO) --output-directory $(COVERAGE_REPORT) \
|
@genhtml $(COVERAGE_INFO) \
|
||||||
|
--output-directory $(COVERAGE_REPORT) \
|
||||||
$(COVERAGE_REPORT_OPTIONS)
|
$(COVERAGE_REPORT_OPTIONS)
|
||||||
@echo
|
@echo
|
||||||
@echo "lcov report at $(COVERAGE_REPORT)/index.html"
|
@echo "lcov report at $(COVERAGE_REPORT)/index.html"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue