gyptest-filecase.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python
  2. # Copyright (c) 2012 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. Checks that files whose file case changes get rebuilt correctly.
  7. """
  8. import os
  9. import TestGyp
  10. test = TestGyp.TestGyp()
  11. CHDIR = 'filecase'
  12. test.run_gyp('test.gyp', chdir=CHDIR)
  13. test.build('test.gyp', test.ALL, chdir=CHDIR)
  14. os.rename('filecase/file.c', 'filecase/fIlE.c')
  15. test.write('filecase/test.gyp',
  16. test.read('filecase/test.gyp').replace('file.c', 'fIlE.c'))
  17. test.run_gyp('test.gyp', chdir=CHDIR)
  18. test.build('test.gyp', test.ALL, chdir=CHDIR)
  19. # Check that having files that differ just in their case still work on
  20. # case-sensitive file systems.
  21. test.write('filecase/FiLe.c', 'int f(); int main() { return f(); }')
  22. test.write('filecase/fIlE.c', 'int f() { return 42; }')
  23. is_case_sensitive = test.read('filecase/FiLe.c') != test.read('filecase/fIlE.c')
  24. if is_case_sensitive:
  25. test.run_gyp('test-casesensitive.gyp', chdir=CHDIR)
  26. test.build('test-casesensitive.gyp', test.ALL, chdir=CHDIR)
  27. test.pass_test()