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?

Matt Baker
  • 3,394
  • 3
  • 25
  • 35
  • I am also having this problem. http://stackoverflow.com/questions/3516745/sentestcase-in-xcode-3-2-and-xcbuildlogcommandinvocationsection-errors suggests changing the Base SDK for the test target, but this does not fix the problem for me. – Steve Madsen Sep 13 '10 at 14:30
  • Running into the same errors with the iOS 4.1 SDK. – ynnckcmprnl Sep 17 '10 at 12:22
  • 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. :-( – Shiun Sep 17 '10 at 21:15

4 Answers4

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

Dave Lee
  • 6,299
  • 1
  • 36
  • 36
  • 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 Sep 25 '10 at 16:20
  • 1
    just to confirm, it's in your tests target, not your app target? – Dave Lee Sep 25 '10 at 16:22
  • Yes, it's included in my test target's (LogicTests) Compile Sources step. Is that the right place? – Matt Baker Sep 25 '10 at 16:38
  • 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 Sep 25 '10 at 21:01
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.

creednmd
  • 2,001
  • 2
  • 18
  • 25
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.

Jakob Borg
  • 23,685
  • 6
  • 47
  • 47
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...

Community
  • 1
  • 1