如何获得我的Objective

编程入门 行业动态 更新时间:2024-10-24 20:23:08
本文介绍了如何获得我的Objective-C应用程序的Xcode的代码覆盖率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的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

    本文发布于:2023-07-27 23:00:56,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1225136.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何获得   Objective

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!