3

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:

  1. Created an XCode 'Coverage' configuration via these instructions (Steps 1+2): https://developer.apple.com/library/ios/qa/qa1514/_index.html

  2. 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.

  1. 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.

  • I've come across this error too. See this related post: http://stackoverflow.com/questions/22343725/xcode-5-1-unit-test-coverage-analysis-fails-on-files-using-blocks/28533416#28533416 though it didn't fix it for me – the_mandrill Feb 25 '15 at 12:07

0 Answers0