I'm trying to choose between OCUnit and Google Tool Box, do you have any preferences, would recommend one or the other, why ? I would be very interested to hear about your experiences with any of the 2.
The main problem i have with both of them is the managment of crashes in tested methods (ex: BAD ACCESS) None of them was able to tell me in what class the crash occured !!!
With Google Tool Box i can see which test suite was being run but not the test case (how are you supposed to do when your test suite has 50 test cases ?)
With OCUnit i can at least see what test case in what test suite caused the crash.
Here is the kind of message i have with GTB :
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'LogicTests' started at 2009-12-14 18:03:15 +0100
/Users/admin/Documents/Tests/GTBTest/RunIPhoneUnitTest.sh: line 122: 688 Segmentation fault "$TARGET_BUILD_DIR/$EXECUTABLE_PATH" -RegisterForSystemEvents
Command /bin/sh failed with exit code 139
I can see that it's it the test suite 'LogicTests' that originated the crash but that's all.
With OCunit here is the message for the same error :
Test Suite 'LogicTests' started at 2009-12-14 17:51:26 +0100
Test Case '-[LogicTests testFail]' started.
/Developer/Tools/RunPlatformUnitTests.include: line 415: 536 Segmentation fault "${THIN_TEST_RIG}" "${OTHER_TEST_FLAGS}" "${TEST_BUNDLE_PATH}"
At least with OCUnit i can track what test case was being run and eventually debug it (but that could take a very long time without any class and line number info...)
How do you deal with these problems ?
Thanks in advance.
PS: here is how to reproduce the problem, it's very simple :
Just create a class with a method that crashes when it's called (which happens all the time when you're doing TDD) :
- (void) crashMethod {
NSMutableArray *crashArray;
[crashArray addObject:[NSObject new]];
}
And then create a test case that calls this methods :
- (void) testFail {
ClassToTest *test = [[ClassToTest alloc] init];
[test crashMethod];
[test release];
}
Thanks in advance, Vincent