Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | # Copyright (c) 2013 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. |
| 6 | |
| 7 | """ |
| 8 | Verifies inclusion of $HOME/.gyp_new/include.gypi works when GYP_CONFIG_DIR |
| 9 | is set. |
| 10 | """ |
| 11 | |
| 12 | import os |
| 13 | import TestGyp |
| 14 | |
| 15 | test = TestGyp.TestGyp() |
| 16 | |
| 17 | os.environ['HOME'] = os.path.abspath('home') |
| 18 | os.environ['GYP_CONFIG_DIR'] = os.path.join(os.path.abspath('home2'), |
| 19 | '.gyp_new') |
| 20 | |
| 21 | test.run_gyp('all.gyp', chdir='src') |
| 22 | |
| 23 | # After relocating, we should still be able to build (build file shouldn't |
| 24 | # contain relative reference to ~/.gyp_new/include.gypi) |
| 25 | test.relocate('src', 'relocate/src') |
| 26 | |
| 27 | test.build('all.gyp', test.ALL, chdir='relocate/src') |
| 28 | |
| 29 | test.run_built_executable('printfoo', |
| 30 | chdir='relocate/src', |
| 31 | stdout='FOO is fromhome3\n') |
| 32 | |
| 33 | test.pass_test() |