Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Chris Corbyn

macrumors newbie
Original poster
Jun 28, 2008
17
0
Melbourne, Australia
I do use Xcode, but it bugs me not knowing what commands it's running under the hood since I come from a *nix background and I'm very attached to the command line. For example, I'm comfortable compiling little objective-C apps on command line with gcc and GNU Make; and understanding how that all works makes working in Xcode a much more pleasant experience since it's clear why and how things work.

But OCUnit.... I just can't for the life of me figure out how to build and run tests on the command line. I can do it inside Xcode, but it creates a bundle and then does something mystical with it. Can anyone shed any light, even if they don't have "the" answer?

I've found the "otest" command which Xcode is delegating too, but I'm not sure what it's actually doing to build the tests and run that command.

Ideally I'd like to be able to add a "test" target to a GNU Makefile, just for some understanding of how it works.

The OCUnit documentation (inside the SenTestingKit framework directory) doesn't appear to explain how you run the tests at a lower level than Xcode.
 

Chris Corbyn

macrumors newbie
Original poster
Jun 28, 2008
17
0
Melbourne, Australia
I think I've figured it out. It will only run tests in finds in certain directory layouts (frameworks, bundles and apps), so if you just have a bunch of files in no particular organised way otest won't really be able to do much with them. It's probably best bundling all your testable code up into a framework and running the tests for that framework.
 

Chris Corbyn

macrumors newbie
Original poster
Jun 28, 2008
17
0
Melbourne, Australia
Apologies, I missed your reply because I never hit refresh before posting my reply. The apple developer document you linked to is extremely useful. Xcode is a little intimidating when it does all this stuff and you can't see how. That document explains enough to unravel such mysteries!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.