1 #!/usr/bin/env python 2 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 5 # found in the LICENSE file. 6 7 """ 8 Tests the msvs specific msvs_target_platform option. 9 """ 10 11 import TestGyp 12 import TestCommon 13 14 15 def RunX64(exe, stdout): 16 try: 17 test.run_built_executable(exe, stdout=stdout) 18 except WindowsError, e: 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 21 # of python seem to return different errors for invalid exe type. 22 if e.errno != 193 and '[Error 193]' not in str(e): 23 raise 24 25 26 test = TestGyp.TestGyp(formats=['msvs']) 27 28 test.run_gyp('configurations.gyp') 29 30 test.set_configuration('Debug|x64') 31 test.build('configurations.gyp', rebuild=True) 32 RunX64('front_left', stdout=('left\n')) 33 RunX64('front_right', stdout=('right\n')) 34 35 test.set_configuration('Debug|Win32') 36 test.build('configurations.gyp', rebuild=True) 37 RunX64('front_left', stdout=('left\n')) 38 test.run_built_executable('front_right', stdout=('right\n')) 39 40 test.pass_test() 41