Unit testing in XCode 4

夙愿已清 提交于 2020-01-10 08:27:05

问题


I've managed to set up unit tests for my library in Xcode 4. I've performed builds with tests that I know will pass and fail (i.e. STAssertTrue(YES) and STAssertTrue(NO) ) just to make sure it's working. I'm using the default apple SenTest libraries following this document.

However, when my tests are running I'm getting this error in the build log :

An internal error occurred when handling command output: -[IDEActivityLogSectionRecorder endMarker]: unrecognized selector sent to instance 0x20310b580

To be clear, it's not affecting the running of the tests at all, just the output into the build window. All the tests run each time so I can tell a pass / fail by looking to see if the build succeeds or fails.

However, when my tests fail I can't find out which one fails because the output seems to stop when it gets to that error.

Does anyone have experience with unit testing / Xcode 4 / this error?


回答1:


I realise it doesn't directly answer your question, but forget SenTestingKit and use GHUnit. It'll take you about 10 minutes to figure out (much more straightforward than OCUnit) and will save you a lot of headaches. IMHO, Apple should be shipping it with Xcode instead of OCUnit.

GHUnit can run your tests in a true application environment (with a GUI), or on the command line. It literally just drops into your existing project as a separate target.

https://github.com/gabriel/gh-unit




回答2:


I just posted this on another thread, but I'm going the opposite direction for Xcode 4.

Please see my blog post exploring the topic, leave a comment if you think I'm wrong.



来源:https://stackoverflow.com/questions/4388370/unit-testing-in-xcode-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!