Codecov invokes gcov incorrectly

When running (from I noticed that it invokes gcov incorrectly for project with subdirectories and then gets completely confused where the source files live.

I tried to run it with several different ways to get some sensible output, but I get only nonsense like 8% coverage, and looking at hits, I see it’s missing several that should have been hit. It’s like it can’t figure out the output of gcov.

Any hints on what to do?

@cmouse, we’ll probably need more information here like the Codecov output or a build URL. Have you tried running the bash script in the subdirectories? Is this a monorepo?


Codecov output is available here and the repository is at

I tried various ways, including manually running gcov using a find + helper script to generate gcov information in correct directories and then invoking codecov tool with -X gcov. You can also see the output at - I compared this to what lcov gives us and it’s wildly different result.

Hi @cmouse, apologies if I wasn’t clear. I meant the Codecov output that includes the banner which is typically found in the CI run. You can also post a build url.

Hi tom, please find it here

Thank you for looking into this.


This has been prepared by running gcov -mbupa *.c *.h *.cc *.hh in each source directory.

Hi @cmouse, sorry to keep coming back for more information. I guess what I’m trying to attain is for a recent commit (1) what are you expecting coverage to look like via a report or screenshot, (2) what is the Codecov output, and (3) what is the commit SHA so we can take a look at the build and see where things might have gone wrong.

The output that you copied has gcov disabled, so it’s not getting invoked by Codecov.

You can use the latest master, You can see from above screenshot that the coverage should be around 50%, and in particular the lib directory should have ~78% coverage.

As I explained in my comment, we need to prepare this outside codecov, because it calls gcov incorrectly, and stuffs all gcov output files to source root directory.

@tom hi, do you still need further information?

Hi @cmouse, sorry for the delay here. This is a bit of a beast to try to debug. Would you happen to have coverage for one file in particular? It would be a little easier to pinpoint where this might be failing.


To get coverage for, say, lib directory, you can just run ./test-lib under there. The entire output has been gathered with make check. But, I have included screenshot of some of the files under lib, maybe this helps?

Including also full line coverage for aqueue.c