PageRenderTime 25ms CodeModel.GetById 13ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://macfuse.googlecode.com/
Objective C | 48 lines | 24 code | 2 blank | 22 comment | 1 complexity | db50c91b3f40817fe703b0098035fe42 MD5 | raw file
 1//
 2//  GTMIPhoneUnitTestMain.m
 3//
 4//  Copyright 2008 Google Inc.
 5//
 6//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
 7//  use this file except in compliance with the License.  You may obtain a copy
 8//  of the License at
 9//
10//  http://www.apache.org/licenses/LICENSE-2.0
11//
12//  Unless required by applicable law or agreed to in writing, software
13//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
15//  License for the specific language governing permissions and limitations under
16//  the License.
17//
18
19#import "GTMDefines.h"
20#if !GTM_IPHONE_SDK
21  #error GTMIPhoneUnitTestMain for iPhone only
22#endif
23#import <UIKit/UIKit.h>
24
25// Creates an application that runs all tests from classes extending
26// SenTestCase, outputs results and test run time, and terminates right
27// afterwards.
28int main(int argc, char *argv[]) {
29  int retVal;
30#if __has_feature(objc_arc)
31  @autoreleasepool {
32#else
33  NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
34#endif
35#if GTM_IPHONE_USE_SENTEST
36  // Is using SenTest, just create a dummy app that can be used as the
37  // TEST_HOST.
38  retVal = UIApplicationMain(argc, argv, nil, nil);
39#else
40  retVal = UIApplicationMain(argc, argv, nil, @"GTMIPhoneUnitTestDelegate");
41#endif
42#if __has_feature(objc_arc)
43  }
44#else
45  [pool release];
46#endif
47  return retVal;
48}