1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/webrtc/trunk/tools/gyp/test/variables/commands/gyptest-commands.py Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +# Copyright (c) 2012 Google Inc. All rights reserved. 1.7 +# Use of this source code is governed by a BSD-style license that can be 1.8 +# found in the LICENSE file. 1.9 + 1.10 +""" 1.11 +Test variable expansion of '<!()' syntax commands. 1.12 +""" 1.13 + 1.14 +import os 1.15 + 1.16 +import TestGyp 1.17 + 1.18 +test = TestGyp.TestGyp(format='gypd') 1.19 + 1.20 +expect = test.read('commands.gyp.stdout').replace('\r', '') 1.21 + 1.22 +test.run_gyp('commands.gyp', 1.23 + '--debug', 'variables', 1.24 + stdout=expect, ignore_line_numbers=True) 1.25 + 1.26 +# Verify the commands.gypd against the checked-in expected contents. 1.27 +# 1.28 +# Normally, we should canonicalize line endings in the expected 1.29 +# contents file setting the Subversion svn:eol-style to native, 1.30 +# but that would still fail if multiple systems are sharing a single 1.31 +# workspace on a network-mounted file system. Consequently, we 1.32 +# massage the Windows line endings ('\r\n') in the output to the 1.33 +# checked-in UNIX endings ('\n'). 1.34 + 1.35 +contents = test.read('commands.gypd').replace('\r', '') 1.36 +expect = test.read('commands.gypd.golden').replace('\r', '') 1.37 +if not test.match(contents, expect): 1.38 + print "Unexpected contents of `commands.gypd'" 1.39 + test.diff(expect, contents, 'commands.gypd ') 1.40 + test.fail_test() 1.41 + 1.42 +test.pass_test()