media/webrtc/trunk/tools/gyp/test/variables/commands/gyptest-commands-repeated.py

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rwxr-xr-x

Integrate suggestion from review to improve consistency with existing code.

michael@0 1 #!/usr/bin/env python
michael@0 2
michael@0 3 # Copyright (c) 2012 Google Inc. All rights reserved.
michael@0 4 # Use of this source code is governed by a BSD-style license that can be
michael@0 5 # found in the LICENSE file.
michael@0 6
michael@0 7 """
michael@0 8 Test variable expansion of '<!()' syntax commands where they are evaluated
michael@0 9 more then once..
michael@0 10 """
michael@0 11
michael@0 12 import TestGyp
michael@0 13
michael@0 14 test = TestGyp.TestGyp(format='gypd')
michael@0 15
michael@0 16 expect = test.read('commands-repeated.gyp.stdout').replace('\r\n', '\n')
michael@0 17
michael@0 18 test.run_gyp('commands-repeated.gyp',
michael@0 19 '--debug', 'variables',
michael@0 20 stdout=expect, ignore_line_numbers=True)
michael@0 21
michael@0 22 # Verify the commands-repeated.gypd against the checked-in expected contents.
michael@0 23 #
michael@0 24 # Normally, we should canonicalize line endings in the expected
michael@0 25 # contents file setting the Subversion svn:eol-style to native,
michael@0 26 # but that would still fail if multiple systems are sharing a single
michael@0 27 # workspace on a network-mounted file system. Consequently, we
michael@0 28 # massage the Windows line endings ('\r\n') in the output to the
michael@0 29 # checked-in UNIX endings ('\n').
michael@0 30
michael@0 31 contents = test.read('commands-repeated.gypd').replace('\r\n', '\n')
michael@0 32 expect = test.read('commands-repeated.gypd.golden').replace('\r\n', '\n')
michael@0 33 if not test.match(contents, expect):
michael@0 34 print "Unexpected contents of `commands-repeated.gypd'"
michael@0 35 test.diff(expect, contents, 'commands-repeated.gypd ')
michael@0 36 test.fail_test()
michael@0 37
michael@0 38 test.pass_test()

mercurial