9

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?

9
  • 3
    Not really an answer, 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. It's pretty too. Just my $0.02. Commented Dec 8, 2010 at 14:13
  • Hmmm, I was hoping none of the answers said just to use something else, I've only just got SenTestingKit working! Oh well, live and learn. Commented Dec 8, 2010 at 14:43
  • is it appropriate to ask Xcode 4 questions yet? Commented Dec 8, 2010 at 15:07
  • I'm pretty sure a non-disclosure doesn't forbid asking questions. It might, however, forbid anyone from answering them ;) Commented Dec 8, 2010 at 15:13
  • 2
    @d11wtq - if you put your comment as an answer I can mark it as accepted - GHUnit works, SenTestingKit doesn't. Commented Dec 8, 2010 at 21:42

2 Answers 2

11

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Very nice writeup--thanks for pointing out the improvements in Xcode 4
+1 great job! The integration level of Xcode 4 makes this great. A lot less manual work for the dev to keep the tests running.
@makdad - That blog link is expired.. Can you please provide an updated link?
5

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

7 Comments

I am trying to figure out why @d11wtq think GHUnit is better than SenTestingKit, after all SenTestingKit is integrated into xcode4,that will be great!stackoverflow.com/questions/5348712/…
Um how about a document that explain how to actually write and run unit tests in Xcode 4?
BTW GHUnit is also a nightmare - the installation instructions make no sense at all e.g.: In the Finder, copy GHUnit.framework to your project directory (maybe in MyProject/Frameworks/.) - what does that even mean!?
@TheLearner That instruction just means copy the .framework somewhere into your project, e.g. a new folder in your project for frameworks called "Framework".
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.