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

Side by Side Diff: test/cxxflags/gyptest-cxxflags.py

Issue 235033003: Make test/cxxflags use a user define instead of __OPTIMIZE__ (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « test/cxxflags/cxxflags.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2012 Google Inc. All rights reserved. 3 # Copyright (c) 2012 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 the use of the environment during regeneration when the gyp file 8 Verifies the use of the environment during regeneration when the gyp file
9 changes, specifically via build of an executable with C++ flags specified by 9 changes, specifically via build of an executable with C++ flags specified by
10 CXXFLAGS. 10 CXXFLAGS.
11 11
12 In this test, gyp happens within a local environment, but build outside of it. 12 In this test, gyp happens within a local environment, but build outside of it.
13 """ 13 """
14 14
15 import TestGyp 15 import TestGyp
16 16
17 FORMATS = ('ninja',) 17 FORMATS = ('ninja',)
18 18
19 test = TestGyp.TestGyp(formats=FORMATS) 19 test = TestGyp.TestGyp(formats=FORMATS)
20 20
21 # We reset the environ after calling gyp. When the auto-regeneration happens, 21 # We reset the environ after calling gyp. When the auto-regeneration happens,
22 # the same define should be reused anyway. 22 # the same define should be reused anyway.
23 with TestGyp.LocalEnv({'CXXFLAGS': '-O0'}): 23 with TestGyp.LocalEnv({'CXXFLAGS': ''}):
24 test.run_gyp('cxxflags.gyp') 24 test.run_gyp('cxxflags.gyp')
25 25
26 test.build('cxxflags.gyp') 26 test.build('cxxflags.gyp')
27 27
28 expect = """\ 28 expect = """\
29 Using no optimization flag 29 No define
30 """ 30 """
31 test.run_built_executable('cxxflags', stdout=expect) 31 test.run_built_executable('cxxflags', stdout=expect)
32 32
33 test.sleep() 33 test.sleep()
34 34
35 with TestGyp.LocalEnv({'CXXFLAGS': '-O2'}): 35 with TestGyp.LocalEnv({'CXXFLAGS': '-DABC'}):
36 test.run_gyp('cxxflags.gyp') 36 test.run_gyp('cxxflags.gyp')
37 37
38 test.build('cxxflags.gyp') 38 test.build('cxxflags.gyp')
39 39
40 expect = """\ 40 expect = """\
41 Using an optimization flag 41 With define
42 """ 42 """
43 test.run_built_executable('cxxflags', stdout=expect) 43 test.run_built_executable('cxxflags', stdout=expect)
44 44
45 test.pass_test() 45 test.pass_test()
OLDNEW
« no previous file with comments | « test/cxxflags/cxxflags.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698