Question

I have been trying to get the code coverage of some test cases I have been running using lcov.

However when I run

lcov --directory $PWD --capture --output-file lcov.output

I am getting a warning

geninfo: WARNING: cannot find an entry for test.c.gcov in .bb file, skipping file!

If I run gcov directly on test.c, I am able to generate a gcov output which successfully shows the utilization.

I am new to code coverage. Any help to fix this would we greatly appreciated.

Was it helpful?

Solution

There had been a change in the gcov format at some point. Basically the issue is because current versions of gcov produces a header with source file name etc. Lcov expected this header and tried to extract this failing which the error was shown.

As a workaround, I modified the LCOV code such that if the header returned was empty, the source file name is assumed directly from the gcov file name. This solution may not be the most elegant as it may cause incompatibles if the gcov file is created with a name different from the source file name

Update: This particular issue was due to a bug in lcov-1.8. The versions from lcov-1.10 should have the fix for this. (http://ltp.cvs.sourceforge.net/viewvc/ltp/utils/analysis/lcov/bin/geninfo?r1=1.106&r2=1.107)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top