I created an Xcode 4 project with the Cocoa Touch Unit Testing Bundle. I can successfully create and run logic tests. However, I'm not sure how to create a test as an application test that runs on an iOS device and uses UIKit. When I create a test that uses UIKit and try running the bundled tests on the device, Xcode 4 will open a dialog box that says:
Logical testing not available
Logical testing on iOS devices is not supported. You can run logic tests on a simulator.
I tried running the test on a simulator, but of course it was not able to make UIKit calls.
Does anyone know how to create and run application tests on iOS devices using Xcode 4 and Cocoa Touch Unit Testing Bundle?
EDIT: In case this helps, here is the test code:
@implementation TinyWordsTests - (void)setUp { [super setUp]; CC_DIRECTOR_INIT(); } - (void)tearDown { CC_DIRECTOR_END(); [super tearDown]; } - (void)testExample { CCScene *scene = [TWOHelloWorldLayer scene]; STAssertNotNil(scene, @"Scene must not be nil."); } @end
and the resulting stack trace from gdb when the test runs in the simulator:
(gdb) bt
source share