OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 7 """ |
| 8 Verifies that iOS XCTests can be built correctly. |
| 9 """ |
| 10 |
| 11 import TestGyp |
| 12 |
| 13 import os |
| 14 import subprocess |
| 15 import sys |
| 16 |
| 17 def HasCerts(): |
| 18 # Because the bots do not have certs, don't check them if there are no |
| 19 # certs available. |
| 20 proc = subprocess.Popen(['security','find-identity','-p', 'codesigning', |
| 21 '-v'], stdout=subprocess.PIPE) |
| 22 return "0 valid identities found" not in proc.communicate()[0].strip() |
| 23 |
| 24 if sys.platform == "darwin": |
| 25 test = TestGyp.TestGyp(formats=['xcode', 'ninja']) |
| 26 test.run_gyp('xctests.gyp') |
| 27 test_configs = ['Default'] |
| 28 # TODO(crbug.com/557418): Enable this once xcodebuild works for iOS devices. |
| 29 #if HasCerts() and test.format == 'xcode': |
| 30 # test_configs.append('Default-iphoneos') |
| 31 for config in test_configs: |
| 32 test.set_configuration(config) |
| 33 test.build('xctests.gyp', test.ALL) |
| 34 test.built_file_must_exist('app_under_test.app/app_under_test') |
| 35 test.built_file_must_exist('app_tests.xctest/app_tests') |
| 36 if 'ninja' in test.format: |
| 37 test.built_file_must_exist('obj/AppTests/app_tests.AppTests.i386.o') |
| 38 test.built_file_must_exist('obj/AppTests/app_tests.AppTests.x86_64.o') |
| 39 elif test.format == 'xcode': |
| 40 xcode_object_path = os.path.join('..', 'xctests.build', |
| 41 'Default-iphonesimulator', |
| 42 'app_tests.build', 'Objects-normal', |
| 43 '%s', 'AppTests.o') |
| 44 test.built_file_must_exist(xcode_object_path % 'i386') |
| 45 test.built_file_must_exist(xcode_object_path % 'x86_64') |
| 46 test.pass_test() |
OLD | NEW |