Chromium Code Reviews| 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 | |
|
Nico
2013/11/25 19:39:07
2 newlines between toplevel things
sdefresne
2013/11/26 09:29:16
Done.
| |
| 28 if sys.platform == 'darwin': | |
| 29 test = TestGyp.TestGyp() | |
| 30 | |
| 31 test.run_gyp('test-archs.gyp', chdir='app-bundle') | |
| 32 test.set_configuration('Default') | |
| 33 test.build('test-archs.gyp', test.ALL, chdir='app-bundle') | |
| 34 | |
| 35 for filename in ['Test No Archs', 'Test Archs i386', 'Test Archs x86_64']: | |
| 36 result_file = test.built_file_path( | |
| 37 '%s.bundle/%s' % (filename, filename), chdir='app-bundle') | |
| 38 test.must_exist(result_file) | |
| 39 | |
| 40 expected = 'i386' | |
| 41 if 'x86_64' in filename: | |
| 42 expected = 'x86_64' | |
| 43 CheckFileType(result_file, expected) | |
| 44 | |
| 45 test.pass_test() | |
| OLD | NEW |