Skip to content
A script that converts output from OCUnit in xcodebuild to the XML format used by JUnit. This allows for XCode builds on continuos integration servers like Hudson, complete with test reports! This forked version can deal with Kiwi BDD output and generate proper method names for CI output.
Pull request Compare This branch is 2 commits behind MattesGroeger:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


OCUnit2JUnit is a script that converts output from OCUnit or Kiwi to the format used by JUnit. The main purpose is to be able to parse output from Objective-C (OCUnit) test cases on a Java-based build server, such as Jenkins.


  • Install with 'gem install ocunit2junit' (possibly prepended by 'sudo' if your Ruby installation requires that)


  • Make sure your build server can access the xcodebuild executable
  • Use this shell command to build:

    xcodebuild -t <target> -sdk <sdk> -configuration <config> 2>&1 | /path/to/ocunit2junit.rb

  • The output is, by default, in the test-reports folder

  • If your build fails, this script will pass the error code
  • All output is also passed along, so you will still see everything in your build log


This script also generates human readable test results for Kiwi BDD Testing Framework:

Example output

However, if you don't want this, you can disable it in the header:


More information

Can be found in this blog post.


Free to use however you want.

Something went wrong with that request. Please try again.