XUnit Framework for Mac / iPhone

Does anyone know any xUnit testing framework for Mac OS, more specifically for iPhone OS? I saw a couple online, google-toolbox-for-mac and objcUnit, but they didn't seem to have developed on them for a long time.

Are there any Objective-C developers who do unit testing, and if you use what tools you use?

+4
source share
4 answers
  • gh-unit is a great foundation and is actively supported. It has a graphical interface.
  • ocunit bundled with Xcode.
  • XcodeUnitTestGUI , which is pretty immature, but works and provides a graphical interface for ocunit-based tests (disclaimer is my project).
+4
source

OCUnit (shipped with Xcode) is a complete xUnit testing framework that integrates with Xcode (crashes appear as related build errors) and runs on iPhone and OS X. Google Toolbox for Mac provides additional features (including UI testing and gcov support ) on top of OCUnit. I am not sure where you have the idea that it is not in active development. The last change was only 4 days ago (at the time of publication). For a breadboard layout, check out OCMock, the funny library integrated into OCUnit (you may find that the dynamic nature of Objective-C makes unit testing in general and taunts, in particular, much easier than expected by those who are used to C / C ++ / C # / Java).

Believe it or not, Objective-C developers do unit testing.

+3
source

UnitTest ++ is a very light but powerful unit testing system that I like. This is the site: http://unittest-cpp.sourceforge.net/ .

I wrote a blog article about integrating it into the iPhone development environment, for more information you can see here: http://acornheroes.com/?p=152

Hope this helps.

+1
source

I agree that OCUnit is a great xUnit tool. The integration with Xcode is solid, and it works well with OCMock. It’s also hard to exaggerate the value of Apple committed to the code - there is certainly room for improvement, but it is robust and still supported. Xcode also gcov well with gcov , the GNU tool for setting code coverage. A few links ...

To back up Barry, yes, many Objective-C developers do unit testing, including inside Apple. (Just ask @bbum about the CoreData unit tests ...). Examples of what you can do, feel free to run into my side project:

+1
source

All Articles