diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-06-14 12:33:42 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-06-14 12:33:42 +0000 |
commit | 0ad683cc4d69e6571975ca81a7ea3615358fcf1e (patch) | |
tree | 2e16e7e4cc3cb0abd133edc713b8847e3b8c4ed0 /UnitTesting/GTMUIUnitTestingHarness | |
parent | 93958773a78716c0c048b5657514d9518a549a19 (diff) |
[Author: thomasvl]
Add a api to catching when a test binary is left running too long.
Wire up said api into the testing harness used to GTMs tests.
R=dmaclach
DELTA=40 (39 added, 0 deleted, 1 changed)
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; } |