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

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 Verifies that a project hierarchy created with the --generator-output=
michael@0 9 option can be built even when it's relocated to a different path.
michael@0 10 """
michael@0 11
michael@0 12 import TestGyp
michael@0 13
michael@0 14 # Ninja and Android don't support --generator-output.
michael@0 15 test = TestGyp.TestGyp(formats=['!ninja', '!android'])
michael@0 16
michael@0 17 test.writable(test.workpath('src'), False)
michael@0 18
michael@0 19 test.run_gyp('prog1.gyp',
michael@0 20 '-Dset_symroot=1',
michael@0 21 '--generator-output=' + test.workpath('gypfiles'),
michael@0 22 chdir='src')
michael@0 23
michael@0 24 test.writable(test.workpath('src'), True)
michael@0 25
michael@0 26 test.relocate('src', 'relocate/src')
michael@0 27 test.relocate('gypfiles', 'relocate/gypfiles')
michael@0 28
michael@0 29 test.writable(test.workpath('relocate/src'), False)
michael@0 30
michael@0 31 test.writable(test.workpath('relocate/src/build'), True)
michael@0 32 test.writable(test.workpath('relocate/src/subdir2/build'), True)
michael@0 33 test.writable(test.workpath('relocate/src/subdir3/build'), True)
michael@0 34
michael@0 35 test.build('prog1.gyp', test.ALL, chdir='relocate/gypfiles')
michael@0 36
michael@0 37 chdir = 'relocate/gypfiles'
michael@0 38
michael@0 39 expect = """\
michael@0 40 Hello from %s
michael@0 41 Hello from inc.h
michael@0 42 Hello from inc1/include1.h
michael@0 43 Hello from inc2/include2.h
michael@0 44 Hello from inc3/include3.h
michael@0 45 Hello from subdir2/deeper/deeper.h
michael@0 46 """
michael@0 47
michael@0 48 if test.format == 'xcode':
michael@0 49 chdir = 'relocate/src'
michael@0 50 test.run_built_executable('prog1', chdir=chdir, stdout=expect % 'prog1.c')
michael@0 51
michael@0 52 if test.format == 'xcode':
michael@0 53 chdir = 'relocate/src/subdir2'
michael@0 54 test.run_built_executable('prog2', chdir=chdir, stdout=expect % 'prog2.c')
michael@0 55
michael@0 56 if test.format == 'xcode':
michael@0 57 chdir = 'relocate/src/subdir3'
michael@0 58 test.run_built_executable('prog3', chdir=chdir, stdout=expect % 'prog3.c')
michael@0 59
michael@0 60 test.pass_test()

mercurial