blob: 2cb6659beb8a7c6aba5dd1f566068432fc180049 [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 subsidiary dependent target from a .gyp file in a
9subdirectory, without specifying an explicit output build directory,
10and using the subdirectory's solution or project file as the entry point.
11"""
12
13import TestGyp
14import errno
15
16# Ninja doesn't support relocation.
17# CMake produces a single CMakeLists.txt in the output directory.
18test = TestGyp.TestGyp(formats=['!ninja', '!cmake'])
19
20test.run_gyp('prog1.gyp', chdir='src')
21
22test.relocate('src', 'relocate/src')
23
24chdir = 'relocate/src/subdir'
25
26test.build('prog2.gyp', chdir=chdir)
27
28test.built_file_must_not_exist('prog1', type=test.EXECUTABLE, chdir=chdir)
29
30test.run_built_executable('prog2',
31 chdir=chdir,
32 stdout="Hello from prog2.c\n")
33
34test.pass_test()