1 #!/usr/bin/env python 2 3 # Copyright (c) 2009 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 """ 8 Verifies use of include_dirs when using an explicit build target of 'all'. 9 """ 10 11 import TestGyp 12 13 test = TestGyp.TestGyp() 14 15 test.run_gyp('includes.gyp', chdir='src') 16 17 test.relocate('src', 'relocate/src') 18 19 test.build('includes.gyp', test.ALL, chdir='relocate/src') 20 21 expect = """\ 22 Hello from includes.c 23 Hello from inc.h 24 Hello from include1.h 25 Hello from subdir/inc2/include2.h 26 Hello from shadow2/shadow.h 27 """ 28 test.run_built_executable('includes', stdout=expect, chdir='relocate/src') 29 30 if test.format == 'xcode': 31 chdir='relocate/src/subdir' 32 else: 33 chdir='relocate/src' 34 35 expect = """\ 36 Hello from subdir/subdir_includes.c 37 Hello from subdir/inc.h 38 Hello from include1.h 39 Hello from subdir/inc2/include2.h 40 """ 41 test.run_built_executable('subdir_includes', stdout=expect, chdir=chdir) 42 43 test.pass_test() 44