| 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) 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 Verifies build of an executable in three different configurations. | 8 Verifies build of an executable in three different configurations. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import TestGyp | 11 import TestGyp |
| 12 | 12 |
| 13 test = TestGyp.TestGyp(formats=['msvs']) | 13 import sys |
| 14 |
| 15 formats = ['msvs'] |
| 16 if sys.platform == 'win32': |
| 17 formats += ['ninja'] |
| 18 test = TestGyp.TestGyp(formats=formats) |
| 14 | 19 |
| 15 test.run_gyp('configurations.gyp') | 20 test.run_gyp('configurations.gyp') |
| 21 test.set_configuration('Debug|Win32') |
| 22 test.build('configurations.gyp', test.ALL) |
| 16 | 23 |
| 17 for platform in ['Win32', 'x64']: | 24 for machine, suffix in [('14C machine (x86)', ''), |
| 18 test.set_configuration('Debug|%s' % platform) | 25 ('8664 machine (x64)', '64')]: |
| 19 test.build('configurations.gyp', rebuild=True) | 26 output = test.run_dumpbin( |
| 20 try: | 27 '/headers', test.built_file_path('configurations%s.exe' % suffix)) |
| 21 test.run_built_executable('configurations', | 28 if machine not in output: |
| 22 stdout=('Running %s\n' % platform)) | 29 test.fail_test() |
| 23 except WindowsError, e: | |
| 24 # Assume the exe is 64-bit if it can't load on 32-bit systems. | |
| 25 if platform == 'x64' and (e.errno == 193 or '[Error 193]' in str(e)): | |
| 26 continue | |
| 27 raise | |
| 28 | 30 |
| 29 test.pass_test() | 31 test.pass_test() |
| OLD | NEW |