michael@0: #!/usr/bin/env python michael@0: michael@0: # Copyright (c) 2009 Google Inc. All rights reserved. michael@0: # Use of this source code is governed by a BSD-style license that can be michael@0: # found in the LICENSE file. michael@0: michael@0: """ michael@0: Verifies use of include_dirs when using an explicit build target of 'all'. michael@0: """ michael@0: michael@0: import TestGyp michael@0: michael@0: test = TestGyp.TestGyp() michael@0: michael@0: if test.format == 'scons': michael@0: test.skip_test('TODO: http://code.google.com/p/gyp/issues/detail?id=176\n') michael@0: michael@0: test.run_gyp('includes.gyp', chdir='src') michael@0: michael@0: test.relocate('src', 'relocate/src') michael@0: michael@0: test.build('includes.gyp', test.ALL, chdir='relocate/src') michael@0: michael@0: expect = """\ michael@0: Hello from includes.c michael@0: Hello from inc.h michael@0: Hello from include1.h michael@0: Hello from subdir/inc2/include2.h michael@0: Hello from shadow2/shadow.h michael@0: """ michael@0: test.run_built_executable('includes', stdout=expect, chdir='relocate/src') michael@0: michael@0: if test.format == 'xcode': michael@0: chdir='relocate/src/subdir' michael@0: else: michael@0: chdir='relocate/src' michael@0: michael@0: expect = """\ michael@0: Hello from subdir/subdir_includes.c michael@0: Hello from subdir/inc.h michael@0: Hello from include1.h michael@0: Hello from subdir/inc2/include2.h michael@0: """ michael@0: test.run_built_executable('subdir_includes', stdout=expect, chdir=chdir) michael@0: michael@0: test.pass_test()