blob: cd5bd691a69a7f8f65ceefc724c3010ebdd62cbb [file] [log] [blame]
Ben Murdoch097c5b22016-05-18 11:27:45 +01001#!/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 dependencies on generated headers work, even if the header has
9a mixed-case file name.
10"""
11
12import TestGyp
13
14test = TestGyp.TestGyp()
15
16CHDIR = 'generated-header'
17
18test.run_gyp('test.gyp', chdir=CHDIR)
19test.build('test.gyp', 'program', chdir=CHDIR)
20test.up_to_date('test.gyp', 'program', chdir=CHDIR)
21
22expect = 'foobar output\n'
23test.run_built_executable('program', chdir=CHDIR, stdout=expect)
24
25# Change what's written to the generated header, regyp and rebuild, and check
26# that the change makes it to the executable and that the build is clean.
27test.sleep()
28test.write('generated-header/test.gyp',
29 test.read('generated-header/test.gyp').replace('foobar', 'barbaz'))
30
31test.run_gyp('test.gyp', chdir=CHDIR)
32test.build('test.gyp', 'program', chdir=CHDIR)
33test.up_to_date('test.gyp', 'program', chdir=CHDIR)
34
35expect = 'barbaz output\n'
36test.run_built_executable('program', chdir=CHDIR, stdout=expect)
37
38test.pass_test()