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
5 # found in the LICENSE file.
8 Verifies that device and simulator bundles are built correctly.
18 if sys.platform == 'darwin':
19 test = TestGyp.TestGyp(formats=['ninja', 'xcode'])
22 ('Default', 'TestArch32Bits', ['i386']),
23 ('Default-iphoneos', 'TestArch32Bits', ['armv7']),
26 if TestMac.Xcode.Version() < '0510':
28 ('Default', 'TestNoArchs', ['i386']),
29 ('Default-iphoneos', 'TestNoArchs', ['armv7'])])
31 if TestMac.Xcode.Version() >= '0500':
33 ('Default', 'TestArch64Bits', ['x86_64']),
34 ('Default', 'TestMultiArchs', ['i386', 'x86_64']),
35 ('Default-iphoneos', 'TestArch64Bits', ['arm64']),
36 ('Default-iphoneos', 'TestMultiArchs', ['armv7', 'arm64'])])
38 test.run_gyp('test-archs.gyp', chdir='app-bundle')
39 for configuration, target, archs in test_cases:
40 is_device_build = configuration.endswith('-iphoneos')
42 kwds = collections.defaultdict(list)
43 if test.format == 'xcode':
45 configuration, sdk = configuration.split('-')
46 kwds['arguments'].extend(['-sdk', sdk])
47 if TestMac.Xcode.Version() < '0500':
48 kwds['arguments'].extend(['-arch', archs[0]])
50 test.set_configuration(configuration)
51 filename = '%s.bundle/%s' % (target, target)
52 test.build('test-archs.gyp', target, chdir='app-bundle', **kwds)
53 result_file = test.built_file_path(filename, chdir='app-bundle')
55 test.must_exist(result_file)
56 TestMac.CheckFileType(test, result_file, archs)