diff options
Diffstat (limited to 'third_party/python/gyp/test/mac/xcuitest')
7 files changed, 155 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/mac/xcuitest/Info.plist b/third_party/python/gyp/test/mac/xcuitest/Info.plist new file mode 100644 index 0000000000..ae8852b836 --- /dev/null +++ b/third_party/python/gyp/test/mac/xcuitest/Info.plist @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIconFile</key> + <string></string> + <key>CFBundleIdentifier</key> + <string>com.yourcompany.${PRODUCT_NAME}</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>BNDL</string> + <key>CFBundleShortVersionString</key> + <string>1.0</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1</string> + <key>NSPrincipalClass</key> + <string></string> +</dict> +</plist> diff --git a/third_party/python/gyp/test/mac/xcuitest/MyAppDelegate.h b/third_party/python/gyp/test/mac/xcuitest/MyAppDelegate.h new file mode 100644 index 0000000000..445be2cb42 --- /dev/null +++ b/third_party/python/gyp/test/mac/xcuitest/MyAppDelegate.h @@ -0,0 +1,8 @@ +// Copyright (c) 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import <UIKit/UIKit.h> + +@interface MyAppDelegate : NSObject<UIApplicationDelegate> +@end diff --git a/third_party/python/gyp/test/mac/xcuitest/MyAppDelegate.m b/third_party/python/gyp/test/mac/xcuitest/MyAppDelegate.m new file mode 100644 index 0000000000..6ad60fa9d4 --- /dev/null +++ b/third_party/python/gyp/test/mac/xcuitest/MyAppDelegate.m @@ -0,0 +1,19 @@ +// Copyright (c) 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "MyAppDelegate.h" + + +@implementation MyAppDelegate +@synthesize window; + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + self.window = [[UIWindow alloc] init]; + self.window.rootViewController = [[UIViewController alloc] init]; + [self.window makeKeyAndVisible]; + return YES; +} + +@end diff --git a/third_party/python/gyp/test/mac/xcuitest/TestCase.m b/third_party/python/gyp/test/mac/xcuitest/TestCase.m new file mode 100644 index 0000000000..1f32b7af74 --- /dev/null +++ b/third_party/python/gyp/test/mac/xcuitest/TestCase.m @@ -0,0 +1,15 @@ +// Copyright (c) 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import <XCTest/XCTest.h> + +@interface TestCase : XCTestCase +@end + +@implementation TestCase +- (void)testFoo { + XCUIApplication *foo = [[XCUIApplication alloc] init]; + XCTAssertNotNil(foo, @"expected non-nil object"); +} +@end diff --git a/third_party/python/gyp/test/mac/xcuitest/main.m b/third_party/python/gyp/test/mac/xcuitest/main.m new file mode 100644 index 0000000000..e7cb62e639 --- /dev/null +++ b/third_party/python/gyp/test/mac/xcuitest/main.m @@ -0,0 +1,15 @@ +// Copyright (c) 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import <UIKit/UIKit.h> + +#import "MyAppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + UIApplicationMain(argc, argv, + nil, NSStringFromClass([MyAppDelegate class])); + } + return 1; +} diff --git a/third_party/python/gyp/test/mac/xcuitest/resource.txt b/third_party/python/gyp/test/mac/xcuitest/resource.txt new file mode 100644 index 0000000000..257cc5642c --- /dev/null +++ b/third_party/python/gyp/test/mac/xcuitest/resource.txt @@ -0,0 +1 @@ +foo diff --git a/third_party/python/gyp/test/mac/xcuitest/test.gyp b/third_party/python/gyp/test/mac/xcuitest/test.gyp new file mode 100644 index 0000000000..80cdf9032d --- /dev/null +++ b/third_party/python/gyp/test/mac/xcuitest/test.gyp @@ -0,0 +1,69 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'target_defaults': { + 'xcode_settings': { + 'SDKROOT': 'iphoneos', + 'FRAMEWORK_SEARCH_PATHS': [ + '$(inherited)', + '$(DEVELOPER_FRAMEWORKS_DIR)', + ], + 'OTHER_LDFLAGS': [ + '$(inherited)', + '-ObjC', + ], + 'GCC_PREFIX_HEADER': '', + 'CLANG_ENABLE_OBJC_ARC': 'YES', + 'INFOPLIST_FILE': 'Info.plist', + }, + }, + 'targets': [ + { + 'target_name': 'testApp', + 'type': 'executable', + 'mac_bundle': 1, + 'sources': [ + 'MyAppDelegate.h', + 'MyAppDelegate.m', + 'main.m', + ], + 'link_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', + '$(SDKROOT)/System/Library/Frameworks/UIKit.framework', + ], + }, + }, + { + 'target_name': 'tests', + 'type': 'loadable_module', + 'mac_bundle': 1, + 'mac_xcuitest_bundle': 1, + 'sources': [ + 'TestCase.m', + ], + 'dependencies': [ + 'testApp', + ], + 'mac_bundle_resources': [ + 'resource.txt', + ], + 'variables': { + # This must *not* be set for xctest ui tests. + 'xctest_host': '', + }, + 'link_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/XCTest.framework', + ] + }, + 'xcode_settings': { + 'WRAPPER_EXTENSION': 'xctest', + 'TEST_TARGET_NAME': 'testApp', + }, + }, + ], +} + |