2

With the latest Xcode we can now view code coverage of local builds or integrations. I want to export the coverage results to build some analysis of this data.

The project https://github.com/jonreid/XcodeCoverage seems like a simple way to export the report data into xml or html which I can use to build something else. But I am having some difficulty.

The setup is fairly simple.

  1. pull from the repository.
  2. add the XcodeCovearage in my project.
  3. ad a build phase script to run exporting.sh
  4. Run my tests.
  5. execute getcov to view the data.

When I run getcov I get the following output:

~/Library/Developer/Xcode/DerivedData/Garage-emxrmloetsurmcgqiahicyecarix/Build/Intermediates/CodeCoverage/Garage/Products/Debug-iphonesimulator /Workspace/ios/Garage/XcodeCoverage
/Workspace/ios/Garage/XcodeCoverage
Capturing coverage data from /Users/Seamus/Library/Developer/Xcode/DerivedData/Garage-emxrmloetsurmcgqiahicyecarix/Build/Intermediates/CodeCoverage/Garage/Intermediates/Garage.build/Debug-iphonesimulator/Garage.build/Objects-normal/x86_64
geninfo: Use of uninitialized value $version_string in substitution (s///) at /Workspace/ios/Garage/XcodeCoverage/lcov-1.11/bin/geninfo line 1914.
geninfo: Use of uninitialized value $version_string in pattern match (m//) at /Workspace/ios/Garage/XcodeCoverage/lcov-1.11/bin/geninfo line 1917.
geninfo: Use of uninitialized value $version_string in pattern match (m//) at /Workspace/ios/Garage/XcodeCoverage/lcov-1.11/bin/geninfo line 1930.
geninfo: Use of uninitialized value $gcov_version_string in pattern match (m//) at /Workspace/ios/Garage/XcodeCoverage/lcov-1.11/bin/geninfo line 3720.
geninfo: Use of uninitialized value $gcov_version_string in pattern match (m//) at /Workspace/ios/Garage/XcodeCoverage/lcov-1.11/bin/geninfo line 3720.
Scanning /Users/Seamus/Library/Developer/Xcode/DerivedData/Garage-emxrmloetsurmcgqiahicyecarix/Build/Intermediates/CodeCoverage/Garage/Intermediates/Garage.build/Debug-iphonesimulator/Garage.build/Objects-normal/x86_64 for .da files ...
geninfo: WARNING: no .da files found in /Users/Seamus/Library/Developer/Xcode/DerivedData/Garage-emxrmloetsurmcgqiahicyecarix/Build/Intermediates/CodeCoverage/Garage/Intermediates/Garage.build/Debug-iphonesimulator/Garage.build/Objects-normal/x86_64 - skipping!
Finished .info-file creation
Reading tracefile Coverage.info
lcov: ERROR: no valid records found in tracefile Coverage.info
Reading tracefile Coverage.info
lcov: ERROR: no valid records found in tracefile Coverage.info
Reading data file Coverage.info
genhtml: ERROR: no valid records found in trace file Coverage.info

Seems to be missing some information about the version of the lcov or getcov scripts and failing to build coverage.info

Has anybody tried using this with Xcode7

does anybody know any other useful tools to export the coverage data from Xcode?

Thanks,

Seamus
  • 1,107
  • 10
  • 22
  • Checkout the calls done from Codecov (a hosted code coverage provider) [Example repo](https://github.com/codecov/example-swift). This code shows how to produce a coverage report: https://github.com/codecov/codecov-bash/blob/fb17eb66ad3409e35e368d509f8faf000b1f416e/codecov#L368-L383 – Steve Peak Oct 02 '15 at 17:21
  • You can also try this one: https://github.com/macmade/xcode-coveralls – Macmade Oct 02 '15 at 17:49
  • Did you find solution for this? – Ganesh Manoj Jun 06 '16 at 06:07

1 Answers1

-1

It is problem of lcov. You just need to update lcov version to 1.12 and replace in code coverag