Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | |
| 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 |
| 5 | # found in the LICENSE file. |
| 6 | |
| 7 | """ |
| 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 |
| 10 | symlink. |
| 11 | """ |
| 12 | |
| 13 | import TestGyp |
| 14 | import os |
| 15 | |
| 16 | test = TestGyp.TestGyp() |
| 17 | if not hasattr(os, 'symlink'): |
| 18 | test.skip_test('Missing os.symlink -- skipping test.\n') |
| 19 | |
| 20 | test.writable(test.workpath('src'), False) |
| 21 | |
| 22 | test.writable(test.workpath('src/subdir2/deeper/build'), True) |
| 23 | |
| 24 | test.subdir(test.workpath('build')) |
| 25 | test.subdir(test.workpath('build/deeper')) |
| 26 | test.symlink('build/deeper', test.workpath('symlink')) |
| 27 | |
| 28 | test.writable(test.workpath('build/deeper'), True) |
| 29 | test.run_gyp('deeper.gyp', |
| 30 | '-Dset_symroot=2', |
| 31 | '--generator-output=' + test.workpath('symlink'), |
| 32 | chdir='src/subdir2/deeper') |
| 33 | |
| 34 | chdir = 'symlink' |
| 35 | test.build('deeper.gyp', test.ALL, chdir=chdir) |
| 36 | |
| 37 | if test.format == 'xcode': |
| 38 | chdir = 'src/subdir2/deeper' |
| 39 | test.run_built_executable('deeper', |
| 40 | chdir=chdir, |
| 41 | stdout="Hello from deeper.c\n") |
| 42 | test.pass_test() |