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: Build a .gyp with two targets that share a common .c source file. michael@0: """ michael@0: michael@0: import TestGyp michael@0: michael@0: test = TestGyp.TestGyp() michael@0: michael@0: test.run_gyp('all.gyp', chdir='src') michael@0: michael@0: test.relocate('src', 'relocate/src') michael@0: michael@0: test.build('all.gyp', chdir='relocate/src') michael@0: michael@0: expect1 = """\ michael@0: Hello from prog1.c michael@0: Hello prog1 from func.c michael@0: """ michael@0: michael@0: expect2 = """\ michael@0: Hello from prog2.c michael@0: Hello prog2 from func.c michael@0: """ michael@0: michael@0: test.run_built_executable('prog1', chdir='relocate/src', stdout=expect1) michael@0: test.run_built_executable('prog2', chdir='relocate/src', stdout=expect2) michael@0: michael@0: test.pass_test()