Home | History | Annotate | Download | only in actions
      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 """
      8 Verifies that dependencies on generated headers work, even if the header has
      9 a mixed-case file name.
     10 """
     11 
     12 import TestGyp
     13 
     14 test = TestGyp.TestGyp()
     15 
     16 CHDIR = 'generated-header'
     17 
     18 test.run_gyp('test.gyp', chdir=CHDIR)
     19 test.build('test.gyp', 'program', chdir=CHDIR)
     20 test.up_to_date('test.gyp', 'program', chdir=CHDIR)
     21 
     22 expect = 'foobar output\n'
     23 test.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.
     27 test.sleep()
     28 test.write('generated-header/test.gyp',
     29            test.read('generated-header/test.gyp').replace('foobar', 'barbaz'))
     30 
     31 test.run_gyp('test.gyp', chdir=CHDIR)
     32 test.build('test.gyp', 'program', chdir=CHDIR)
     33 test.up_to_date('test.gyp', 'program', chdir=CHDIR)
     34 
     35 expect = 'barbaz output\n'
     36 test.run_built_executable('program', chdir=CHDIR, stdout=expect)
     37 
     38 test.pass_test()
     39