| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 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 Tests things related to ARCHS. | 8 Tests things related to ARCHS. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 test.run_gyp('test-archs-x86_64.gyp', chdir='archs') | 32 test.run_gyp('test-archs-x86_64.gyp', chdir='archs') |
| 33 test.build('test-archs-x86_64.gyp', test.ALL, chdir='archs') | 33 test.build('test-archs-x86_64.gyp', test.ALL, chdir='archs') |
| 34 result_file = test.built_file_path('Test64', chdir='archs') | 34 result_file = test.built_file_path('Test64', chdir='archs') |
| 35 test.must_exist(result_file) | 35 test.must_exist(result_file) |
| 36 TestMac.CheckFileType(test, result_file, ['x86_64']) | 36 TestMac.CheckFileType(test, result_file, ['x86_64']) |
| 37 | 37 |
| 38 if test.format != 'make': | 38 if test.format != 'make': |
| 39 # Build all targets except 'exe_32_64_no_sources' that does build | 39 # Build all targets except 'exe_32_64_no_sources' that does build |
| 40 # but should not cause error when generating ninja files | 40 # but should not cause error when generating ninja files |
| 41 targets = [ | 41 targets = [ |
| 42 'static_32_64', 'shared_32_64', 'module_32_64', 'exe_32_64', | 42 'static_32_64', 'shared_32_64', 'shared_32_64_bundle', |
| 43 'exe_32_64_bundle', 'precompiled_prefix_header_mm_32_64', | 43 'module_32_64', 'module_32_64_bundle', |
| 44 'exe_32_64', 'exe_32_64_bundle', 'precompiled_prefix_header_mm_32_64', |
| 44 ] | 45 ] |
| 45 | 46 |
| 46 test.run_gyp('test-archs-multiarch.gyp', chdir='archs') | 47 test.run_gyp('test-archs-multiarch.gyp', chdir='archs') |
| 47 for target in targets: | 48 for target in targets: |
| 48 test.build('test-archs-multiarch.gyp', target=target, chdir='archs') | 49 test.build('test-archs-multiarch.gyp', target=target, chdir='archs') |
| 49 | 50 |
| 50 result_file = test.built_file_path( | 51 result_file = test.built_file_path( |
| 51 'static_32_64', chdir='archs', type=test.STATIC_LIB) | 52 'static_32_64', chdir='archs', type=test.STATIC_LIB) |
| 52 test.must_exist(result_file) | 53 test.must_exist(result_file) |
| 53 TestMac.CheckFileType(test, result_file, ['i386', 'x86_64']) | 54 TestMac.CheckFileType(test, result_file, ['i386', 'x86_64']) |
| 54 | 55 |
| 55 result_file = test.built_file_path( | 56 result_file = test.built_file_path( |
| 56 'shared_32_64', chdir='archs', type=test.SHARED_LIB) | 57 'shared_32_64', chdir='archs', type=test.SHARED_LIB) |
| 57 test.must_exist(result_file) | 58 test.must_exist(result_file) |
| 58 TestMac.CheckFileType(test, result_file, ['i386', 'x86_64']) | 59 TestMac.CheckFileType(test, result_file, ['i386', 'x86_64']) |
| 59 | 60 |
| 61 result_file = test.built_file_path('My Framework.framework/My Framework', |
| 62 chdir='archs') |
| 63 test.must_exist(result_file) |
| 64 TestMac.CheckFileType(test, result_file, ['i386', 'x86_64']) |
| 65 # Check that symbol "_x" made it into both versions of the binary: |
| 66 if not all(['D _x' in subprocess.check_output( |
| 67 ['nm', '-arch', arch, result_file]) for arch in ['i386', 'x86_64']]): |
| 68 # This can only flakily fail, due to process ordering issues. If this |
| 69 # does fail flakily, then something's broken, it's not the test at fault. |
| 70 test.fail_test() |
| 71 |
| 60 result_file = test.built_file_path( | 72 result_file = test.built_file_path( |
| 61 'exe_32_64', chdir='archs', type=test.EXECUTABLE) | 73 'exe_32_64', chdir='archs', type=test.EXECUTABLE) |
| 62 test.must_exist(result_file) | 74 test.must_exist(result_file) |
| 63 TestMac.CheckFileType(test, result_file, ['i386', 'x86_64']) | 75 TestMac.CheckFileType(test, result_file, ['i386', 'x86_64']) |
| 64 | 76 |
| 65 result_file = test.built_file_path('Test App.app/Contents/MacOS/Test App', | 77 result_file = test.built_file_path('Test App.app/Contents/MacOS/Test App', |
| 66 chdir='archs') | 78 chdir='archs') |
| 67 test.must_exist(result_file) | 79 test.must_exist(result_file) |
| 68 TestMac.CheckFileType(test, result_file, ['i386', 'x86_64']) | 80 TestMac.CheckFileType(test, result_file, ['i386', 'x86_64']) |
| OLD | NEW |