• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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"""
8Verifies actions with multiple outputs & dependncies will correctly rebuild.
9
10This is a regression test for crrev.com/1177163002.
11"""
12
13import TestGyp
14import os
15import sys
16import time
17
18if sys.platform in ('darwin', 'win32'):
19  print "This test is currently disabled: https://crbug.com/483696."
20  sys.exit(0)
21
22test = TestGyp.TestGyp()
23
24TESTDIR='relocate/src'
25test.run_gyp('action.gyp', chdir='src')
26test.relocate('src', TESTDIR)
27
28def build_and_check(content):
29  test.write(TESTDIR + '/input.txt', content)
30  test.build('action.gyp', 'upper', chdir=TESTDIR)
31  test.built_file_must_match('result.txt', content, chdir=TESTDIR)
32
33build_and_check('Content for first build.')
34
35# Ninja works with timestamps and the test above is fast enough that the
36# 'updated' file may end up with the same timestamp as the original, meaning
37# that ninja may not always recognize the input file has changed.
38if test.format == 'ninja':
39  time.sleep(1)
40
41build_and_check('An updated input file.')
42
43test.pass_test()
44