1#!/usr/bin/env python
2
3# Copyright (c) 2009 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 don't get rebuilt when a source gyp file changes and
9the disable_regeneration generator flag is set.
10"""
11
12import TestGyp
13
14test = TestGyp.TestGyp()
15
16test.run_gyp('hello.gyp', '-Gauto_regeneration=0')
17
18test.build('hello.gyp', test.ALL)
19
20test.run_built_executable('hello', stdout="Hello, world!\n")
21
22# Sleep so that the changed gyp file will have a newer timestamp than the
23# previously generated build files.
24test.sleep()
25test.write('hello.gyp', test.read('hello2.gyp'))
26
27test.build('hello.gyp', test.ALL)
28
29# Should still be the old executable, as regeneration was disabled.
30test.run_built_executable('hello', stdout="Hello, world!\n")
31
32test.pass_test()
33