I've looking to get an HTML code coverage report working with an XCode 6.1 based project. My solution 'partially works', but I'm getting a lot of skipped files when running lcov:
geninfo: file found unrecognized record format - skipping
Some more detail on my setup:
Created an XCode 'Coverage' configuration via these instructions (Steps 1+2): https://developer.apple.com/library/ios/qa/qa1514/_index.html
Build and run my standalone testrunner using this configuration via
xcodebuild
.
This successfully appears to generate GCNO
files and GCDA
files for each of my source files. So far so good.
Run
lcov
(v1.11) to generate an HTML report. The command I'm using looks like the following:lcov --capture --derive-func-data --directory ./build/Coverage/MyCppRunner.build --output-file lcov-testrun.info --ignore-errors graph
This also succeeds, due to the ignore-errors
argument. However, I'm getting a lot of skipped gcno files with the following error:
geninfo: WARNING: /Users/myname/build/Coverage/MyCppRunner.build/Objects-normal/x86_64/MyFile.gcno: found unrecognized record format - skipping
When I generate my HTML report via genhtml
, these files don't show any coverage.
Is there any way around this issue? A different set of clang
flags perhaps, or an alternative to lcov
? I briefly tried gcovr
, but I couldn't get it working.