OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 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. |
| 6 |
| 7 """ |
| 8 Verifies that device and simulator bundles are built correctly. |
| 9 """ |
| 10 |
| 11 import plistlib |
| 12 import TestGyp |
| 13 import os |
| 14 import struct |
| 15 import subprocess |
| 16 import sys |
| 17 import tempfile |
| 18 |
| 19 |
| 20 def CheckFileType(file, expected): |
| 21 proc = subprocess.Popen(['lipo', '-info', file], stdout=subprocess.PIPE) |
| 22 o = proc.communicate()[0].strip() |
| 23 assert not proc.returncode |
| 24 if not expected in o: |
| 25 print 'File: Expected %s, got %s' % (expected, o) |
| 26 test.fail_test() |
| 27 |
| 28 |
| 29 if sys.platform == 'darwin': |
| 30 test = TestGyp.TestGyp() |
| 31 |
| 32 test.run_gyp('test-archs.gyp', chdir='app-bundle') |
| 33 test.set_configuration('Default') |
| 34 test.build('test-archs.gyp', test.ALL, chdir='app-bundle') |
| 35 |
| 36 for filename in ['Test No Archs', 'Test Archs i386', 'Test Archs x86_64']: |
| 37 result_file = test.built_file_path( |
| 38 '%s.bundle/%s' % (filename, filename), chdir='app-bundle') |
| 39 test.must_exist(result_file) |
| 40 |
| 41 expected = 'i386' |
| 42 if 'x86_64' in filename: |
| 43 expected = 'x86_64' |
| 44 CheckFileType(result_file, expected) |
| 45 |
| 46 test.pass_test() |
OLD | NEW |