diff options
Diffstat (limited to 'UnitTesting/GTMUIUnitTestingHarness')
-rw-r--r-- | UnitTesting/GTMUIUnitTestingHarness/main.m | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/UnitTesting/GTMUIUnitTestingHarness/main.m b/UnitTesting/GTMUIUnitTestingHarness/main.m index 57ef9c2..7438499 100644 --- a/UnitTesting/GTMUIUnitTestingHarness/main.m +++ b/UnitTesting/GTMUIUnitTestingHarness/main.m @@ -7,9 +7,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -20,8 +20,20 @@ #import <Cocoa/Cocoa.h> #import "GTMAppKitUnitTestingUtilities.h" +#import "GTMFoundationUnitTestingUtilities.h" int main(int argc, char *argv[]) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + [GTMAppKitUnitTestingUtilities setUpForUIUnitTestsIfBeingTested]; - return NSApplicationMain(argc, (const char **) argv); + + // Give ourselves a max of 10 minutes for the tests. Sometimes (in automated + // builds) the unittesting bundle fails to load which causes the app to keep + // running forever. This will force it to exit after a certain amount of time + // instead of hanging running forever. + [GTMFoundationUnitTestingUtilities installTestingTimeout:10*60.0]; + + int result = NSApplicationMain(argc, (const char **) argv); + [pool drain]; + return result; } |