开发者

iOS UnitTest target stopped running my SenTestCases, why?

I have a static library project with a UnitTest target using the built-in SenTestingKit framework. Whilst banging around the project, I toggled some setting and now when I build the UnitTest target, none of my test cases are run. What could be going wrong?

NOTE: I already solved this problem and am about to answer my own question, just hope that this saves someone else in the community some开发者_StackOverflow time.


SenTestCases will only be discovered and run if you are building for Simulator. If you build for Device, it will look as if all the tests have passed, but in fact no tests have run at all. Toggle the build setting back to Simulator and the tests should run normally.


Just came across this old Q/A, and just to update, it's no longer true for the changes in iOS 7. You can run unit tests on device just fine, and Xcode Build Services in fact recommends this approach.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜