1

I have just started to use the unit testing features in Xcode 4.4.1 with the LLVM Compiler. I have created some basic unit tests. I have attempted to turn on code coverage by turning on the "Instrument Program Flow" and "Generate Test Coverage Files" in the Product section. Also, I have looked through and can't see anything written in the prefix header section. From what I have read in XCode 4.4.1 this is all you have to do to get it to work and it should generate .gcno and .gcda files in the objects-normal/i386 folder which can be opened with CoverStory to view the code coverage. After I quit my app the .gcno files are getting updated but I am not getting any .gcda files. I open the .gcno file in CoverStory which is showing a 0% coverage

Any help would be greatly appreciated

4

1 回答 1

2

当应用程序干净退出时会生成 Gcda 文件。您是否正确关闭了应用程序?尝试exit(0)从您的测试/代码中调用。

或者,此链接建议退出模拟器而不是退出 Xcode,或添加

<key>UIApplicationExitsOnSuspend</key>
<true/>

到你的清单。

于 2012-11-06T18:40:58.577 回答