1#!/usr/bin/env python 2 3# Copyright (c) 2011 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""" 8Verifies simple rules when using an explicit build target of 'all'. 9""" 10 11import TestGyp 12 13test = TestGyp.TestGyp() 14 15test.run_gyp('actions.gyp', chdir='src') 16 17test.relocate('src', 'relocate/src') 18 19test.build('actions.gyp', chdir='relocate/src') 20 21expect = """\ 22Hello from program.c 23Hello from function1.in 24Hello from function2.in 25""" 26 27if test.format == 'xcode': 28 chdir = 'relocate/src/subdir1' 29else: 30 chdir = 'relocate/src' 31test.run_built_executable('program', chdir=chdir, stdout=expect) 32 33expect = """\ 34Hello from program.c 35Hello from function3.in 36""" 37 38if test.format == 'xcode': 39 chdir = 'relocate/src/subdir3' 40else: 41 chdir = 'relocate/src' 42test.run_built_executable('program2', chdir=chdir, stdout=expect) 43 44test.must_match('relocate/src/subdir2/file1.out', 'Hello from file1.in\n') 45test.must_match('relocate/src/subdir2/file2.out', 'Hello from file2.in\n') 46 47test.must_match('relocate/src/subdir2/file1.out2', 'Hello from file1.in\n') 48test.must_match('relocate/src/subdir2/file2.out2', 'Hello from file2.in\n') 49 50test.must_match('relocate/src/external/file1.external_rules.out', 51 'Hello from file1.in\n') 52test.must_match('relocate/src/external/file2.external_rules.out', 53 'Hello from file2.in\n') 54 55test.pass_test() 56