| 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 """ | 36 """ |
| 36 test.run_built_executable('defines', stdout=expect) | 37 test.run_built_executable('defines', stdout=expect) |
| 37 | 38 |
| 38 # 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 |
| 39 # previously generated build files. | 40 # previously generated build files. |
| 40 test.sleep() | 41 test.sleep() |
| 41 test.write('defines.gyp', test.read('defines-env.gyp')) | 42 test.write('defines.gyp', test.read('defines-env.gyp')) |
| 42 | 43 |
| 43 test.build('defines.gyp', test.ALL) | 44 test.build('defines.gyp', test.ALL) |
| 44 | 45 |
| 45 expect = """\ | 46 expect = """\ |
| 46 VALUE is 50 | 47 VALUE is 50 |
| 47 """ | 48 """ |
| 48 test.run_built_executable('defines', stdout=expect) | 49 test.run_built_executable('defines', stdout=expect) |
| 49 | 50 |
| 50 test.pass_test() | 51 test.pass_test() |
| OLD | NEW |