| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2014 Google Inc. All rights reserved. | 3 # Copyright (c) 2014 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 'AR' in make_global_settings. | 8 Verifies 'AR' in make_global_settings. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 test.fail_test() | 49 test.fail_test() |
| 50 | 50 |
| 51 | 51 |
| 52 def verify_ar_host(test, ar=None, rel_path=False): | 52 def verify_ar_host(test, ar=None, rel_path=False): |
| 53 if rel_path: | 53 if rel_path: |
| 54 ar_expected = resolve_path(test, ar) | 54 ar_expected = resolve_path(test, ar) |
| 55 else: | 55 else: |
| 56 ar_expected = ar | 56 ar_expected = ar |
| 57 # Resolve default values | 57 # Resolve default values |
| 58 if ar_expected is None: | 58 if ar_expected is None: |
| 59 ar_expected = 'ar' | 59 if sys.platform == 'win32': |
| 60 ar_expected = 'lib.exe' |
| 61 else: |
| 62 ar_expected = 'ar' |
| 60 if test.format == 'make': | 63 if test.format == 'make': |
| 61 test.must_contain('Makefile', 'AR.host ?= %s' % ar_expected) | 64 test.must_contain('Makefile', 'AR.host ?= %s' % ar_expected) |
| 62 elif test.format in ['ninja', 'xcode-ninja']: | 65 elif test.format in ['ninja', 'xcode-ninja']: |
| 63 test.must_contain('out/Default/build.ninja', 'ar_host = %s' % ar_expected) | 66 test.must_contain('out/Default/build.ninja', 'ar_host = %s' % ar_expected) |
| 64 else: | 67 else: |
| 65 test.fail_test() | 68 test.fail_test() |
| 66 | 69 |
| 67 | 70 |
| 68 test_format = ['ninja'] | 71 test_format = ['ninja'] |
| 69 if sys.platform in ('linux2', 'darwin'): | 72 if sys.platform in ('linux2', 'darwin'): |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 117 |
| 115 # Test 'AR' in 'make_global_settings' with $AR_host environment variable. | 118 # Test 'AR' in 'make_global_settings' with $AR_host environment variable. |
| 116 with TestGyp.LocalEnv({'AR_host': 'my_ar_host3'}): | 119 with TestGyp.LocalEnv({'AR_host': 'my_ar_host3'}): |
| 117 test.run_gyp('make_global_settings_ar.gyp', | 120 test.run_gyp('make_global_settings_ar.gyp', |
| 118 '-Dcustom_ar_target=my_ar_target3') | 121 '-Dcustom_ar_target=my_ar_target3') |
| 119 verify_ar_target(test, ar='my_ar_target3', rel_path=True) | 122 verify_ar_target(test, ar='my_ar_target3', rel_path=True) |
| 120 verify_ar_host(test, ar='my_ar_host3', rel_path=False) | 123 verify_ar_host(test, ar='my_ar_host3', rel_path=False) |
| 121 | 124 |
| 122 | 125 |
| 123 test.pass_test() | 126 test.pass_test() |
| OLD | NEW |