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