OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 # Copyright (c) 2015 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 actions with multiple outputs & dependncies will correctly rebuild. |
| 9 |
| 10 This is a regression test for crrev.com/1177163002. |
| 11 """ |
| 12 |
| 13 import TestGyp |
| 14 import os |
| 15 import time |
| 16 |
| 17 test = TestGyp.TestGyp() |
| 18 |
| 19 TESTDIR='relocate/src' |
| 20 test.run_gyp('action.gyp', chdir='src') |
| 21 test.relocate('src', TESTDIR) |
| 22 |
| 23 def build_and_check(content): |
| 24 test.write(TESTDIR + '/input.txt', content) |
| 25 test.build('action.gyp', 'upper', chdir=TESTDIR) |
| 26 test.built_file_must_match('result.txt', content, chdir=TESTDIR) |
| 27 |
| 28 build_and_check('Content for first build.') |
| 29 |
| 30 # Ninja works with timestamps and the test above is fast enough that the |
| 31 # 'updated' file may end up with the same timestamp as the original, meaning |
| 32 # that ninja may not always recognize the input file has changed. |
| 33 if test.format == 'ninja': |
| 34 time.sleep(1) |
| 35 |
| 36 build_and_check('An updated input file.') |
| 37 |
| 38 test.pass_test() |
OLD | NEW |