I need code coverage for my iphone app.
Can anyone provide detailed information on how to get code coverage for Xcode 4?
Thanks
I need code coverage for my iphone app.
Can anyone provide detailed information on how to get code coverage for Xcode 4?
Thanks
I have an entry on my blog which covers this exact topic.
It provides a step-by-step guide on how to enable GCOV in Xcode 4 as well as how to use CoverStory for displaying the results.
I couldn't find a good example of this, so hopefully this will help someone else.
If you want to generate HTML from your code coverage (once you get your .gcda files generated), you can install
lcov
and use these commands:These steps will help.
Create a new build configuration (‘Coverage’), duplicated from the ‘Debug’ configuration.
Open up build settings for the main target, make sure your new configuration is selected, and:
Compile application with Coverage mode.
Check .gcno files from your application bundle folder.
Coverage-iphonesimulator/applicationname.build/Objects-normal
open .gcno files with CoverStory. Download CoverStory from
http://code.google.com/p/coverstory/downloads/list
Reference Sites