Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: test/compiler-override/gyptest-compiler-global-settings.py

Issue 421453003: Add TestGypXcodeNinja to run tests against the xcode-ninja generator (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase onto origin/master Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 Google Inc. All rights reserved. 2 # Copyright (c) 2012 Google Inc. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """ 5 """
6 Verifies that make_global_settings can be used to override the 6 Verifies that make_global_settings can be used to override the
7 compiler settings. 7 compiler settings.
8 """ 8 """
9 9
10 import TestGyp 10 import TestGyp
(...skipping 25 matching lines...) Expand all
36 36
37 old_env = dict(os.environ) 37 old_env = dict(os.environ)
38 os.environ['GYP_CROSSCOMPILE'] = '1' 38 os.environ['GYP_CROSSCOMPILE'] = '1'
39 test.run_gyp(gypfile) 39 test.run_gyp(gypfile)
40 os.environ.clear() 40 os.environ.clear()
41 os.environ.update(old_env) 41 os.environ.update(old_env)
42 42
43 test.build(gypfile) 43 test.build(gypfile)
44 test.must_contain_all_lines(test.stdout(), ['my_cc.py', 'my_cxx.py', 'FOO']) 44 test.must_contain_all_lines(test.stdout(), ['my_cc.py', 'my_cxx.py', 'FOO'])
45 45
46 # The xcode generator chokes on the 'host' toolset.
sdefresne 2014/09/02 15:13:05 Same question here.
Tobias 2014/10/02 18:19:19 This test is testing a feature that is apparently
47 # Skip the rest of this test.
48 if test.format == 'xcode-ninja':
49 test.pass_test()
50
46 # Same again but with the host toolset. 51 # Same again but with the host toolset.
47 replacements['TOOLSET'] = 'host' 52 replacements['TOOLSET'] = 'host'
48 s = Template(open(gypfile + '.in').read()) 53 s = Template(open(gypfile + '.in').read())
49 output = open(gypfile, 'w') 54 output = open(gypfile, 'w')
50 output.write(s.substitute(replacements)) 55 output.write(s.substitute(replacements))
51 output.close() 56 output.close()
52 57
53 old_env = dict(os.environ) 58 old_env = dict(os.environ)
54 os.environ['GYP_CROSSCOMPILE'] = '1' 59 os.environ['GYP_CROSSCOMPILE'] = '1'
55 test.run_gyp(gypfile) 60 test.run_gyp(gypfile)
56 os.environ.clear() 61 os.environ.clear()
57 os.environ.update(old_env) 62 os.environ.update(old_env)
58 63
59 test.build(gypfile) 64 test.build(gypfile)
60 test.must_contain_all_lines(test.stdout(), ['my_cc.py', 'my_cxx.py', 'BAR']) 65 test.must_contain_all_lines(test.stdout(), ['my_cc.py', 'my_cxx.py', 'BAR'])
61 66
62 # Check that CC_host overrides make_global_settings 67 # Check that CC_host overrides make_global_settings
63 old_env = dict(os.environ) 68 old_env = dict(os.environ)
64 os.environ['CC_host'] = '%s %s/my_cc.py SECRET' % (replacements['PYTHON'], 69 os.environ['CC_host'] = '%s %s/my_cc.py SECRET' % (replacements['PYTHON'],
65 replacements['PWD']) 70 replacements['PWD'])
66 test.run_gyp(gypfile) 71 test.run_gyp(gypfile)
67 os.environ.clear() 72 os.environ.clear()
68 os.environ.update(old_env) 73 os.environ.update(old_env)
69 74
70 test.build(gypfile) 75 test.build(gypfile)
71 test.must_contain_all_lines(test.stdout(), ['SECRET', 'my_cxx.py', 'BAR']) 76 test.must_contain_all_lines(test.stdout(), ['SECRET', 'my_cxx.py', 'BAR'])
72 77
73 test.pass_test() 78 test.pass_test()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698