views:

1605

answers:

4

I have a set of SenTestCase that are causing issues in XCode 3.2.4. When attempting to compile (with a very basic STFail(@"");) the following compiler errors occur:

An internal error occurred when handling command output: -
[XCBuildLogCommandInvocationSectionRecorder endMarker]:
unrecognized selector sent to instance

An internal error occurred when handling command output: -
[XCBuildLogCommandInvocationSection setTestsPassedString:]:
unrecognized selector sent to instance

I've included the SenTestkingKit.framework from '/Developer/Library/Frameworks' and just created by target by 'Targets > Add > New Target > Cocoa Touch > Unit Test Bundle'. Any ideas? Thanks!

+3  A: 

I had the same issue when developing an iPad app. Try changing the Base SDK of your test target from iPhone Device 3.2 to iPhone Device 4.0.

Arrix
@arrix Thanks for the tip! I was running on 4.1 and changing to 4.0 fixed the issue. Appreciate it!
Kevin Sylvestre
Changing the Base SDK fixed the problem for me, using XCode 3.2.3 / SDK 4.0. I changed the separate target for tests to get tests to build, or the changed the main app target (which depends on the tests) for the app to build. Both IiPhone Device 4.0 and iPhone Simulator 4.0 worked. Alternatively changing the project settings (user456331) worked for both. As well as setting the SDK to 4.0, you should also set the iPhone OS Deployment Target to the version you want to be backwards compatible with.
Sly
+13  A: 

It seems 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
Hey Andy. Thanks for the hint! Will it still report errors if you redirect STOUT?
Kevin Sylvestre
As far as I can tell, yes. It just doesn’t do the nice nesting of tests as they run, and dumps it all in the build window.
Andy W
Saved my day, thanks @Andy W!
Yar
You rock, thanks Andy the man!
TheLearner
+2  A: 

I had the same problem with xcode 3.2.3 and iPad. This one helps me to solve it:

Project -> Edit Project Settings -> Build -> Base SDK = iPhone Device 4.0
Project -> Edit Project Settings -> Build -> iPhone OS Deployment Target = iPhone OS 3.2
+2  A: 

I had the same issue and the topic is discussed in the other question.
http://stackoverflow.com/questions/3688328/problem-doing-logic-tests-after-xcode-3-2-4-upgrade

The patch file is posted on the github. This helps me to solve it.
http://gist.github.com/586296

yusami