gyptest-generated-header.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env python
  2. # Copyright (c) 2013 Google Inc. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """
  6. Verifies that dependencies on generated headers work, even if the header has
  7. a mixed-case file name.
  8. """
  9. import TestGyp
  10. test = TestGyp.TestGyp()
  11. if test.format == 'android':
  12. # This test currently fails on android. Investigate why, fix the issues
  13. # responsible, and reenable this test on android. See bug:
  14. # https://code.google.com/p/gyp/issues/detail?id=436
  15. test.skip_test(message='Test fails on android. Fix and reenable.\n')
  16. CHDIR = 'generated-header'
  17. test.run_gyp('test.gyp', chdir=CHDIR)
  18. test.build('test.gyp', 'program', chdir=CHDIR)
  19. test.up_to_date('test.gyp', 'program', chdir=CHDIR)
  20. expect = 'foobar output\n'
  21. test.run_built_executable('program', chdir=CHDIR, stdout=expect)
  22. # Change what's written to the generated header, regyp and rebuild, and check
  23. # that the change makes it to the executable and that the build is clean.
  24. test.sleep()
  25. test.write('generated-header/test.gyp',
  26. test.read('generated-header/test.gyp').replace('foobar', 'barbaz'))
  27. test.run_gyp('test.gyp', chdir=CHDIR)
  28. test.build('test.gyp', 'program', chdir=CHDIR)
  29. test.up_to_date('test.gyp', 'program', chdir=CHDIR)
  30. expect = 'barbaz output\n'
  31. test.run_built_executable('program', chdir=CHDIR, stdout=expect)
  32. test.pass_test()