| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2013 Google Inc. All rights reserved. | 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 | 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 Make sure the link order of object files is the same between msvs and ninja. | 8 Make sure the link order of object files is the same between msvs and ninja. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 from __future__ import print_function |
| 12 |
| 11 import TestGyp | 13 import TestGyp |
| 12 | 14 |
| 13 import sys | 15 import sys |
| 14 | 16 |
| 15 if sys.platform == 'win32': | 17 if sys.platform == 'win32': |
| 16 test = TestGyp.TestGyp(formats=['msvs', 'ninja']) | 18 test = TestGyp.TestGyp(formats=['msvs', 'ninja']) |
| 17 | 19 |
| 18 CHDIR = 'linker-flags' | 20 CHDIR = 'linker-flags' |
| 19 test.run_gyp('link-ordering.gyp', chdir=CHDIR) | 21 test.run_gyp('link-ordering.gyp', chdir=CHDIR) |
| 20 test.build('link-ordering.gyp', test.ALL, chdir=CHDIR) | 22 test.build('link-ordering.gyp', test.ALL, chdir=CHDIR) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 41 00401025: C3 ret | 43 00401025: C3 ret |
| 42 ?y@@YAHXZ: | 44 ?y@@YAHXZ: |
| 43 00401030: B8 02 00 00 00 mov eax,2 | 45 00401030: B8 02 00 00 00 mov eax,2 |
| 44 00401035: C3 ret | 46 00401035: C3 ret |
| 45 _main: | 47 _main: |
| 46 00401040: 33 C0 xor eax,eax | 48 00401040: 33 C0 xor eax,eax |
| 47 00401042: C3 ret | 49 00401042: C3 ret |
| 48 ''' | 50 ''' |
| 49 | 51 |
| 50 if expected_disasm_basic not in GetDisasm('test_ordering_exe.exe'): | 52 if expected_disasm_basic not in GetDisasm('test_ordering_exe.exe'): |
| 51 print GetDisasm('test_ordering_exe.exe') | 53 print(GetDisasm('test_ordering_exe.exe')) |
| 52 test.fail_test() | 54 test.fail_test() |
| 53 | 55 |
| 54 # Similar to above. The VS generator handles subdirectories differently. | 56 # Similar to above. The VS generator handles subdirectories differently. |
| 55 | 57 |
| 56 expected_disasm_subdirs = ''' | 58 expected_disasm_subdirs = ''' |
| 57 _mainCRTStartup: | 59 _mainCRTStartup: |
| 58 00401000: B8 05 00 00 00 mov eax,5 | 60 00401000: B8 05 00 00 00 mov eax,5 |
| 59 00401005: C3 ret | 61 00401005: C3 ret |
| 60 _main: | 62 _main: |
| 61 00401010: 33 C0 xor eax,eax | 63 00401010: 33 C0 xor eax,eax |
| 62 00401012: C3 ret | 64 00401012: C3 ret |
| 63 ?y@@YAHXZ: | 65 ?y@@YAHXZ: |
| 64 00401020: B8 02 00 00 00 mov eax,2 | 66 00401020: B8 02 00 00 00 mov eax,2 |
| 65 00401025: C3 ret | 67 00401025: C3 ret |
| 66 ?z@@YAHXZ: | 68 ?z@@YAHXZ: |
| 67 00401030: B8 03 00 00 00 mov eax,3 | 69 00401030: B8 03 00 00 00 mov eax,3 |
| 68 00401035: C3 ret | 70 00401035: C3 ret |
| 69 ''' | 71 ''' |
| 70 | 72 |
| 71 if expected_disasm_subdirs not in GetDisasm('test_ordering_subdirs.exe'): | 73 if expected_disasm_subdirs not in GetDisasm('test_ordering_subdirs.exe'): |
| 72 print GetDisasm('test_ordering_subdirs.exe') | 74 print(GetDisasm('test_ordering_subdirs.exe')) |
| 73 test.fail_test() | 75 test.fail_test() |
| 74 | 76 |
| 75 # Similar, but with directories mixed into folders (crt and main at the same | 77 # Similar, but with directories mixed into folders (crt and main at the same |
| 76 # level, but with a subdir in the middle). | 78 # level, but with a subdir in the middle). |
| 77 | 79 |
| 78 expected_disasm_subdirs_mixed = ''' | 80 expected_disasm_subdirs_mixed = ''' |
| 79 _mainCRTStartup: | 81 _mainCRTStartup: |
| 80 00401000: B8 05 00 00 00 mov eax,5 | 82 00401000: B8 05 00 00 00 mov eax,5 |
| 81 00401005: C3 ret | 83 00401005: C3 ret |
| 82 ?x@@YAHXZ: | 84 ?x@@YAHXZ: |
| 83 00401010: B8 01 00 00 00 mov eax,1 | 85 00401010: B8 01 00 00 00 mov eax,1 |
| 84 00401015: C3 ret | 86 00401015: C3 ret |
| 85 _main: | 87 _main: |
| 86 00401020: 33 C0 xor eax,eax | 88 00401020: 33 C0 xor eax,eax |
| 87 00401022: C3 ret | 89 00401022: C3 ret |
| 88 ?z@@YAHXZ: | 90 ?z@@YAHXZ: |
| 89 00401030: B8 03 00 00 00 mov eax,3 | 91 00401030: B8 03 00 00 00 mov eax,3 |
| 90 00401035: C3 ret | 92 00401035: C3 ret |
| 91 ?y@@YAHXZ: | 93 ?y@@YAHXZ: |
| 92 00401040: B8 02 00 00 00 mov eax,2 | 94 00401040: B8 02 00 00 00 mov eax,2 |
| 93 00401045: C3 ret | 95 00401045: C3 ret |
| 94 ''' | 96 ''' |
| 95 | 97 |
| 96 if (expected_disasm_subdirs_mixed not in | 98 if (expected_disasm_subdirs_mixed not in |
| 97 GetDisasm('test_ordering_subdirs_mixed.exe')): | 99 GetDisasm('test_ordering_subdirs_mixed.exe')): |
| 98 print GetDisasm('test_ordering_subdirs_mixed.exe') | 100 print(GetDisasm('test_ordering_subdirs_mixed.exe')) |
| 99 test.fail_test() | 101 test.fail_test() |
| 100 | 102 |
| 101 test.pass_test() | 103 test.pass_test() |
| OLD | NEW |