diff options
author | yukawa@chromium.org <yukawa@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af> | 2014-06-14 05:45:51 +0000 |
---|---|---|
committer | yukawa@chromium.org <yukawa@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af> | 2014-06-14 05:45:51 +0000 |
commit | 466a82eba30e516d35e7860d356554da3be149d1 (patch) | |
tree | a7521e0d8b7b6a4c03bb927b37dd29e7c55cc805 | |
parent | 822a998ac082353c083c063d78c796662f179543 (diff) | |
download | gyp-466a82eba30e516d35e7860d356554da3be149d1.tar.gz |
Revise unittest for 'LD' in 'make_global_settings'
This is a follow up CL for r1937. This is just a revise of a unittest and does not changes existing functionality.
It turned out that we need to specify GYP_CROSSCOMPILE=1 to test 'LD'/'LD.host' properly. Expected results, which are expected to be describing the current behavior, are updated accordingly.
BUG=gyp:434
TEST=unittest
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/338523003
git-svn-id: http://gyp.googlecode.com/svn/trunk@1939 78cadc50-ecff-11dd-a971-7dbc132099af
-rw-r--r-- | test/make_global_settings/ld/gyptest-make_global_settings_ld.py | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/test/make_global_settings/ld/gyptest-make_global_settings_ld.py b/test/make_global_settings/ld/gyptest-make_global_settings_ld.py index 4ce38fbb..fdea8a81 100644 --- a/test/make_global_settings/ld/gyptest-make_global_settings_ld.py +++ b/test/make_global_settings/ld/gyptest-make_global_settings_ld.py @@ -57,13 +57,16 @@ def verify_ld_host(test, ld=None, rel_path=False): # Resolve default values if ld_expected is None: if test.format == 'make': - ld_expected = '$(LD)' + # Make generator hasn't set the default value for LD.host. + # You can remove the following assertion as long as it doesn't + # break existing projects. + test.must_not_contain('Makefile', 'LD.host ?= ') + return elif test.format == 'ninja': if sys.platform == 'win32': - # TODO(yukawa): Make sure if this is an expected result or not. - ld_expected = 'ld' - else: ld_expected = '$ld' + else: + ld_expected = '$cc_host' if test.format == 'make': test.must_contain('Makefile', 'LD.host ?= %s' % ld_expected) elif test.format == 'ninja': @@ -83,17 +86,26 @@ test.run_gyp('make_global_settings_ld.gyp') verify_ld_target(test) +# Check default values with GYP_CROSSCOMPILE enabled. +with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): + test.run_gyp('make_global_settings_ld.gyp') +verify_ld_target(test) +verify_ld_host(test) + + # Test 'LD' in 'make_global_settings'. -test.run_gyp('make_global_settings_ld.gyp', '-Dcustom_ld_target=my_ld') +with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): + test.run_gyp('make_global_settings_ld.gyp', '-Dcustom_ld_target=my_ld') # TODO(yukawa): Support 'LD' in Ninja generator if test.format == 'make': verify_ld_target(test, ld='my_ld', rel_path=True) # Test 'LD'/'LD.host' in 'make_global_settings'. -test.run_gyp('make_global_settings_ld.gyp', - '-Dcustom_ld_target=my_ld_target1', - '-Dcustom_ld_host=my_ld_host1') +with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}): + test.run_gyp('make_global_settings_ld.gyp', + '-Dcustom_ld_target=my_ld_target1', + '-Dcustom_ld_host=my_ld_host1') # TODO(yukawa): Support 'LD'/'LD.host' in Ninja generator if test.format == 'make': verify_ld_target(test, ld='my_ld_target1', rel_path=True) @@ -107,7 +119,8 @@ if test.format == 'make': # the record. # If you want to support $LD/$LD_host, please revise the following test case as # well as the generator. -with TestGyp.LocalEnv({'LD': 'my_ld_target2', +with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1', + 'LD': 'my_ld_target2', 'LD_host': 'my_ld_host2'}): test.run_gyp('make_global_settings_ld.gyp') if test.format == 'make': |