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

changeset 0
6474c204b198
     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-repeated.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     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 where they are evaluated
    1.12 +more then once..
    1.13 +"""
    1.14 +
    1.15 +import TestGyp
    1.16 +
    1.17 +test = TestGyp.TestGyp(format='gypd')
    1.18 +
    1.19 +expect = test.read('commands-repeated.gyp.stdout').replace('\r\n', '\n')
    1.20 +
    1.21 +test.run_gyp('commands-repeated.gyp',
    1.22 +             '--debug', 'variables',
    1.23 +             stdout=expect, ignore_line_numbers=True)
    1.24 +
    1.25 +# Verify the commands-repeated.gypd against the checked-in expected contents.
    1.26 +#
    1.27 +# Normally, we should canonicalize line endings in the expected
    1.28 +# contents file setting the Subversion svn:eol-style to native,
    1.29 +# but that would still fail if multiple systems are sharing a single
    1.30 +# workspace on a network-mounted file system.  Consequently, we
    1.31 +# massage the Windows line endings ('\r\n') in the output to the
    1.32 +# checked-in UNIX endings ('\n').
    1.33 +
    1.34 +contents = test.read('commands-repeated.gypd').replace('\r\n', '\n')
    1.35 +expect = test.read('commands-repeated.gypd.golden').replace('\r\n', '\n')
    1.36 +if not test.match(contents, expect):
    1.37 +  print "Unexpected contents of `commands-repeated.gypd'"
    1.38 +  test.diff(expect, contents, 'commands-repeated.gypd ')
    1.39 +  test.fail_test()
    1.40 +
    1.41 +test.pass_test()

mercurial