The recent upgrade to XCode 3.2.4 and iOS SDK 4.1 lead to that my unit tests are not working any longer with my iOS project. The project is currently only running on the simulator, not real hardware.
I tried to make a new blank project with a dummy test case added that will always pass, but it does not work either, giving me this result:
An internal error occurred when handling command output:
-[XCBuildLogCommandInvocationSection setTestsPassedString:]: unrecognized selector sent to instance 0x20176e320
An internal error occurred when handling command output:
-[XCBuildLogCommandInvocationSectionRecorder endMarker]: unrecognized selector sent to instance 0x201257de0
Is anyone else having issues with their test cases using XCode 3.2.4 and iOS SDK 4.1?
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.
The workaround for the issue is posted in the Developer Forum of Apple. It works fine in my project. Visit the website and try it.
My suggestion to fix your problem is to consider using GHUnit. It works with your existing SenTestCase classes, but it also has a set of testing classes/assertions. You just setup a new target and point at their driver class. You get a fully functioning test harness that can run your tests on both the simulator and real devices. I find it much easier and more robust than setting up a test bundle and having to manage all that.
http://github.com/gabriel/gh-unit