• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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"""
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
16# Android doesn't support --generator-output.
17test = TestGyp.TestGyp(formats=['!android'])
18if not hasattr(os, 'symlink'):
19  test.skip_test('Missing os.symlink -- skipping test.\n')
20
21test.writable(test.workpath('src'), False)
22
23test.writable(test.workpath('src/subdir2/deeper/build'), True)
24
25test.subdir(test.workpath('build'))
26test.subdir(test.workpath('build/deeper'))
27test.symlink('build/deeper', test.workpath('symlink'))
28
29test.writable(test.workpath('build/deeper'), True)
30test.run_gyp('deeper.gyp',
31             '-Dset_symroot=2',
32             '--generator-output=' + test.workpath('symlink'),
33             chdir='src/subdir2/deeper')
34
35chdir = 'symlink'
36test.build('deeper.gyp', test.ALL, chdir=chdir)
37
38if test.format == 'xcode':
39  chdir = 'src/subdir2/deeper'
40test.run_built_executable('deeper',
41                          chdir=chdir,
42                          stdout="Hello from deeper.c\n")
43test.pass_test()
44