views:

549

answers:

4

I'm using google unit testing code.

I'm building it quite nicely with xcodebuild on the command line. Now I want to run it (preferably on attached Device but simulator would also work) and catch all the feedback from the tests.

But I can't find out how to run it. Any ideas?

+1  A: 

If you followed the instructions from the Google page (creating the target, adding the test files to the target) and you have an iPhone SDK certificate (you need it to upload apps to the device) you can just change the Active SDK to your device (upper left corner combo in XCode)

If you don't have a certificate, you need to apply to the SDK program.

Marco Mustapic
can this be done on the command line?
akf
Sorry, not that I know. I suppose you are trying to build a continuous integration system for iPhone. So far, I have only managed compile a project and launch the simulator, but couldn't make it run a build.
Marco Mustapic
Yes, I was hoping to do automated build testing. What I've learned is that I need to write tests that run different parts of my program.. is there a way to just have it run and my tests call different aspects of it? From what I can gather the unit tests are intended more so to test specific features.
cmos
Yes, unit tests test specific functionality, like methods or simple use cases. You can try the new Unit Test functionality in SDK 3.0:http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/135-Unit_Testing_Applications/unit_testing_applications.htmlYou can run the tests every time you compile the app, but it's somewhat frustrating not being able to debug those tests.
Marco Mustapic
I've done that, but we wanted the applciation to 'run'. We are on a team, and want this to build when we submit code + show up on our Pulse automated builder (with some scripting interfacing). That's why a command line option is good. I guess a question could be, can I run the app from a test? I have it testing + building when I type 'xcodebuild -target desiredTargetNAme.
cmos
+1  A: 

Jeff Haynie's iphonesim project on Github looks like it could work. I had trouble building 27812bb4b (make failed on a warning in nsprintf.m), but that may just be me using a pre-release OS and SDK. See also this related question.

Ryan McCuaig
A: 

The only iPhone simulator and debugger I'm aware of comes with the iPhone SDK. In order to use the iPhone SDK you need to have an Intel-based mac with OS 10.5 Leopard installed, in which case you might as well be programming/compiling in XCode instead of using the command line.

bkritzer
A: 

There has to be some misunderstanding here. What exactly do you want to run from the command line? The test suite? If so, the test suite should be a separate target, so that all you have to do is build it, for example like this:

xcodebuild -target UnitTests -sdk iphonesimulator2.2.1 -configuration Debug

If you have the testing target configured correctly, it will run the RunIPhoneUnitTest.sh shipped with the Google Toolbox and the script will run all your tests.

zoul