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

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

Issue 10833021: Honor $CC/$CC_host and friends in make generator. (Closed) Base URL: http://git.chromium.org/external/gyp.git@master
Patch Set: Remove msvs_emulation.py changes Created 8 years, 4 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
« no previous file with comments | « test/compiler-override/gyptest-compiler-env.py ('k') | test/compiler-override/my_cc.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
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
4 # found in the LICENSE file.
5 """
6 Verifies that make_global_settings can be used to override the
7 compiler settings.
8 """
9
10 import TestGyp
11 import os
12 import copy
13 import sys
14 from string import Template
15
16
17 if sys.platform == 'win32':
18 # cross compiling not support by ninja on windows
19 # and make not supported on windows at all.
20 sys.exit(0)
21
22 test = TestGyp.TestGyp(formats=['ninja', 'make'])
23
24 gypfile = 'compiler-global-settings.gyp'
25
26 replacements = { 'PYTHON': '/usr/bin/python', 'PWD': os.getcwd()}
27
28 # Process the .in gyp file to produce the final gyp file
29 # since we need to include absolute paths in the make_global_settings
30 # section.
31 replacements['TOOLSET'] = 'target'
32 s = Template(open(gypfile + '.in').read())
33 output = open(gypfile, 'w')
34 output.write(s.substitute(replacements))
35 output.close()
36
37 test.run_gyp(gypfile)
38 test.build(gypfile)
39 test.must_contain_all_lines(test.stdout(), ['my_cc.py', 'my_cxx.py', 'FOO'])
40
41 # Same again but with the host toolset.
42 replacements['TOOLSET'] = 'host'
43 s = Template(open(gypfile + '.in').read())
44 output = open(gypfile, 'w')
45 output.write(s.substitute(replacements))
46 output.close()
47
48 test.run_gyp(gypfile)
49 test.build(gypfile)
50 test.must_contain_all_lines(test.stdout(), ['my_cc.py', 'my_cxx.py', 'BAR'])
51
52 test.pass_test()
OLDNEW
« no previous file with comments | « test/compiler-override/gyptest-compiler-env.py ('k') | test/compiler-override/my_cc.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698