Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | #!/usr/bin/env python |
michael@0 | 2 | |
michael@0 | 3 | # Copyright (c) 2012 Google Inc. All rights reserved. |
michael@0 | 4 | # Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | # found in the LICENSE file. |
michael@0 | 6 | |
michael@0 | 7 | """ |
michael@0 | 8 | Verifies building a target from a .gyp file a few subdirectories |
michael@0 | 9 | deep when the --generator-output= option is used to put the build |
michael@0 | 10 | configuration files in a separate directory tree. |
michael@0 | 11 | """ |
michael@0 | 12 | |
michael@0 | 13 | import TestGyp |
michael@0 | 14 | |
michael@0 | 15 | # Ninja and Android don't support --generator-output. |
michael@0 | 16 | test = TestGyp.TestGyp(formats=['!ninja', '!android']) |
michael@0 | 17 | |
michael@0 | 18 | test.writable(test.workpath('src'), False) |
michael@0 | 19 | |
michael@0 | 20 | test.writable(test.workpath('src/subdir2/deeper/build'), True) |
michael@0 | 21 | |
michael@0 | 22 | test.run_gyp('deeper.gyp', |
michael@0 | 23 | '-Dset_symroot=1', |
michael@0 | 24 | '--generator-output=' + test.workpath('gypfiles'), |
michael@0 | 25 | chdir='src/subdir2/deeper') |
michael@0 | 26 | |
michael@0 | 27 | test.build('deeper.gyp', test.ALL, chdir='gypfiles') |
michael@0 | 28 | |
michael@0 | 29 | chdir = 'gypfiles' |
michael@0 | 30 | |
michael@0 | 31 | if test.format == 'xcode': |
michael@0 | 32 | chdir = 'src/subdir2/deeper' |
michael@0 | 33 | test.run_built_executable('deeper', |
michael@0 | 34 | chdir=chdir, |
michael@0 | 35 | stdout="Hello from deeper.c\n") |
michael@0 | 36 | |
michael@0 | 37 | test.pass_test() |