我的iPhone应用程序需要代码保护.
I need code coverage for my iPhone app.
如何获得Xcode 4的代码覆盖率?
How do I get code coverage for Xcode 4?
推荐答案这些步骤将有所帮助.
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:
Enable "Generate Test Coverage Files" Enable "Instrument Program Flow" Add "-lgcov" to "Other Linker Flags"
使用Coverage模式编译应用程序.
Compile application with Coverage mode.
从应用程序捆绑包文件夹中检查.gcno文件.
Check .gcno files from your application bundle folder.
Coverage-iphonesimulator/applicationname.build/Objects-normal
Coverage-iphonesimulator/applicationname.build/Objects-normal
使用CoverStory打开.gcno文件.从下载CoverStory code.google/p/coverstory/downloads/list
open .gcno files with CoverStory. Download CoverStory from code.google/p/coverstory/downloads/list
参考站点
- atastypixel/blog/unit-使用xcode/ 测试和覆盖
- milesdennis.blogspot .co.uk/2011/04/code-coverage-in-xcode-4.html
- atastypixel/blog/unit-testing-and-coverage-with-xcode/
- milesdennis.blogspot.co.uk/2011/04/code-coverage-in-xcode-4.html
更多推荐
如何获得我的Objective
发布评论