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 if test.format == 'android': 17 # This test currently fails on android. Investigate why, fix the issues 18 # responsible, and reenable this test on android. See bug: 19 # https://code.google.com/p/gyp/issues/detail?id=436 20 test.skip_test(message='Test fails on android. Fix and reenable.\n') 21 22 CHDIR = 'generated-header' 23 24 test.run_gyp('test.gyp', chdir=CHDIR) 25 test.build('test.gyp', 'program', chdir=CHDIR) 26 test.up_to_date('test.gyp', 'program', chdir=CHDIR) 27 28 expect = 'foobar output\n' 29 test.run_built_executable('program', chdir=CHDIR, stdout=expect) 30 31 # Change what's written to the generated header, regyp and rebuild, and check 32 # that the change makes it to the executable and that the build is clean. 33 test.sleep() 34 test.write('generated-header/test.gyp', 35 test.read('generated-header/test.gyp').replace('foobar', 'barbaz')) 36 37 test.run_gyp('test.gyp', chdir=CHDIR) 38 test.build('test.gyp', 'program', chdir=CHDIR) 39 test.up_to_date('test.gyp', 'program', chdir=CHDIR) 40 41 expect = 'barbaz output\n' 42 test.run_built_executable('program', chdir=CHDIR, stdout=expect) 43 44 test.pass_test() 45