| 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 Verifies that toolsets are correctly applied | 8 Verifies that toolsets are correctly applied |
| 9 """ | 9 """ |
| 10 | 10 import os |
| 11 import sys |
| 11 import TestGyp | 12 import TestGyp |
| 12 | 13 |
| 13 # Multiple toolsets are currently only supported by the make generator. | 14 if sys.platform.startswith('linux'): |
| 14 test = TestGyp.TestGyp(formats=['make']) | |
| 15 | 15 |
| 16 test.run_gyp('toolsets.gyp') | 16 test = TestGyp.TestGyp(formats=['make', 'ninja']) |
| 17 | 17 |
| 18 test.build('toolsets.gyp', test.ALL) | 18 oldenv = os.environ.copy() |
| 19 try: |
| 20 os.environ['GYP_CROSSCOMPILE'] = '1' |
| 21 test.run_gyp('toolsets.gyp') |
| 22 finally: |
| 23 os.environ.clear() |
| 24 os.environ.update(oldenv) |
| 19 | 25 |
| 20 test.run_built_executable('host-main', stdout="Host\n") | 26 test.build('toolsets.gyp', test.ALL) |
| 21 test.run_built_executable('target-main', stdout="Target\n") | |
| 22 | 27 |
| 23 test.pass_test() | 28 test.run_built_executable('host-main', stdout="Host\nShared: Host\n") |
| 29 test.run_built_executable('target-main', stdout="Target\nShared: Target\n") |
| 30 |
| 31 test.pass_test() |
| OLD | NEW |