`Codecov` output is different from `lcov`


The output of codecov: link is different from the Lcov output for the same file (gcov 9.3.0 is used on both): link.
The file itself: link.
The gcov file: link


Only 4 links per post, so:

Steps to Reproduce

  1. run codecov
  2. run lcov
  3. compare them

Expected behavior: Similar results

Actual behavior: 10% coverage vs 55%

Flakiness? All the time.


Windows 10 + WSL Ubuntu 18.04
GCC 9.3.0 (with GCOV)
LCOV 1.14-6-g40580cd

Hmmm, this is strange. Unfortunately, it seems like the coverage report we receive is different from the one generated in your second link. As an example, we receive this from CircleCI https://codecov.io/gh/Cvelth/argument_parser/commit/267c8efcc1901839a0c59f108a8afa049b845c87/build

Raw report: https://codecov.io/codecov/v4/raw/2020-04-28/0DCFB4EA8A9DDE8A022AAA2556F2C713/267c8efcc1901839a0c59f108a8afa049b845c87/3832b657-b09b-466a-bd0e-ce27bf728010.txt

You’ll see that it starts at line 48, but the file you linked shows up at 38 first

Somewhere when you are calling codecov we are receiving a different file.

Thanks for the answer, but I’ve already solved the issue with a different method: it seems like inconsistency was caused by the analyzed file being a header. Writing a simple script to combine all the sources into a single cpp and measuring code coverage on it resolved any problems.

1 Like

Amazing! Glad that it worked out for you.