media/webrtc/trunk/tools/gyp/test/variants/gyptest-variants.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.

     1 #!/usr/bin/env python
     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.
     7 """
     8 Verify handling of build variants.
    10 TODO:  Right now, only the SCons generator supports this, so the
    11 test case is SCons-specific.  In particular, it relise on SCons'
    12 ability to rebuild in response to changes on the command line.  It
    13 may be simpler to just drop this feature if the other generators
    14 can't be made to behave the same way.
    15 """
    17 import TestGyp
    19 test = TestGyp.TestGyp(formats=['scons'])
    21 test.run_gyp('variants.gyp', chdir='src')
    23 test.relocate('src', 'relocate/src')
    25 test.build('variants.gyp', chdir='relocate/src')
    27 test.run_built_executable('variants',
    28                           chdir='relocate/src',
    29                           stdout="Hello, world!\n")
    31 test.sleep()
    32 test.build('variants.gyp', 'VARIANT1=1', chdir='relocate/src')
    34 test.run_built_executable('variants',
    35                           chdir='relocate/src',
    36                           stdout="Hello from VARIANT1\n")
    38 test.sleep()
    39 test.build('variants.gyp', 'VARIANT2=1', chdir='relocate/src')
    41 test.run_built_executable('variants',
    42                           chdir='relocate/src',
    43                           stdout="Hello from VARIANT2\n")
    45 test.pass_test()

mercurial