| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2009 Google Inc. All rights reserved. | 3 # Copyright (c) 2009 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 the msvs specific msvs_target_platform option. | 8 Tests the msvs specific msvs_target_platform option. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import TestGyp | 11 import TestGyp |
| 12 import TestCommon | 12 import TestCommon |
| 13 | 13 |
| 14 | 14 |
| 15 def RunX64(exe, stdout): | 15 def RunX64(exe, stdout): |
| 16 try: | 16 try: |
| 17 test.run_built_executable(exe, stdout=stdout) | 17 test.run_built_executable(exe, stdout=stdout) |
| 18 except WindowsError, e: | 18 except WindowsError as e: |
| 19 # Assume the exe is 64-bit if it can't load on 32-bit systems. | 19 # Assume the exe is 64-bit if it can't load on 32-bit systems. |
| 20 # Both versions of the error are required because different versions | 20 # Both versions of the error are required because different versions |
| 21 # of python seem to return different errors for invalid exe type. | 21 # of python seem to return different errors for invalid exe type. |
| 22 if e.errno != 193 and '[Error 193]' not in str(e): | 22 if e.errno != 193 and '[Error 193]' not in str(e): |
| 23 raise | 23 raise |
| 24 | 24 |
| 25 | 25 |
| 26 test = TestGyp.TestGyp(formats=['msvs']) | 26 test = TestGyp.TestGyp(formats=['msvs']) |
| 27 | 27 |
| 28 test.run_gyp('configurations.gyp') | 28 test.run_gyp('configurations.gyp') |
| 29 | 29 |
| 30 test.set_configuration('Debug|x64') | 30 test.set_configuration('Debug|x64') |
| 31 test.build('configurations.gyp', rebuild=True) | 31 test.build('configurations.gyp', rebuild=True) |
| 32 RunX64('front_left', stdout=('left\n')) | 32 RunX64('front_left', stdout=('left\n')) |
| 33 RunX64('front_right', stdout=('right\n')) | 33 RunX64('front_right', stdout=('right\n')) |
| 34 | 34 |
| 35 test.set_configuration('Debug|Win32') | 35 test.set_configuration('Debug|Win32') |
| 36 test.build('configurations.gyp', rebuild=True) | 36 test.build('configurations.gyp', rebuild=True) |
| 37 RunX64('front_left', stdout=('left\n')) | 37 RunX64('front_left', stdout=('left\n')) |
| 38 test.run_built_executable('front_right', stdout=('right\n')) | 38 test.run_built_executable('front_right', stdout=('right\n')) |
| 39 | 39 |
| 40 test.pass_test() | 40 test.pass_test() |
| OLD | NEW |