I started using lcov
about a month back. The coverage count seems inconsistent. The first run reported about 75% line coverage where as second run reported only 19%. The test suite used was some for both the runs. I see following warning during lcov --remove
. Any suggestions?
lcov: WARNING: negative counts found in tracefile all.info
Is this something to worry about?
Same known issue is reported here on GitHub.
Replacing all counts of
-1
in the output with0
(e.g. withsed -i -e 's/,-1$/,0/g' <outputfile>
) causes the warning to disappear from thelcov
andgenhtml
output while still producing the correct coverage report.More importantly (at least for me), submitting the file with the counts set to
0
instead of-1
tocodecov.io
results in the results being parsed correctly and the coverage information being available throughcodecov.io
.
Codecov also handle this kind of value error:
# Fix negative counts
$count = $2 < 0 ? 0 : $2;
if ($2 < 0)
{
$negative = 1;
}
Follow some other fixes:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With