OLD | NEW |
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 building a target when the --generator-output= option is used to put | 8 Verifies building a target when the --generator-output= option is used to put |
9 the build configuration files in a separate directory tree referenced by a | 9 the build configuration files in a separate directory tree referenced by a |
10 symlink. | 10 symlink. |
11 """ | 11 """ |
12 | 12 |
13 import TestGyp | 13 import TestGyp |
14 import os | 14 import os |
15 | 15 |
16 # Android doesn't support --generator-output. | 16 # Android doesn't support --generator-output. |
17 test = TestGyp.TestGyp(formats=['!android']) | 17 test = TestGyp.TestGyp(formats=['!android']) |
18 if not hasattr(os, 'symlink'): | 18 if not hasattr(os, 'symlink'): |
19 test.skip_test('Missing os.symlink -- skipping test.\n') | 19 test.skip_test('Missing os.symlink -- skipping test.\n') |
20 | 20 |
21 # Bug: xcode-ninja doesn't respect --generator-output | |
22 # cf. https://code.google.com/p/gyp/issues/detail?id=442 | |
23 if test.format == 'xcode-ninja': | |
24 test.skip_test() | |
25 | |
26 test.writable(test.workpath('src'), False) | 21 test.writable(test.workpath('src'), False) |
27 | 22 |
28 test.writable(test.workpath('src/subdir2/deeper/build'), True) | 23 test.writable(test.workpath('src/subdir2/deeper/build'), True) |
29 | 24 |
30 test.subdir(test.workpath('build')) | 25 test.subdir(test.workpath('build')) |
31 test.subdir(test.workpath('build/deeper')) | 26 test.subdir(test.workpath('build/deeper')) |
32 test.symlink('build/deeper', test.workpath('symlink')) | 27 test.symlink('build/deeper', test.workpath('symlink')) |
33 | 28 |
34 test.writable(test.workpath('build/deeper'), True) | 29 test.writable(test.workpath('build/deeper'), True) |
35 test.run_gyp('deeper.gyp', | 30 test.run_gyp('deeper.gyp', |
36 '-Dset_symroot=2', | 31 '-Dset_symroot=2', |
37 '--generator-output=' + test.workpath('symlink'), | 32 '--generator-output=' + test.workpath('symlink'), |
38 chdir='src/subdir2/deeper') | 33 chdir='src/subdir2/deeper') |
39 | 34 |
40 chdir = 'symlink' | 35 chdir = 'symlink' |
41 test.build('deeper.gyp', test.ALL, chdir=chdir) | 36 test.build('deeper.gyp', test.ALL, chdir=chdir) |
42 | 37 |
43 if test.format == 'xcode': | 38 if test.format == 'xcode': |
44 chdir = 'src/subdir2/deeper' | 39 chdir = 'src/subdir2/deeper' |
45 test.run_built_executable('deeper', | 40 test.run_built_executable('deeper', |
46 chdir=chdir, | 41 chdir=chdir, |
47 stdout="Hello from deeper.c\n") | 42 stdout="Hello from deeper.c\n") |
48 test.pass_test() | 43 test.pass_test() |
OLD | NEW |