summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-09 14:41:14 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-09 14:41:14 +0000
commit17f7c434cec5d070b2f91720815c3341d5492f45 (patch)
tree2ddb1e48eccd44c7af5d5248c274e8b3c27db413 /testing
parentd35cb97ec47e8dac1416a87a930703b8bcc50800 (diff)
downloadchromium_src-17f7c434cec5d070b2f91720815c3341d5492f45.zip
chromium_src-17f7c434cec5d070b2f91720815c3341d5492f45.tar.gz
chromium_src-17f7c434cec5d070b2f91720815c3341d5492f45.tar.bz2
Make all gtest targets into bundles on iOS
The raw 'executable' type maps to the .tool Apple product-type, which doesn't exist on iOS. Make each unit test a bundle instead. BUG=None TEST=None Review URL: https://chromiumcodereview.appspot.com/10704121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing')
-rw-r--r--testing/gtest.gyp43
-rw-r--r--testing/gtest_ios/unittest-Info.plist32
2 files changed, 73 insertions, 2 deletions
diff --git a/testing/gtest.gyp b/testing/gtest.gyp
index 78b3ce2..b01c694 100644
--- a/testing/gtest.gyp
+++ b/testing/gtest.gyp
@@ -1,4 +1,4 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Copyright (c) 2012 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.
@@ -51,7 +51,7 @@
'gtest_prod',
],
'conditions': [
- ['OS == "mac"', {
+ ['OS == "mac" or OS == "ios"', {
'sources': [
'gtest_mac.h',
'gtest_mac.mm',
@@ -63,6 +63,34 @@
],
},
}],
+ ['OS == "ios"', {
+ 'direct_dependent_settings': {
+ 'target_conditions': [
+ # Turn all tests into bundles on iOS because that's the only
+ # type of executable supported for iOS.
+ ['_type=="executable"', {
+ 'variables': {
+ # Use a variable so the path gets fixed up so it is always
+ # correct when INFOPLIST_FILE finally gets set.
+ 'ios_unittest_info_plist_path':
+ '<(DEPTH)/testing/gtest_ios/unittest-Info.plist',
+ },
+ 'mac_bundle': 1,
+ 'xcode_settings': {
+ 'BUNDLE_ID_TEST_NAME':
+ '>!(echo ">(_target_name)" | sed -e "s/_//g")',
+ 'INFOPLIST_FILE': '>(ios_unittest_info_plist_path)',
+ },
+ 'mac_bundle_resources': [
+ '<(ios_unittest_info_plist_path)',
+ ],
+ 'mac_bundle_resources!': [
+ '<(ios_unittest_info_plist_path)',
+ ],
+ }],
+ ],
+ },
+ }],
['os_posix == 1', {
'defines': [
# gtest isn't able to figure out when RTTI is disabled for gcc
@@ -111,6 +139,17 @@
'action????': ['${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}'],
},
}],
+ ['OS=="ios"', {
+ 'variables': {
+ # Use a variable so the path gets fixed up so it is always
+ # correct when the action finally gets used.
+ 'ios_run_unittest_script_path':
+ '<(DEPTH)/testing/gtest_ios/RunUnittest.sh',
+ },
+ 'run_as': {
+ 'action????': ['>(ios_run_unittest_script_path)'],
+ },
+ }],
['OS=="win"', {
'run_as': {
'action????': ['$(TargetPath)', '--gtest_print_time'],
diff --git a/testing/gtest_ios/unittest-Info.plist b/testing/gtest_ios/unittest-Info.plist
new file mode 100644
index 0000000..fc21034
--- /dev/null
+++ b/testing/gtest_ios/unittest-Info.plist
@@ -0,0 +1,32 @@
+<?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>CFBundleDisplayName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.google.gtest.${BUNDLE_ID_TEST_NAME}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>LSRequiresIPhoneOS</key>
+ <true/>
+ <key>UISupportedInterfaceOrientation</key>
+ <array>
+ <string>UIInterfaceOrientationPortrait</string>
+ <string>UIInterfaceOrientationLandscapeLeft</string>
+ <string>UIInterfaceOrientationLandscapeRight</string>
+ </array>
+</dict>
+</plist>