michael@0: #!/usr/bin/env python michael@0: michael@0: # Copyright (c) 2012 Google Inc. All rights reserved. michael@0: # Use of this source code is governed by a BSD-style license that can be michael@0: # found in the LICENSE file. michael@0: michael@0: """ michael@0: Verifies building a target from a .gyp file a few subdirectories michael@0: deep when the --generator-output= option is used to put the build michael@0: configuration files in a separate directory tree. michael@0: """ michael@0: michael@0: import TestGyp michael@0: michael@0: # Ninja and Android don't support --generator-output. michael@0: test = TestGyp.TestGyp(formats=['!ninja', '!android']) michael@0: michael@0: test.writable(test.workpath('src'), False) michael@0: michael@0: test.writable(test.workpath('src/subdir2/deeper/build'), True) michael@0: michael@0: test.run_gyp('deeper.gyp', michael@0: '-Dset_symroot=1', michael@0: '--generator-output=' + test.workpath('gypfiles'), michael@0: chdir='src/subdir2/deeper') michael@0: michael@0: test.build('deeper.gyp', test.ALL, chdir='gypfiles') michael@0: michael@0: chdir = 'gypfiles' michael@0: michael@0: if test.format == 'xcode': michael@0: chdir = 'src/subdir2/deeper' michael@0: test.run_built_executable('deeper', michael@0: chdir=chdir, michael@0: stdout="Hello from deeper.c\n") michael@0: michael@0: test.pass_test()