blob: e6e637ebbfc4915d99ec2b536c50b031fde16564 [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001#!/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 sys
12
13if sys.platform == 'win32':
14 print "This test is currently disabled: https://crbug.com/483696."
15 sys.exit(0)
16
17
18import TestGyp
19
20test = TestGyp.TestGyp()
21
22test.run_gyp('no_action_with_rules_fails.gyp', chdir='src/noaction', status=1,
23 stderr=None)
24
25test.run_gyp('actions.gyp',
26 '-G', 'xcode_ninja_target_pattern=^pull_in_all_actions$',
27 chdir='src')
28
29test.relocate('src', 'relocate/src')
30
31test.build('actions.gyp', test.ALL, chdir='relocate/src')
32
33expect = """\
34Hello from program.c
35Hello from function1.in
36Hello from function2.in
37"""
38
39if test.format == 'xcode':
40 chdir = 'relocate/src/subdir1'
41else:
42 chdir = 'relocate/src'
43test.run_built_executable('program', chdir=chdir, stdout=expect)
44
45expect = """\
46Hello from program.c
47Hello from function3.in
48"""
49
50if test.format == 'xcode':
51 chdir = 'relocate/src/subdir3'
52else:
53 chdir = 'relocate/src'
54test.run_built_executable('program2', chdir=chdir, stdout=expect)
55
56test.must_match('relocate/src/subdir2/file1.out', 'Hello from file1.in\n')
57test.must_match('relocate/src/subdir2/file2.out', 'Hello from file2.in\n')
58
59test.must_match('relocate/src/subdir2/file1.out2', 'Hello from file1.in\n')
60test.must_match('relocate/src/subdir2/file2.out2', 'Hello from file2.in\n')
61
62test.must_match('relocate/src/subdir2/file1.out4', 'Hello from file1.in\n')
63test.must_match('relocate/src/subdir2/file2.out4', 'Hello from file2.in\n')
64test.must_match('relocate/src/subdir2/file1.copy', 'Hello from file1.in\n')
65
66test.must_match('relocate/src/external/file1.external_rules.out',
67 'Hello from file1.in\n')
68test.must_match('relocate/src/external/file2.external_rules.out',
69 'Hello from file2.in\n')
70
71expect = """\
72Hello from program.c
73Got 41.
74"""
75
76if test.format == 'xcode':
77 chdir = 'relocate/src/subdir4'
78else:
79 chdir = 'relocate/src'
80test.run_built_executable('program4', chdir=chdir, stdout=expect)
81
82test.pass_test()