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"""
8Build a .gyp with two targets that share a common .c source file.
9"""
10
11import TestGyp
12
13test = TestGyp.TestGyp()
14
15test.run_gyp('all.gyp', chdir='src')
16
17test.relocate('src', 'relocate/src')
18
19test.build('all.gyp', test.ALL, chdir='relocate/src')
20
21expect1 = """\
22Hello from prog1.c
23Hello prog1 from func.c
24"""
25
26expect2 = """\
27Hello from prog2.c
28Hello prog2 from func.c
29"""
30
31test.run_built_executable('prog1', chdir='relocate/src', stdout=expect1)
32test.run_built_executable('prog2', chdir='relocate/src', stdout=expect2)
33
34test.pass_test()
35