/core/externals/update-engine/externals/google-toolbox-for-mac/UnitTesting/GTMUIUnitTestingHarness/main.m

http://macfuse.googlecode.com/ · Objective C · 39 lines · 11 code · 6 blank · 22 comment · 0 complexity · a9775a4fb9aecc6cacfe95b610935e89 MD5 · raw file

  1. //
  2. // main.m
  3. // GTMUnitTestingTest
  4. //
  5. // Copyright 2006-2008 Google Inc.
  6. //
  7. // Licensed under the Apache License, Version 2.0 (the "License"); you may not
  8. // use this file except in compliance with the License. You may obtain a copy
  9. // of the License at
  10. //
  11. // http://www.apache.org/licenses/LICENSE-2.0
  12. //
  13. // Unless required by applicable law or agreed to in writing, software
  14. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. // License for the specific language governing permissions and limitations under
  17. // the License.
  18. //
  19. #import <Cocoa/Cocoa.h>
  20. #import "GTMAppKitUnitTestingUtilities.h"
  21. #import "GTMFoundationUnitTestingUtilities.h"
  22. int main(int argc, char *argv[]) {
  23. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  24. [GTMAppKitUnitTestingUtilities setUpForUIUnitTestsIfBeingTested];
  25. // Give ourselves a max of 10 minutes for the tests. Sometimes (in automated
  26. // builds) the unittesting bundle fails to load which causes the app to keep
  27. // running forever. This will force it to exit after a certain amount of time
  28. // instead of hanging running forever.
  29. [GTMFoundationUnitTestingUtilities installTestingTimeout:10*60.0];
  30. int result = NSApplicationMain(argc, (const char **) argv);
  31. [pool drain];
  32. return result;
  33. }