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
Test variable expansion of '<|(list.txt ...)' syntax commands.
16
test = TestGyp.TestGyp(format='gypd')
18
expect = test.read('filelist.gyp.stdout')
19
if sys.platform == 'win32':
20
expect = expect.replace('/', r'\\').replace('\r', '')
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()
27
test.run_gyp('src/filelist.gyp',
28
'--debug', 'variables', '--debug', 'general',
31
# Verify the filelist.gypd against the checked-in expected contents.
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').
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 ')
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 ')