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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 #!/usr/bin/env python
     3 # Copyright (c) 2012 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.
     7 """
     8 Test that environment variables are ignored when --ignore-environment is
     9 specified.
    10 """
    12 import os
    14 import TestGyp
    16 test = TestGyp.TestGyp(format='gypd')
    18 os.environ['GYP_DEFINES'] = 'FOO=BAR'
    19 os.environ['GYP_GENERATORS'] = 'foo'
    20 os.environ['GYP_GENERATOR_FLAGS'] = 'genflag=foo'
    21 os.environ['GYP_GENERATOR_OUTPUT'] = 'somedir'
    23 expect = test.read('commands.gyp.ignore-env.stdout').replace('\r\n', '\n')
    25 test.run_gyp('commands.gyp',
    26              '--debug', 'variables',
    27              '--ignore-environment',
    28              stdout=expect, ignore_line_numbers=True)
    30 # Verify the commands.gypd against the checked-in expected contents.
    31 #
    32 # Normally, we should canonicalize line endings in the expected
    33 # contents file setting the Subversion svn:eol-style to native,
    34 # but that would still fail if multiple systems are sharing a single
    35 # workspace on a network-mounted file system.  Consequently, we
    36 # massage the Windows line endings ('\r\n') in the output to the
    37 # checked-in UNIX endings ('\n').
    39 contents = test.read('commands.gypd').replace('\r', '')
    40 expect = test.read('commands.gypd.golden').replace('\r', '')
    41 if not test.match(contents, expect):
    42   print "Unexpected contents of `commands.gypd'"
    43   test.diff(expect, contents, 'commands.gypd ')
    44   test.fail_test()
    46 test.pass_test()

mercurial