aboutsummaryrefslogtreecommitdiff
path: root/UnitTesting/GTMIPhoneUnitTestMain.m
diff options
context:
space:
mode:
authorGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-05-16 20:47:42 +0000
committerGravatar thomasvl <thomasvl@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2008-05-16 20:47:42 +0000
commit80d493da05c8d461d74bfaa919ffc487be03ffe6 (patch)
treed150f6879fa82bb253643be95a414844fc3b3829 /UnitTesting/GTMIPhoneUnitTestMain.m
parent9eee9a7b5b369a90178b837786e42c909e4207dd (diff)
Standardize the reverse dns names for errors, notifications, etc.
iPhone unit test framework didn't run tearDown on failures. Add String and Dictionary URLArgument support and tests.
Diffstat (limited to 'UnitTesting/GTMIPhoneUnitTestMain.m')
-rw-r--r--UnitTesting/GTMIPhoneUnitTestMain.m15
1 files changed, 11 insertions, 4 deletions
diff --git a/UnitTesting/GTMIPhoneUnitTestMain.m b/UnitTesting/GTMIPhoneUnitTestMain.m
index 16a3907..981c48b 100644
--- a/UnitTesting/GTMIPhoneUnitTestMain.m
+++ b/UnitTesting/GTMIPhoneUnitTestMain.m
@@ -118,20 +118,27 @@ static int MethodSort(const void *a, const void *b) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@try {
[testcase setUp];
- [testcase performSelector:sel];
+ @try {
+ [testcase performSelector:sel];
+ } @catch (NSException *exception) {
+ failed = YES;
+ [self printError:[exception reason]];
+ }
[testcase tearDown];
- fixtureSuccesses += 1;
} @catch (NSException *exception) {
- fixtureFailures += 1;
failed = YES;
[self printError:[exception reason]];
}
[pool release];
} @catch (NSException *exception) {
- fixtureFailures += 1;
failed = YES;
[self printError:[exception reason]];
}
+ if (failed) {
+ fixtureFailures += 1;
+ } else {
+ fixtureSuccesses += 1;
+ }
NSTimeInterval caseEndTime = [[NSDate date] timeIntervalSinceDate:caseStartDate];
NSString *caseEndString = [NSString stringWithFormat:@"Test Case '-[%@ %s]' %s (%0.3f seconds).\n",
fixtureName, name,