views:

46

answers:

2

Hi all,

I am new to XCode and testing, and have followed the steps outlined in the iPhone Development Guide under "Unit Testing Applications".

I added a unit-test bundle to my project, named it "LogicTests", set it as the active target, then added a sample "LogicTests" unit-test class under a new group called "Tests". I wrote the simple one-line test from the doc (STFail(@"Must fail to succeed");), then tried to build my project.

I keep getting the errors: Command /bin/sh failed with exit code 1 and /Developer/Tools/RunPlatformUnitTests.include:448: error: Failed tests for architecture 'i386' (GC OFF).

The second error looks like the test is being run and failing properly, but the first error I am completely clueless about... What could the problem be here?

Thanks, -Greta

A: 

The test thinks your compiling for Intel not ARM architecture. Unfortunately, I can't remember off the top of my head how to set up the target properly.

TechZen
That's normal. The unit test binary runs on your mac, not the iPhone, so it needs to be compiled for a 386 architecture.
chrispix
Yeah, and I would have got that if I had paid attention to which testing framework he was using. *Sigh*
TechZen
+1  A: 

Well this behavior is totally normal. If the unit test failed it will produce a return code of 1. Test the opposite with STTrue(1,@"some message") and it should not return 1 and finish sucessfully.

GorillaPatch