~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/ThirdParty/gyp/test/generator-output/gyptest-rules.py

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
"""
 
8
Verifies --generator-output= behavior when using rules.
 
9
"""
 
10
 
 
11
import TestGyp
 
12
 
 
13
test = TestGyp.TestGyp()
 
14
 
 
15
test.writable(test.workpath('rules'), False)
 
16
 
 
17
test.run_gyp('rules.gyp',
 
18
             '--generator-output=' + test.workpath('gypfiles'),
 
19
             chdir='rules')
 
20
 
 
21
test.writable(test.workpath('rules'), True)
 
22
 
 
23
test.relocate('rules', 'relocate/rules')
 
24
test.relocate('gypfiles', 'relocate/gypfiles')
 
25
 
 
26
test.writable(test.workpath('relocate/rules'), False)
 
27
 
 
28
test.writable(test.workpath('relocate/rules/build'), True)
 
29
test.writable(test.workpath('relocate/rules/subdir1/build'), True)
 
30
test.writable(test.workpath('relocate/rules/subdir2/build'), True)
 
31
test.writable(test.workpath('relocate/rules/subdir2/rules-out'), True)
 
32
 
 
33
test.build('rules.gyp', test.ALL, chdir='relocate/gypfiles')
 
34
 
 
35
expect = """\
 
36
Hello from program.c
 
37
Hello from function1.in1
 
38
Hello from function2.in1
 
39
Hello from define3.in0
 
40
Hello from define4.in0
 
41
"""
 
42
 
 
43
if test.format == 'xcode':
 
44
  chdir = 'relocate/rules/subdir1'
 
45
else:
 
46
  chdir = 'relocate/gypfiles'
 
47
test.run_built_executable('program', chdir=chdir, stdout=expect)
 
48
 
 
49
test.must_match('relocate/rules/subdir2/rules-out/file1.out',
 
50
                "Hello from file1.in0\n")
 
51
test.must_match('relocate/rules/subdir2/rules-out/file2.out',
 
52
                "Hello from file2.in0\n")
 
53
test.must_match('relocate/rules/subdir2/rules-out/file3.out',
 
54
                "Hello from file3.in1\n")
 
55
test.must_match('relocate/rules/subdir2/rules-out/file4.out',
 
56
                "Hello from file4.in1\n")
 
57
 
 
58
test.pass_test()