Test Runner for ObjcUnit
I’ve been thinking of writing a simple GUI test runner for ObjcUnit. The test runners (GUI or not) for JUnit are invoked with the test classes in the classpath, passing as argument the name of the class subclassing/returning a TestSuite. This and all test classes are then loaded using the Java class loader.
The other unit testing framework for Objective-C, OCUnit uses a similar style for its test runners. You pass the app, bundle, framework or tool as an argument and it loads all classes and executes the test classes.
However, we want ObjcUnit to be simplistic and this approach gets too complicated in our opinion. The text test runner isn’t a single tool – instead you create a tool target and add all your test classes to it, along with the testees, write a little main() that calls TestRunnerMain() with a class that responds to +suite.
The GUI test runner would execute the text test runner and check its output. This way, you can keep it running between compiles, which is essential. A first version could simply check for OK or otherwise signal that the tests failed. Then you could continue to make it more sophisticated.
The text test runner could accept arguments, so that the GUI test runner could pass the name of single test cases to be run, or to request a list of all test classes and methods that can be browsed, etc. Then if you make the GUI test runner scriptable, you could have an AppleScript build phase in Project Builder that brings up the test runner and runs all tests.