ocrunner

ocrunner is a little Ruby wrapper for running OCUnit tests in Xcode from the command line. Its main purpose is to parse the huge output from xcodebuild and display a pretty summary to the user.

To use this, you’ll need to be set up with a test target. See developer.apple.com/mac/articles/tools/unittestingwithxcode3.html

Usage

cd path/to/xcode/project/directory
ocrunner

To run tests as files are changed (autotest-style), use:

ocrunner --auto

I don’t like your defaults

Don’t worry, you can specify the target/configuration/sdk options passed to xcodebuild. You can see all the available options by running ocrunner -h:

–sdk, -s <s>: SDK to build against (default: iphonesimulator3.1.3) –target, -t <s>: Target to build (default: Test) –config, -c <s>: Configuration to use (default: Debug) –parallel, -p: Use multiple processors to build multiple targets (parallelizeTargets) (default: true) –auto, -a: Watch filesystem for changes and run tests when they occur –growl, -g: Report results using Growl –debug-command, -d: Print xcodebuild command and exit –verbose, -v: Display all xcodebuild output after summary –version, -e: Print version and exit –help, -h: Show this message

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Jim Benton. See LICENSE for details.