2

I have generated .gcno and .gcda files after running my iphone app.Then I use cover story to view the coverage rate.However, cover story could not open the source file and I found that the source path is a relative path, not full path.All I can see is full of /EOF/ in the screen. The strange to me is that only some of the files could not open due to this path issue. Most of them are full path and cover story can open them successfully.Unable to attach screenshot

How can I show the correct path names in CoverStory?

Jasper Blues
  • 28,258
  • 22
  • 102
  • 185

1 Answers1

0

I suggest generating an HTML report with lcov, which allos you to normalize the directory names.

Other benefits of using an HTML report are:

  • The coverage information is available on both desktop machines as well as from a Continuous Integration build server.

To install lcov

  • Use Homebrew or MacPorts

Example:

brew install lcov

First Generate Datafile

#!/bin/bash
set -e # fail script if any commands fail
${gen.info} ${temp.dir}/coverage-data/*.gcno --no-recursion --output-filename \
${temp.dir}/${module.name}-temp.info
#Remove symbols we're not interested in.
${lcov} -r ${temp.dir}/${module.name}-temp.info > ${temp.dir}/${module.name}.info

Now Generate the HTML Report

#!/bin/bash
set -e # fail script if any commands fail

${gen.html} --no-function-coverage --no-branch-coverage -o ${coverage.reports.dir} \
--prefix ${basedir} ${temp.dir}/${module.name}.info

If you're interested, I have an build script the produces HTML reports here. An example report: http://jasperblues.github.io/Typhoon/coverage/index.html

Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
  • Hi,Jasper. I use lcov tool to generate html report with .gcda and .gcno files together,but I found the report missed a lot of .m files , only its .h file listed.Do I miss something? – Pan Xiaoming Oct 25 '13 at 08:43
  • Yes, the .m files should be in there. See the sample report that I linked to? . . when you tried CoverStory where the .m files there? – Jasper Blues Oct 25 '13 at 10:18
  • Yes,I can see the .m and .h files with coverstory. Not sure why missing some .m information in the report. – Pan Xiaoming Oct 28 '13 at 01:45