OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2013 Google Inc. All rights reserved. | 3 # Copyright (c) 2013 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 that Makefiles get rebuilt when a source gyp file changes and | 8 Verifies that Makefiles get rebuilt when a source gyp file changes and |
9 --generator-output is used. | 9 --generator-output is used. |
10 """ | 10 """ |
11 | 11 |
12 import TestGyp | 12 import TestGyp |
13 | 13 |
14 # Regenerating build files when a gyp file changes is currently only supported | 14 # Regenerating build files when a gyp file changes is currently only supported |
15 # by the make and Android generators, and --generator-output is not supported | 15 # by the make generator, and --generator-output is not supported by ninja, so we |
16 # by Android and ninja, so we can only test for make. | 16 # can only test for make. |
17 test = TestGyp.TestGyp(formats=['make']) | 17 test = TestGyp.TestGyp(formats=['make']) |
18 | 18 |
19 CHDIR='generator-output' | 19 CHDIR='generator-output' |
20 | 20 |
21 test.run_gyp('hello.gyp', '--generator-output=%s' % CHDIR) | 21 test.run_gyp('hello.gyp', '--generator-output=%s' % CHDIR) |
22 | 22 |
23 test.build('hello.gyp', test.ALL, chdir=CHDIR) | 23 test.build('hello.gyp', test.ALL, chdir=CHDIR) |
24 | 24 |
25 test.run_built_executable('hello', stdout="Hello, world!\n", chdir=CHDIR) | 25 test.run_built_executable('hello', stdout="Hello, world!\n", chdir=CHDIR) |
26 | 26 |
27 # Sleep so that the changed gyp file will have a newer timestamp than the | 27 # Sleep so that the changed gyp file will have a newer timestamp than the |
28 # previously generated build files. | 28 # previously generated build files. |
29 test.sleep() | 29 test.sleep() |
30 test.write('hello.gyp', test.read('hello2.gyp')) | 30 test.write('hello.gyp', test.read('hello2.gyp')) |
31 | 31 |
32 test.build('hello.gyp', test.ALL, chdir=CHDIR) | 32 test.build('hello.gyp', test.ALL, chdir=CHDIR) |
33 | 33 |
34 test.run_built_executable('hello', stdout="Hello, two!\n", chdir=CHDIR) | 34 test.run_built_executable('hello', stdout="Hello, two!\n", chdir=CHDIR) |
35 | 35 |
36 test.pass_test() | 36 test.pass_test() |
OLD | NEW |