Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit Testing broken in iOS 4.1 SDK?

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?

like image 835
Matt Baker Avatar asked Sep 12 '10 18:09

Matt Baker


3 Answers

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

like image 177
Dave Lee Avatar answered Oct 19 '22 11:10

Dave Lee


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.

like image 42
creednmd Avatar answered Oct 19 '22 10:10

creednmd


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.

like image 27
Jakob Borg Avatar answered Oct 19 '22 11:10

Jakob Borg