Repository navigation
build: remove --enable-lcov-branch-coverage - #30192
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
maflcko
left a comment
There was a problem hiding this comment.
utACK b08e07070085edf8cb5fda55d8849188fd83cfc6
hebasto
left a comment
There was a problem hiding this comment.
ACK 462e761672d387c98e729e920a4102feaedc53cb. A similar approach was used in hebasto#191.
theuni
left a comment
There was a problem hiding this comment.
I believe this only works because you've exported LCOV_OPTS and it makes it into the make env?
If you use ./configure LCOV_OPTS="--rc branch_coverage=1" as you seem to be recommending:
branch coverage can be enabled by setting
LCOV_OPTS=... when configuring
I don't think it'd work.
That could be fixed with a plain AC_SUBST(LCOV_OPTS), which would also document it.
|
Right. I started this way, and then think I swapped to exporting because it was less annoying. Might actually just update the docs I'm adding, unless you have a preference? |
|
I don't like the idea of recommending undocumented vars, so I'd prefer the AC_SUBST unless you're opposed. |
|
Ah yea, we won't get it in help. I'll update this tomorrow. |
This supports lcov 2.x in the sense that we are no-longer hardcoding version specific options, and instead will use the `LCOV_OPTS` variable (which is the more correct/flexible thing to do in any case). It's also quite likely that devs are already having to pass extra options to lcov 2.x, given it's more stringent in terms of coverage generation and error checking. See this thread for an example: linux-test-project/lcov#238. Added an example to the developer notes. Tested on one machine (LCOV 2.0, gcc 13.2) with: ```bash ./autogen.sh ./configure --enable-lcov CXXFLAGS="-fprofile-update=prefer-atomic" LCOV_OPTS="--rc branch_coverage=1 --ignore-errors mismatch" make make cov <snip> Processing file src/netaddress.cpp lines=521 hit=480 functions=72 hit=72 branches=675 hit=499 Overall coverage rate: lines......: 81.8% (79362 of 97002 lines) functions......: 77.8% (10356 of 13310 functions) branches......: 49.6% (130628 of 263196 branches) ``` and another machine (LCOV 2.1, Clang 18.1.3) with: ```bash ./autogen.sh ./configure --enable-lcov CC=clang CXX=clang++ LCOV_OPTS="--rc branch_coverage=1 --ignore-errors mismatch,inconsistent" make make cov <snip> Processing file src/util/strencodings.cpp lines=315 hit=311 functions=38 hit=38 branches=425 hit=357 Overall coverage rate: source files: 622 lines.......: 79.8% (70311 of 88132 lines) functions...: 78.1% (13968 of 17881 functions) branches....: 44.5% (157551 of 354317 branches) Message summary: 101 warning messages: count: 1 inconsistent: 100 3528 ignore messages: inconsistent: 3528 ```
|
Updated, rebased, and re-tested, also with LCOV 2.1 (built from source) (updated PR description). |
| Additional LCOV options can be specified using `LCOV_OPTS`, but may be dependant | ||
| on the version of LCOV. For example, when using LCOV `2.x`, branch coverage can be | ||
| enabled by setting `LCOV_OPTS="--rc branch_coverage=1"`, when configuring. | ||
|
|
There was a problem hiding this comment.
Not only "when configuring". Providing LCOV_OPTS variable when building the cov or cov_fuzz targets also works and improves flexibility:
./configure --enable-lcov CXXFLAGS="-fprofile-update=prefer-atomic"
make
make cov LCOV_OPTS="--rc branch_coverage=1 --ignore-errors mismatch"
There was a problem hiding this comment.
Not only "when configuring".
Sure. This is just one example.
|
CMake's hebasto#191 is built on top of this PR change. |
This supports lcov
2.xin the sense that we are no-longer hardcoding version specific options, and instead will use theLCOV_OPTSvariable (which is the more flexible thing to do in any case). It's also quite likely that devs are already having to pass extra options to lcov2.x, given it's more stringent in terms of coverage generation and error checking. See this thread for an example: linux-test-project/lcov#238.Tested on one machine (LCOV 2.0, gcc 13.2) with:
and another machine (LCOV 2.1, Clang 18.1.3) with:
Related to #28468.