"make coverage-lcov" doesn't work with lcov v2.x
Open
Nobody has claimed this yet.
build
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Bug report
Bug description:
The Python Developer’s Guide says:
In order to create a HTML report you can install lcov.
Unfortunately, this doesn't work with a modern version of the lcov: e.g. first I got error about missing --path option. It "works for me" (with some warnings) on the patch:
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 2b34b009fd7..20b895d488a 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -917,7 +917,6 @@ coverage-lcov:
@lcov $(COVERAGE_LCOV_OPTIONS) --capture \
--directory $(abs_builddir) \
--base-directory $(realpath $(abs_builddir)) \
- --path $(realpath $(abs_srcdir)) \
--output-file $(COVERAGE_INFO)
@ # remove 3rd party modules, system headers and internal files with
@ # debug, test or dummy functions.
@@ -931,8 +930,11 @@ coverage-lcov:
'/usr/include/*' \
'/usr/local/include/*' \
'/usr/lib/gcc/*' \
+ --ignore-errors inconsistent \
+ --ignore-errors unused \
--output-file $(COVERAGE_INFO)
@genhtml $(COVERAGE_INFO) \
+ --ignore-errors inconsistent \
--output-directory $(COVERAGE_REPORT) \
$(COVERAGE_REPORT_OPTIONS)
@echo
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-151008
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Makefile.pre.in at the coverage-lcov target and review the lcov and genhtml commands shown in the report. Run make coverage-lcov with lcov 2.x, then verify that coverage data and the HTML report are generated without the reported option and consistency errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100