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.
8
Verifies simple actions when using the default build target.
13
test = TestGyp.TestGyp()
15
test.run_gyp('actions.gyp', chdir='src')
17
test.relocate('src', 'relocate/src')
19
# Test that an "always run" action increases a counter on multiple invocations,
20
# and that a dependent action updates in step.
21
test.build('actions.gyp', chdir='relocate/src')
22
test.must_match('relocate/src/subdir1/actions-out/action-counter.txt', '1')
23
test.must_match('relocate/src/subdir1/actions-out/action-counter_2.txt', '1')
24
test.build('actions.gyp', chdir='relocate/src')
25
test.must_match('relocate/src/subdir1/actions-out/action-counter.txt', '2')
26
test.must_match('relocate/src/subdir1/actions-out/action-counter_2.txt', '2')
28
# The "always run" action only counts to 2, but the dependent target will count
29
# forever if it's allowed to run. This verifies that the dependent target only
30
# runs when the "always run" action generates new output, not just because the
32
test.build('actions.gyp', test.ALL, chdir='relocate/src')
33
test.must_match('relocate/src/subdir1/actions-out/action-counter.txt', '2')
34
test.must_match('relocate/src/subdir1/actions-out/action-counter_2.txt', '2')
38
Hello from make-prog1.py
39
Hello from make-prog2.py
42
if test.format == 'xcode':
43
chdir = 'relocate/src/subdir1'
45
chdir = 'relocate/src'
46
test.run_built_executable('program', chdir=chdir, stdout=expect)
49
test.must_match('relocate/src/subdir2/file.out', "Hello from make-file.py\n")
52
expect = "Hello from generate_main.py\n"
54
if test.format == 'xcode':
55
chdir = 'relocate/src/subdir3'
57
chdir = 'relocate/src'
58
test.run_built_executable('null_input', chdir=chdir, stdout=expect)