OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
2 | |
3 # Copyright (c) 2011 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 Tests things related to ARCHS. | |
9 """ | |
10 | |
11 import TestGyp | |
12 | |
13 import subprocess | |
14 import sys | |
15 | |
16 if sys.platform == 'darwin': | |
17 def CheckFileType(file, expected): | |
18 proc = subprocess.Popen(['file', '-b', file], stdout=subprocess.PIPE) | |
19 o = proc.communicate()[0].strip() | |
20 assert not proc.returncode | |
21 if o != expected: | |
22 print 'File: Expected %s, got %s' % (expected, o) | |
23 test.fail_test() | |
Nico
2012/02/14 06:25:46
Is test in scope here?
ukai
2012/02/14 06:38:39
move L25 before def CheckFileType
| |
24 | |
25 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) | |
26 | |
Nico
2012/02/14 06:25:46
Nit: 2 space indent
ukai
2012/02/14 06:38:39
Done.
| |
27 test.run_gyp('test-no-archs.gyp', chdir='archs') | |
28 test.build('test-no-archs.gyp', test.ALL, chdir='archs') | |
29 result_file = test.built_file_path('Test', chdir='archs') | |
30 test.must_exist(result_file) | |
31 CheckFileType(result_file, 'Mach-O executable i386') | |
32 | |
33 test.run_gyp('test-archs-x86_64.gyp', chdir='archs') | |
34 test.build('test-archs-x86_64.gyp', test.ALL, chdir='archs') | |
35 result_file = test.built_file_path('Test64', chdir='archs') | |
36 test.must_exist(result_file) | |
37 CheckFileType(result_file, 'Mach-O 64-bit executable x86_64') | |
OLD | NEW |