OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2013 Google Inc. All rights reserved. | 3 # Copyright (c) 2013 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Verifies that xctest targets are correctly configured. | 8 Verifies that xcuitest targets are correctly configured. |
9 """ | 9 """ |
10 | 10 |
11 import TestGyp | 11 import TestGyp |
12 | 12 |
13 import sys | 13 import sys |
14 | 14 |
15 if sys.platform == 'darwin': | 15 if sys.platform == 'darwin': |
16 test = TestGyp.TestGyp(formats=['xcode']) | 16 test = TestGyp.TestGyp(formats=['xcode']) |
17 | 17 |
18 # Ignore this test if Xcode 5 is not installed | 18 # Ignore this test if Xcode 5 is not installed |
19 import subprocess | 19 import subprocess |
20 job = subprocess.Popen(['xcodebuild', '-version'], | 20 job = subprocess.Popen(['xcodebuild', '-version'], |
21 stdout=subprocess.PIPE, | 21 stdout=subprocess.PIPE, |
22 stderr=subprocess.STDOUT) | 22 stderr=subprocess.STDOUT) |
23 out, err = job.communicate() | 23 out, err = job.communicate() |
24 if job.returncode != 0: | 24 if job.returncode != 0: |
25 raise Exception('Error %d running xcodebuild' % job.returncode) | 25 raise Exception('Error %d running xcodebuild' % job.returncode) |
26 xcode_version, build_number = out.splitlines() | 26 xcode_version, build_number = out.splitlines() |
27 # Convert the version string from 'Xcode 5.0' to ['5','0']. | 27 # Convert the version string from 'Xcode 5.0' to ['5','0']. |
28 xcode_version = xcode_version.split()[-1].split('.') | 28 xcode_version = xcode_version.split()[-1].split('.') |
29 if xcode_version < ['5']: | 29 if xcode_version < ['7']: |
30 test.pass_test() | 30 test.pass_test() |
31 | 31 |
32 CHDIR = 'xctest' | 32 CHDIR = 'xcuitest' |
33 test.run_gyp('test.gyp', chdir=CHDIR) | 33 test.run_gyp('test.gyp', chdir=CHDIR) |
34 test.build('test.gyp', chdir=CHDIR, arguments=['-scheme', 'classes', 'test']) | 34 test.build('test.gyp', chdir=CHDIR, arguments=[ |
| 35 '-target', 'tests', |
| 36 '-sdk', 'iphonesimulator', |
| 37 ]) |
35 | 38 |
36 test.built_file_must_match('tests.xctest/Contents/Resources/resource.txt', | |
37 'foo\n', chdir=CHDIR) | |
38 test.pass_test() | 39 test.pass_test() |
OLD | NEW |