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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 test.run_gyp('make_global_settings_ar.gyp', '-Dcustom_ar_target=my_ar') | 88 test.run_gyp('make_global_settings_ar.gyp', '-Dcustom_ar_target=my_ar') |
89 verify_ar_target(test, ar='my_ar', rel_path=True) | 89 verify_ar_target(test, ar='my_ar', rel_path=True) |
90 | 90 |
91 | 91 |
92 # Test 'AR'/'AR.host' in 'make_global_settings'. | 92 # Test 'AR'/'AR.host' in 'make_global_settings'. |
93 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): | 93 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): |
94 test.run_gyp('make_global_settings_ar.gyp', | 94 test.run_gyp('make_global_settings_ar.gyp', |
95 '-Dcustom_ar_target=my_ar_target1', | 95 '-Dcustom_ar_target=my_ar_target1', |
96 '-Dcustom_ar_host=my_ar_host1') | 96 '-Dcustom_ar_host=my_ar_host1') |
97 verify_ar_target(test, ar='my_ar_target1', rel_path=True) | 97 verify_ar_target(test, ar='my_ar_target1', rel_path=True) |
98 # TODO(yukawa): Support 'AR.host' in Ninja generator | 98 verify_ar_host(test, ar='my_ar_host1', rel_path=True) |
99 if test.format == 'make': | |
100 verify_ar_host(test, ar='my_ar_host1', rel_path=True) | |
101 | 99 |
102 | 100 |
103 # Test $AR and $AR_host environment variables. | 101 # Test $AR and $AR_host environment variables. |
104 with TestGyp.LocalEnv({'AR': 'my_ar_target2', | 102 with TestGyp.LocalEnv({'AR': 'my_ar_target2', |
105 'AR_host': 'my_ar_host2'}): | 103 'AR_host': 'my_ar_host2'}): |
106 test.run_gyp('make_global_settings_ar.gyp') | 104 test.run_gyp('make_global_settings_ar.gyp') |
107 # Ninja generator resolves $AR in gyp phase. Make generator doesn't. | 105 # Ninja generator resolves $AR in gyp phase. Make generator doesn't. |
108 if test.format == 'ninja': | 106 if test.format == 'ninja': |
109 if sys.platform == 'win32': | 107 if sys.platform == 'win32': |
110 # TODO(yukawa): Make sure if this is an expected result or not. | 108 # TODO(yukawa): Make sure if this is an expected result or not. |
111 verify_ar_target(test, ar='lib.exe', rel_path=False) | 109 verify_ar_target(test, ar='lib.exe', rel_path=False) |
112 else: | 110 else: |
113 verify_ar_target(test, ar='my_ar_target2', rel_path=False) | 111 verify_ar_target(test, ar='my_ar_target2', rel_path=False) |
114 verify_ar_host(test, ar='my_ar_host2', rel_path=False) | 112 verify_ar_host(test, ar='my_ar_host2', rel_path=False) |
115 | 113 |
116 | 114 |
117 # Test 'AR' in 'make_global_settings' with $AR_host environment variable. | 115 # Test 'AR' in 'make_global_settings' with $AR_host environment variable. |
118 with TestGyp.LocalEnv({'AR_host': 'my_ar_host3'}): | 116 with TestGyp.LocalEnv({'AR_host': 'my_ar_host3'}): |
119 test.run_gyp('make_global_settings_ar.gyp', | 117 test.run_gyp('make_global_settings_ar.gyp', |
120 '-Dcustom_ar_target=my_ar_target3') | 118 '-Dcustom_ar_target=my_ar_target3') |
121 verify_ar_target(test, ar='my_ar_target3', rel_path=True) | 119 verify_ar_target(test, ar='my_ar_target3', rel_path=True) |
122 verify_ar_host(test, ar='my_ar_host3', rel_path=False) | 120 verify_ar_host(test, ar='my_ar_host3', rel_path=False) |
123 | 121 |
124 | 122 |
125 test.pass_test() | 123 test.pass_test() |
OLD | NEW |