Tesugen

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.

The above was posted to my personal weblog on April 23, 2002. My name is Peter Lindberg and I am a thirtysomething software developer and dad living in Stockholm, Sweden. Here, you’ll find posts in English and Swedish about whatever happens to interest me for the moment.

Posted around the same time:

The seven most recent posts:

  1. Tesugen Replaced (October 7)
  2. My Year of MacBook Troubles (May 16)
  3. Tesugen Turns Five (March 21)
  4. Gustaf Nordenskiöld om keramik kontra kläddesign (December 10, 2006)
  5. Se till att ha två buffertar för oförutsedda utgifter (October 30, 2006)
  6. Bra tips för den som vill börja fondspara (October 7, 2006)
  7. Light-Hearted Parenting Tips (September 16, 2006)
Bloggtoppen.se