views:

806

answers:

8

After upgrading to the 4.1 iOS SDK my unit test bundles always return with the following two errors and one warning:

An internal error occurred when handling command output: -[XCBuildLogCommandInvocationSection setTestsPassedString:]: unrecognized selector sent to instance
An internal error occurred when handling command output: -[XCBuildLogCommandInvocationSectionRecorder endmarker:]: unrecognized selector sent to instance
Run unit tests for architecture 'i386' (GC OFF) did not finish

I get these errors despite it reporting that all X out of X tests passed. I read about a similar bug in an older version of XCode that also occurred immediately after it was released (something about a bug in a regular expression for time) that could be mitigated by setting your time zone to Pacific Time, but I can't say for sure it's a regression to there specifically.

Is anyone else having this problem?

+1  A: 

Yes, I have the same problem after upgrading.

Mike
+1  A: 

IM HAVING THE SAME PROBLEM!! Its driving me bonkers. Anyone know if there is a way to fix this?

Sushant Verma
+1  A: 

I'm getting the same issue too.

Oddly enough, I can get the unit tests to complete properly by running them through the debugger as per http://www.grokkingcocoa.com/how_to_debug_iphone_unit_te.html

So it looks like something wrong with the XCode interface to otest...

I really don't want to set my timezone to PST which this post seems to be indicating as I'm in the UK...

adamcohenrose
I'm in PST and am having this issue. I doubt changing time zone will help you.
Shiun
+1  A: 

I have asked the same question:
http://stackoverflow.com/questions/3688328/problem-doing-logic-tests-after-xcode-3-2-4-upgrade

One answer was that a workaround is posted in the Apple Developer Forums. However, access to these forums requires membership of one of the paid developer programs.

leinz
+2  A: 

This is a confirmed bug in Xcode 3.2.4/4.1 SDK. It has been reported to Apple.

Upgrading to Xcode 3.2.5/4.2 beta SDK solves the problem. I don't know if access to beta SDK:s is open, or if you need to be a registered developer, though.

calmh
+2  A: 

It does seem to be a regression with some part of the reporting code not respecting timezone issues. The output is tagged as ending before it began, so gets very confused and chokes.

One work-around, that I found somewhere on Google, is to change the Run Script stage of the target.

Change

"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests" 

to

"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests" 1> /tmp/RunUnitTests.out 

It’s working round the issue, rather than solving it, but does work.

Andy W
+10  A: 

There is a fix available on the apple dev forums,

https://devforums.apple.com/thread/68687

it's a date parsing problem. The fix is quick, it requires including one .m added to your test bundle. The fix is available above or from:

http://gist.github.com/586296

Dave Lee
I included that file int the Compile Sources step of my target but I'm still getting the errors. Apparently they didn't fix it for everyone.
Matt Baker
just to confirm, it's in your tests target, not your app target?
Dave Lee
Yes, it's included in my test target's (LogicTests) Compile Sources step. Is that the right place?
Matt Baker
yes, that is the correct target. And you're still getting the exact same error messages? I had the same errors, but this fixed it. You could try a breakpoint on `descriptionWithLocale:` in the patch file and see if it's getting hit.
Dave Lee
A: 

Guys, the same here, but my test target is iPad Simulator 3.2.

But now I found this thread: http://stackoverflow.com/questions/3516745 and it works just fine.

Ricardo Valeriano