summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/include_dirs/gyptest-default.py
blob: fc6141587e10be1573c886d8561470ecf46a45a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python

# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
Verifies use of include_dirs when using the default build target.
"""

import TestGyp

test = TestGyp.TestGyp()

test.run_gyp('includes.gyp', chdir='src')

test.relocate('src', 'relocate/src')

test.build('includes.gyp', test.ALL, chdir='relocate/src')

expect = """\
Hello from includes.c
Hello from inc.h
Hello from include1.h
Hello from subdir/inc2/include2.h
Hello from shadow2/shadow.h
"""
test.run_built_executable('includes', stdout=expect, chdir='relocate/src')

if test.format == 'xcode':
  chdir='relocate/src/subdir'
else:
  chdir='relocate/src'

expect = """\
Hello from subdir/subdir_includes.c
Hello from subdir/inc.h
Hello from include1.h
Hello from subdir/inc2/include2.h
"""
test.run_built_executable('subdir_includes', stdout=expect, chdir=chdir)

test.pass_test()