summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/ios/xctests
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/python/gyp/test/ios/xctests')
-rw-r--r--third_party/python/gyp/test/ios/xctests/App/AppDelegate.h11
-rw-r--r--third_party/python/gyp/test/ios/xctests/App/AppDelegate.m18
-rw-r--r--third_party/python/gyp/test/ios/xctests/App/Base.lproj/LaunchScreen.xib41
-rw-r--r--third_party/python/gyp/test/ios/xctests/App/Base.lproj/Main.storyboard25
-rw-r--r--third_party/python/gyp/test/ios/xctests/App/Images.xcassets/AppIcon.appiconset/Contents.json68
-rw-r--r--third_party/python/gyp/test/ios/xctests/App/Info.plist47
-rw-r--r--third_party/python/gyp/test/ios/xctests/App/ViewController.h9
-rw-r--r--third_party/python/gyp/test/ios/xctests/App/ViewController.m21
-rw-r--r--third_party/python/gyp/test/ios/xctests/App/main.m13
-rw-r--r--third_party/python/gyp/test/ios/xctests/AppTests/AppTests.m31
-rw-r--r--third_party/python/gyp/test/ios/xctests/AppTests/Info.plist24
-rw-r--r--third_party/python/gyp/test/ios/xctests/gyptest-xctests.py49
-rw-r--r--third_party/python/gyp/test/ios/xctests/xctests.gyp74
13 files changed, 431 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/ios/xctests/App/AppDelegate.h b/third_party/python/gyp/test/ios/xctests/App/AppDelegate.h
new file mode 100644
index 0000000000..f8efce97ed
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/App/AppDelegate.h
@@ -0,0 +1,11 @@
+// Copyright 2015 The Chromium Authors. 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 AppDelegate : UIResponder<UIApplicationDelegate>
+
+@property(strong, nonatomic) UIWindow* window;
+
+@end
diff --git a/third_party/python/gyp/test/ios/xctests/App/AppDelegate.m b/third_party/python/gyp/test/ios/xctests/App/AppDelegate.m
new file mode 100644
index 0000000000..825dda75b7
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/App/AppDelegate.m
@@ -0,0 +1,18 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "AppDelegate.h"
+
+@interface AppDelegate ()
+
+@end
+
+@implementation AppDelegate
+
+- (BOOL)application:(UIApplication*)application
+ didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
+ return YES;
+}
+
+@end
diff --git a/third_party/python/gyp/test/ios/xctests/App/Base.lproj/LaunchScreen.xib b/third_party/python/gyp/test/ios/xctests/App/Base.lproj/LaunchScreen.xib
new file mode 100644
index 0000000000..063dc5ea79
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/App/Base.lproj/LaunchScreen.xib
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
+ <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
+ </dependencies>
+ <objects>
+ <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+ <view contentMode="scaleToFill" id="iN0-l3-epB">
+ <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2014 Google. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
+ <rect key="frame" x="20" y="439" width="441" height="21"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="App" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
+ <rect key="frame" x="20" y="140" width="441" height="43"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ <constraints>
+ <constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
+ <constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
+ <constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
+ <constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
+ <constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
+ <constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
+ </constraints>
+ <nil key="simulatedStatusBarMetrics"/>
+ <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+ <point key="canvasLocation" x="548" y="455"/>
+ </view>
+ </objects>
+</document>
diff --git a/third_party/python/gyp/test/ios/xctests/App/Base.lproj/Main.storyboard b/third_party/python/gyp/test/ios/xctests/App/Base.lproj/Main.storyboard
new file mode 100644
index 0000000000..f56d2f3bb5
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/App/Base.lproj/Main.storyboard
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
+ </dependencies>
+ <scenes>
+ <!--View Controller-->
+ <scene sceneID="tne-QT-ifu">
+ <objects>
+ <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
+ <layoutGuides>
+ <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
+ <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
+ </layoutGuides>
+ <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+ <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ </viewController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+ </objects>
+ </scene>
+ </scenes>
+</document>
diff --git a/third_party/python/gyp/test/ios/xctests/App/Images.xcassets/AppIcon.appiconset/Contents.json b/third_party/python/gyp/test/ios/xctests/App/Images.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 0000000000..36d2c80d88
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/App/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,68 @@
+{
+ "images" : [
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "29x29",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "40x40",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "iphone",
+ "size" : "60x60",
+ "scale" : "3x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "29x29",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "40x40",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "ipad",
+ "size" : "76x76",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+} \ No newline at end of file
diff --git a/third_party/python/gyp/test/ios/xctests/App/Info.plist b/third_party/python/gyp/test/ios/xctests/App/Info.plist
new file mode 100644
index 0000000000..3f938f60f4
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/App/Info.plist
@@ -0,0 +1,47 @@
+<?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>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.google.gyptest.App</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UILaunchStoryboardName</key>
+ <string>LaunchScreen</string>
+ <key>UIMainStoryboardFile</key>
+ <string>Main</string>
+ <key>UIRequiredDeviceCapabilities</key>
+ <array>
+ <string>armv7</string>
+ </array>
+ <key>UISupportedInterfaceOrientations</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+ <key>UISupportedInterfaceOrientations~ipad</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>
diff --git a/third_party/python/gyp/test/ios/xctests/App/ViewController.h b/third_party/python/gyp/test/ios/xctests/App/ViewController.h
new file mode 100644
index 0000000000..95a281e8d8
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/App/ViewController.h
@@ -0,0 +1,9 @@
+// Copyright 2015 The Chromium Authors. 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 ViewController : UIViewController
+
+@end
diff --git a/third_party/python/gyp/test/ios/xctests/App/ViewController.m b/third_party/python/gyp/test/ios/xctests/App/ViewController.m
new file mode 100644
index 0000000000..d38e3c5bb7
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/App/ViewController.m
@@ -0,0 +1,21 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ViewController.h"
+
+@interface ViewController ()
+
+@end
+
+@implementation ViewController
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+}
+
+- (void)didReceiveMemoryWarning {
+ [super didReceiveMemoryWarning];
+}
+
+@end
diff --git a/third_party/python/gyp/test/ios/xctests/App/main.m b/third_party/python/gyp/test/ios/xctests/App/main.m
new file mode 100644
index 0000000000..83368075cd
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/App/main.m
@@ -0,0 +1,13 @@
+// Copyright 2015 The Chromium Authors. 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 "AppDelegate.h"
+
+int main(int argc, char* argv[]) {
+ @autoreleasepool {
+ return UIApplicationMain(
+ argc, argv, nil, NSStringFromClass([AppDelegate class]));
+ }
+}
diff --git a/third_party/python/gyp/test/ios/xctests/AppTests/AppTests.m b/third_party/python/gyp/test/ios/xctests/AppTests/AppTests.m
new file mode 100644
index 0000000000..22121b089d
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/AppTests/AppTests.m
@@ -0,0 +1,31 @@
+// Copyright 2015 The Chromium Authors. 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 <XCTest/XCTest.h>
+
+@interface AppTests : XCTestCase
+
+@end
+
+@implementation AppTests
+
+- (void)setUp {
+ [super setUp];
+}
+
+- (void)tearDown {
+ [super tearDown];
+}
+
+- (void)testExample {
+ XCTAssert(YES, @"Pass");
+}
+
+- (void)testPerformanceExample {
+ [self measureBlock:^{
+ }];
+}
+
+@end
diff --git a/third_party/python/gyp/test/ios/xctests/AppTests/Info.plist b/third_party/python/gyp/test/ios/xctests/AppTests/Info.plist
new file mode 100644
index 0000000000..d43ff4ba8d
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/AppTests/Info.plist
@@ -0,0 +1,24 @@
+<?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>en</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.google.gyptest.AppTests</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>
+</dict>
+</plist>
diff --git a/third_party/python/gyp/test/ios/xctests/gyptest-xctests.py b/third_party/python/gyp/test/ios/xctests/gyptest-xctests.py
new file mode 100644
index 0000000000..6642cfb938
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/gyptest-xctests.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+
+# Copyright 2015 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.
+
+"""
+Verifies that iOS XCTests can be built correctly.
+"""
+
+import TestGyp
+
+import os
+import subprocess
+import sys
+
+def HasCerts():
+ # Because the bots do not have certs, don't check them if there are no
+ # certs available.
+ proc = subprocess.Popen(['security','find-identity','-p', 'codesigning',
+ '-v'], stdout=subprocess.PIPE)
+ return "0 valid identities found" not in proc.communicate()[0].strip()
+
+if sys.platform == "darwin":
+ # This test appears to be flaky and hangs some of the time.
+ sys.exit(2) # bug=531
+
+ test = TestGyp.TestGyp(formats=['xcode', 'ninja'])
+ test.run_gyp('xctests.gyp')
+ test_configs = ['Default']
+ # TODO(crbug.com/557418): Enable this once xcodebuild works for iOS devices.
+ #if HasCerts() and test.format == 'xcode':
+ # test_configs.append('Default-iphoneos')
+ for config in test_configs:
+ test.set_configuration(config)
+ test.build('xctests.gyp', test.ALL)
+ test.built_file_must_exist('app_under_test.app/app_under_test')
+ test.built_file_must_exist('app_tests.xctest/app_tests')
+ if 'ninja' in test.format:
+ test.built_file_must_exist('obj/AppTests/app_tests.AppTests.i386.o')
+ test.built_file_must_exist('obj/AppTests/app_tests.AppTests.x86_64.o')
+ elif test.format == 'xcode':
+ xcode_object_path = os.path.join('..', 'xctests.build',
+ 'Default-iphonesimulator',
+ 'app_tests.build', 'Objects-normal',
+ '%s', 'AppTests.o')
+ test.built_file_must_exist(xcode_object_path % 'i386')
+ test.built_file_must_exist(xcode_object_path % 'x86_64')
+ test.pass_test()
diff --git a/third_party/python/gyp/test/ios/xctests/xctests.gyp b/third_party/python/gyp/test/ios/xctests/xctests.gyp
new file mode 100644
index 0000000000..8d4d6393b7
--- /dev/null
+++ b/third_party/python/gyp/test/ios/xctests/xctests.gyp
@@ -0,0 +1,74 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'conditions': [
+ ['"<(GENERATOR)"=="ninja"', {
+ 'make_global_settings': [
+ ['CC', '/usr/bin/clang'],
+ ['CXX', '/usr/bin/clang++'],
+ ],
+ }]
+ ],
+ 'target_defaults': {
+ 'xcode_settings': {
+ 'OTHER_CFLAGS': [
+ '-fobjc-abi-version=2',
+ ],
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'SDKROOT': 'iphonesimulator', # -isysroot
+ 'CONFIGURATION_BUILD_DIR':'build/Default',
+ 'IPHONEOS_DEPLOYMENT_TARGET': '9.0',
+ 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': 'iPhone Developer',
+ }
+ },
+ 'targets': [
+ {
+ 'target_name': 'app_under_test',
+ 'type': 'executable',
+ 'mac_bundle': 1,
+ 'mac_bundle_resources': [
+ 'App/Base.lproj/LaunchScreen.xib',
+ 'App/Base.lproj/Main.storyboard',
+ ],
+ 'sources': [
+ 'App/AppDelegate.h',
+ 'App/AppDelegate.m',
+ 'App/ViewController.h',
+ 'App/ViewController.m',
+ 'App/main.m',
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
+ '$(SDKROOT)/System/Library/Frameworks/UIKit.framework',
+ ],
+ },
+ 'xcode_settings': {
+ 'INFOPLIST_FILE': 'App/Info.plist',
+ },
+ },
+ {
+ 'target_name': 'app_tests',
+ 'type': 'loadable_module',
+ 'mac_xctest_bundle': 1,
+ 'sources': [
+ 'AppTests/AppTests.m',
+ ],
+ 'dependencies': [
+ 'app_under_test'
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
+ ],
+ },
+ 'xcode_settings': {
+ 'WRAPPER_EXTENSION': 'xctest',
+ 'INFOPLIST_FILE': 'AppTests/Info.plist',
+ 'BUNDLE_LOADER': '$(BUILT_PRODUCTS_DIR)/app_under_test.app/app_under_test',
+ 'TEST_HOST': '$(BUNDLE_LOADER)',
+ },
+ },
+ ],
+}