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

« back to all changes in this revision

Viewing changes to Source/ThirdParty/gyp/test/variables/filelist/gyptest-filelist.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
Test variable expansion of '<|(list.txt ...)' syntax commands.
 
9
"""
 
10
 
 
11
import os
 
12
import sys
 
13
 
 
14
import TestGyp
 
15
 
 
16
test = TestGyp.TestGyp(format='gypd')
 
17
 
 
18
expect = test.read('filelist.gyp.stdout')
 
19
if sys.platform == 'win32':
 
20
  expect = expect.replace('/', r'\\').replace('\r', '')
 
21
 
 
22
# Set $HOME so that gyp doesn't read the user's actual
 
23
# ~/.gyp/include.gypi file, which may contain variables
 
24
# and other settings that would change the output.
 
25
os.environ['HOME'] = test.workpath()
 
26
 
 
27
test.run_gyp('src/filelist.gyp',
 
28
             '--debug', 'variables', '--debug', 'general',
 
29
             stdout=expect)
 
30
 
 
31
# Verify the filelist.gypd against the checked-in expected contents.
 
32
#
 
33
# Normally, we should canonicalize line endings in the expected
 
34
# contents file setting the Subversion svn:eol-style to native,
 
35
# but that would still fail if multiple systems are sharing a single
 
36
# workspace on a network-mounted file system.  Consequently, we
 
37
# massage the Windows line endings ('\r\n') in the output to the
 
38
# checked-in UNIX endings ('\n').
 
39
 
 
40
contents = test.read('src/filelist.gypd').replace(
 
41
    '\r', '').replace('\\\\', '/')
 
42
expect = test.read('filelist.gypd.golden').replace('\r', '')
 
43
if not test.match(contents, expect):
 
44
  print "Unexpected contents of `src/filelist.gypd'"
 
45
  test.diff(expect, contents, 'src/filelist.gypd ')
 
46
  test.fail_test()
 
47
 
 
48
contents = test.read('src/names.txt')
 
49
expect = 'John\nJacob\nJingleheimer\nSchmidt\n'
 
50
if not test.match(contents, expect):
 
51
  print "Unexpected contents of `src/names.txt'"
 
52
  test.diff(expect, contents, 'src/names.txt ')
 
53
  test.fail_test()
 
54
 
 
55
test.pass_test()