blob: 8b29b348c275cf458ee8f738b482cb9ffd2b3a32 [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001#!/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"""
8Verifies building a target when the --generator-output= option is used to put
9the build configuration files in a separate directory tree referenced by a
10symlink.
11"""
12
13import TestGyp
14import os
15
16test = TestGyp.TestGyp()
17if not hasattr(os, 'symlink'):
18 test.skip_test('Missing os.symlink -- skipping test.\n')
19
20test.writable(test.workpath('src'), False)
21
22test.writable(test.workpath('src/subdir2/deeper/build'), True)
23
24test.subdir(test.workpath('build'))
25test.subdir(test.workpath('build/deeper'))
26test.symlink('build/deeper', test.workpath('symlink'))
27
28test.writable(test.workpath('build/deeper'), True)
29test.run_gyp('deeper.gyp',
30 '-Dset_symroot=2',
31 '--generator-output=' + test.workpath('symlink'),
32 chdir='src/subdir2/deeper')
33
34chdir = 'symlink'
35test.build('deeper.gyp', test.ALL, chdir=chdir)
36
37if test.format == 'xcode':
38 chdir = 'src/subdir2/deeper'
39test.run_built_executable('deeper',
40 chdir=chdir,
41 stdout="Hello from deeper.c\n")
42test.pass_test()