OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2011 Google Inc. All rights reserved. | 3 # Copyright (c) 2011 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 build of an executable with C++ define specified by a gyp define, and | 8 Verifies build of an executable with C++ define specified by a gyp define, and |
9 the use of the environment during regeneration when the gyp file changes. | 9 the use of the environment during regeneration when the gyp file changes. |
10 """ | 10 """ |
(...skipping 14 matching lines...) Expand all Loading... |
25 # case the platform doesn't support unsetenv. | 25 # case the platform doesn't support unsetenv. |
26 os.environ['GYP_DEFINES'] = '' | 26 os.environ['GYP_DEFINES'] = '' |
27 del os.environ['GYP_DEFINES'] | 27 del os.environ['GYP_DEFINES'] |
28 | 28 |
29 test.build('defines.gyp') | 29 test.build('defines.gyp') |
30 | 30 |
31 expect = """\ | 31 expect = """\ |
32 FOO is defined | 32 FOO is defined |
33 VALUE is 1 | 33 VALUE is 1 |
34 2*PAREN_VALUE is 12 | 34 2*PAREN_VALUE is 12 |
35 HASH_VALUE is a#b | 35 HASH_VALUE is a#1 |
36 """ | 36 """ |
37 test.run_built_executable('defines', stdout=expect) | 37 test.run_built_executable('defines', stdout=expect) |
38 | 38 |
39 # Sleep so that the changed gyp file will have a newer timestamp than the | 39 # Sleep so that the changed gyp file will have a newer timestamp than the |
40 # previously generated build files. | 40 # previously generated build files. |
41 test.sleep() | 41 test.sleep() |
42 test.write('defines.gyp', test.read('defines-env.gyp')) | 42 test.write('defines.gyp', test.read('defines-env.gyp')) |
43 | 43 |
44 test.build('defines.gyp', test.ALL) | 44 test.build('defines.gyp', test.ALL) |
45 | 45 |
46 expect = """\ | 46 expect = """\ |
47 VALUE is 50 | 47 VALUE is 50 |
48 """ | 48 """ |
49 test.run_built_executable('defines', stdout=expect) | 49 test.run_built_executable('defines', stdout=expect) |
50 | 50 |
51 test.pass_test() | 51 test.pass_test() |
OLD | NEW |