• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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"""
8Verifies that Makefiles get rebuilt when a source gyp file changes and
9--generator-output is used.
10"""
11
12import TestGyp
13
14# Regenerating build files when a gyp file changes is currently only supported
15# by the make and Android generators, and --generator-output is not supported
16# by Android and ninja, so we can only test for make.
17test = TestGyp.TestGyp(formats=['make'])
18
19CHDIR='generator-output'
20
21test.run_gyp('hello.gyp', '--generator-output=%s' % CHDIR)
22
23test.build('hello.gyp', test.ALL, chdir=CHDIR)
24
25test.run_built_executable('hello', stdout="Hello, world!\n", chdir=CHDIR)
26
27# Sleep so that the changed gyp file will have a newer timestamp than the
28# previously generated build files.
29test.sleep()
30test.write('hello.gyp', test.read('hello2.gyp'))
31
32test.build('hello.gyp', test.ALL, chdir=CHDIR)
33
34test.run_built_executable('hello', stdout="Hello, two!\n", chdir=CHDIR)
35
36test.pass_test()
37