Ben Murdoch | 097c5b2 | 2016-05-18 11:27:45 +0100 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | # Copyright (c) 2014 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 | Verify that running gyp in a different directory does not cause actions and |
| 9 | rules to rerun. |
| 10 | """ |
| 11 | |
| 12 | import os |
| 13 | import sys |
| 14 | import TestGyp |
| 15 | |
| 16 | test = TestGyp.TestGyp(formats=['ninja']) |
| 17 | # The xcode-ninja generator handles gypfiles which are not at the |
| 18 | # project root incorrectly. |
| 19 | # cf. https://code.google.com/p/gyp/issues/detail?id=460 |
| 20 | if test.format == 'xcode-ninja': |
| 21 | test.skip_test() |
| 22 | |
| 23 | test.run_gyp('subdir/action-rule-hash.gyp') |
| 24 | test.build('subdir/action-rule-hash.gyp', test.ALL) |
| 25 | test.up_to_date('subdir/action-rule-hash.gyp') |
| 26 | |
| 27 | # Verify that everything is still up-to-date when we re-invoke gyp from a |
| 28 | # different directory. |
| 29 | test.run_gyp('action-rule-hash.gyp', '--depth=../', chdir='subdir') |
| 30 | test.up_to_date('subdir/action-rule-hash.gyp') |
| 31 | |
| 32 | test.pass_test() |