SenTestCase in Xcode 3.2 and XCBuildLogCommandInvocationSection Errors
Asked Answered
S

4

5

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!

Septime answered 18/8, 2010 at 21:12 Comment(0)
V
21

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.

Vip answered 18/9, 2010 at 11:13 Comment(4)
Hey Andy. Thanks for the hint! Will it still report errors if you redirect STOUT?Septime
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.Vip
My Target has no Run Script, hence the first line Andy specifies doesn't exist. I'm looking for the Run Script by expanding the Target and again expanding the project name within the Target. Is this the correct place to look?Monahan
@Monahan If you right-click on the project name within the target, you get the option to Add->New Build Phase->New Run Script Build Phase. So yes, right place, but you may have to add the Run Script itself.Vip
G
4

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.

Guise answered 31/8, 2010 at 1:37 Comment(2)
Thanks for the tip! I was running on 4.1 and changing to 4.0 fixed the issue. Appreciate it!Septime
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.Istle
T
2

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
Teodor answered 23/9, 2010 at 15:12 Comment(0)
B
-1

This appears to be fixed (finally!) in the 4.2 SDK.

Brazenfaced answered 12/11, 2010 at 19:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.