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