| 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 'LD' in make_global_settings. |    8 Verifies 'LD' in make_global_settings. | 
|    9 """ |    9 """ | 
|   10  |   10  | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   89 # Check default values with GYP_CROSSCOMPILE enabled. |   89 # Check default values with GYP_CROSSCOMPILE enabled. | 
|   90 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): |   90 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): | 
|   91   test.run_gyp('make_global_settings_ld.gyp') |   91   test.run_gyp('make_global_settings_ld.gyp') | 
|   92 verify_ld_target(test) |   92 verify_ld_target(test) | 
|   93 verify_ld_host(test) |   93 verify_ld_host(test) | 
|   94  |   94  | 
|   95  |   95  | 
|   96 # Test 'LD' in 'make_global_settings'. |   96 # Test 'LD' in 'make_global_settings'. | 
|   97 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): |   97 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): | 
|   98   test.run_gyp('make_global_settings_ld.gyp', '-Dcustom_ld_target=my_ld') |   98   test.run_gyp('make_global_settings_ld.gyp', '-Dcustom_ld_target=my_ld') | 
|   99 # TODO(yukawa): Support 'LD' in Ninja generator |   99 verify_ld_target(test, ld='my_ld', rel_path=True) | 
|  100 if test.format == 'make': |  | 
|  101   verify_ld_target(test, ld='my_ld', rel_path=True) |  | 
|  102  |  100  | 
|  103  |  101  | 
|  104 # Test 'LD'/'LD.host' in 'make_global_settings'. |  102 # Test 'LD'/'LD.host' in 'make_global_settings'. | 
|  105 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): |  103 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): | 
|  106   test.run_gyp('make_global_settings_ld.gyp', |  104   test.run_gyp('make_global_settings_ld.gyp', | 
|  107                '-Dcustom_ld_target=my_ld_target1', |  105                '-Dcustom_ld_target=my_ld_target1', | 
|  108                '-Dcustom_ld_host=my_ld_host1') |  106                '-Dcustom_ld_host=my_ld_host1') | 
|  109 # TODO(yukawa): Support 'LD'/'LD.host' in Ninja generator |  107 verify_ld_target(test, ld='my_ld_target1', rel_path=True) | 
|  110 if test.format == 'make': |  108 verify_ld_host(test, ld='my_ld_host1', rel_path=True) | 
|  111   verify_ld_target(test, ld='my_ld_target1', rel_path=True) |  | 
|  112   verify_ld_host(test, ld='my_ld_host1', rel_path=True) |  | 
|  113  |  109  | 
|  114  |  110  | 
|  115 # Unlike other environment variables such as $AR/$AR_host, $CC/$CC_host, |  111 # Unlike other environment variables such as $AR/$AR_host, $CC/$CC_host, | 
|  116 # and $CXX/$CXX_host, neither Make generator nor Ninja generator recognizes |  112 # and $CXX/$CXX_host, neither Make generator nor Ninja generator recognizes | 
|  117 # $LD/$LD_host environment variables as of r1935. This may or may not be |  113 # $LD/$LD_host environment variables as of r1935. This may or may not be | 
|  118 # intentional, but here we leave a test case to verify this behavior just for |  114 # intentional, but here we leave a test case to verify this behavior just for | 
|  119 # the record. |  115 # the record. | 
|  120 # If you want to support $LD/$LD_host, please revise the following test case as |  116 # If you want to support $LD/$LD_host, please revise the following test case as | 
|  121 # well as the generator. |  117 # well as the generator. | 
|  122 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1', |  118 with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1', | 
|  123                        'LD': 'my_ld_target2', |  119                        'LD': 'my_ld_target2', | 
|  124                        'LD_host': 'my_ld_host2'}): |  120                        'LD_host': 'my_ld_host2'}): | 
|  125   test.run_gyp('make_global_settings_ld.gyp') |  121   test.run_gyp('make_global_settings_ld.gyp') | 
|  126 if test.format == 'make': |  122 if test.format == 'make': | 
|  127   test.must_not_contain('Makefile', 'my_ld_target2') |  123   test.must_not_contain('Makefile', 'my_ld_target2') | 
|  128   test.must_not_contain('Makefile', 'my_ld_host2') |  124   test.must_not_contain('Makefile', 'my_ld_host2') | 
|  129 elif test.format == 'ninja': |  125 elif test.format == 'ninja': | 
|  130   test.must_not_contain('out/Default/build.ninja', 'my_ld_target2') |  126   test.must_not_contain('out/Default/build.ninja', 'my_ld_target2') | 
|  131   test.must_not_contain('out/Default/build.ninja', 'my_ld_host2') |  127   test.must_not_contain('out/Default/build.ninja', 'my_ld_host2') | 
|  132  |  128  | 
|  133  |  129  | 
|  134 test.pass_test() |  130 test.pass_test() | 
| OLD | NEW |