Unit Testing broken in iOS 4.1 SDK?
Asked Answered
R

4

11

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?

Rawdin answered 12/9, 2010 at 18:49 Comment(3)
I am also having this problem. #3517245 suggests changing the Base SDK for the test target, but this does not fix the problem for me.Husha
Running into the same errors with the iOS 4.1 SDK.Phthalocyanine
I am running into the same problem in iOS 4.1 SDK. The problem becomes even more of an issue in iOS 3.2 SDK. A lot more of these internal errors in 3.2. No resolution so far. :-(Khanna
M
10

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

Malchus answered 25/9, 2010 at 15:53 Comment(4)
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.Rawdin
just to confirm, it's in your tests target, not your app target?Malchus
Yes, it's included in my test target's (LogicTests) Compile Sources step. Is that the right place?Rawdin
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.Malchus
H
3

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.

Heptavalent answered 18/9, 2010 at 11:6 Comment(0)
B
2

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.

Bield answered 18/9, 2010 at 10:11 Comment(0)
H
1

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...

Henrieta answered 15/9, 2010 at 9:21 Comment(1)
I'm in PST and am having this issue. I doubt changing time zone will help you.Khanna

© 2022 - 2024 — McMap. All rights reserved.