How to run OCUnit tests? Without Xcode...

Discussion in 'Mac Programming' started by Chris Corbyn, Jul 9, 2008.

  1. Chris Corbyn macrumors newbie

    Chris Corbyn

    Joined:
    Jun 28, 2008
    Location:
    Melbourne, Australia
    #1
    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.
     
  2. Chris Corbyn thread starter macrumors newbie

    Chris Corbyn

    Joined:
    Jun 28, 2008
    Location:
    Melbourne, Australia
    #3
    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.
     
  3. Chris Corbyn thread starter macrumors newbie

    Chris Corbyn

    Joined:
    Jun 28, 2008
    Location:
    Melbourne, Australia
    #4
    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!
     

Share This Page