Closed Wayonb closed 5 months ago
My environment is Gcc 13.2 Ubuntu 24.04 Lcov 2.0-4
I fear that I don't know what lcov/2.0-4 is. There is a tarball release for lcov/2.0 (from last May), and there is the github repo...but no such ID. Probably doesn't matter.
Two steps:
client_coverage.info
file to this report so I can figure out what is wrong.I guess that the data you see in the genhtml --flat ...
output matches your expectation (i.e., the HTML data looks correct) - which would tend to indicate that the data is correctly parsed, just incorrectly reported by the --list
option.
Thanks Henry
Hi @henry2cox
Thanks for the quick reply.
I installed lcov from the repo and the --list
now matches the --summary
option. 👍🏾
It seems the issue with Ubuntu package so I will reach out to them.
/usr/local/bin/lcov --version
lcov: LCOV version 2.0-123.gd981242
utils/Logging.h | 100% 23| 100% 6| - 0
utils/MacroBasedEnum.h | 100% 10|84.6% 39| - 0
utils/MemoryUtils.h | 100% 12|95.8% 96| - 0
utils/ModificationSafeIterableContainer.h |94.7% 19| 100% 8| - 0
utils/NamedObject.h |93.8% 16| 100% 8| - 0
utils/NetworkTime.cpp | 100% 13| 100% 4| - 0
utils/PathUtils.h | 100% 19| 100% 3| - 0
utils/RandomGenerator.cpp | 100% 23| 100% 10| - 0
utils/RandomGenerator.h | 100% 1| - 0| - 0
utils/RawBuffer.cpp | 100% 4| 100% 2| - 0
utils/RawBuffer.h | 100% 6| 100% 1| - 0
utils/ReentrancyCheckReaderNotificationPolicy.h| 100% 14| 100% 3| - 0
utils/ShortHash.h | 100% 2| - 0| - 0
utils/SpinLock.h | 100% 5| 100% 1| - 0
utils/SpinReaderWriterLock.h | 100% 66| 100% 11| - 0
utils/StackLogger.h | 100% 24| 100% 4| - 0
utils/StackTimer.h | 100% 3| - 0| - 0
utils/StreamFormatGuard.h | 100% 9| 100% 2| - 0
utils/ThrottleLogger.h | 100% 8| 100% 1| - 0
utils/TimeSpan.cpp | 100% 7| 100% 1| - 0
utils/TimeSpan.h | 100% 15| 100% 4| - 0
utils/WeakContainer.h | 100% 18| 100% 16| - 0
utils/WrappedWithOwnerDecorator.h | 100% 13| 100% 13| - 0
validators/AggregateValidationResult.cpp | 100% 11| 100% 3| - 0
validators/AggregateValidatorBuilder.h | 100% 22| 100% 15| - 0
validators/DemuxValidatorBuilder.h | 100% 16|92.8% 320| - 0
validators/FunctionalNotificationValidator.h | 100% 8|98.3% 240| - 0
validators/NotificationValidator.h | 0.0% 1| - 0| - 0
validators/NotificationValidatorAdapter.cpp | 100% 13| 100% 4| - 0
validators/ParallelValidationPolicy.cpp |95.0% 40| 100% 12| - 0
validators/ParallelValidationPolicy.h | 100% 1| - 0| - 0
validators/ValidatingNotificationSubscriber.h | 100% 12| 100% 1| - 0
validators/ValidationResult.cpp | 100% 11| 100% 2| - 0
validators/ValidationResult.h | 100% 4| - 0| - 0
validators/ValidatorContext.h | 100% 5| 100% 1| - 0
validators/ValidatorUtils.h | 100% 1| - 0| - 0
version/version.cpp | 100% 4| 100% 1| - 0
================================================================================
Total:|97.7% 25638|88.1% 14k| - 0
Message summary:
no messages were reported
root@71435316da35:/catapult-src# /usr/local/bin/lcov --summary client_coverage.info
Reading tracefile client_coverage.info.
Summary coverage rate:
source files: 1280
lines.......: 97.7% (25054 of 25638 lines)
functions...: 88.1% (12581 of 14284 functions)
Message summary:
no messages were reported
Incidentally: your coverage numbers look quite good and your project size is probably on the edge of what people can remember from one release to the next. You might want to look into implementing a differential coverage methodology. That enables a couple of useful capabilities. primarily that your jenkins/regression system can analyze the coverage data for you - then notify you if something bad happens (e.g., somebody checks in code which is not exercised, or some new commit results in lost coverage elsewhere). This can be entirely automated, with no manual effort/nobody has to look at the reports - until and unless something fails. This makes coverage just like any other regression criteria. You might also want to enable branch coverage - just to see what happens:-). Actually working to increase it (and to mark unreachable branches) may or may not be worth the effort - and will depend on your QOS targets and observed defect rate.
Glad to see that the tool is working.
Henry
Thanks.
I saw that differential coverage was a new feature in lcov 2 so will take a look.
I have a gcc 13.2 code coverage build where
lcov -list
does not show the correct information.Below is the part of the output of
lcov --list client_coverage.info
Some files show 2000% coverage but the overall coverage is smaller than excepted.If I ran
lcov --summary client_coverage.info
it shows the correct overall coverage.