summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-12-19 13:28:34 (GMT)
committerSteven Knight <knight@baldmt.com>2003-12-19 13:28:34 (GMT)
commit0e89b87291656533add19491bd698e8ad6c20600 (patch)
tree3a6fd59f303808e01e64fe04c480537ac0039799
parent103bcacbbd14b17ff9e98ee0e88573f357b1ae37 (diff)
downloadSCons-0e89b87291656533add19491bd698e8ad6c20600.zip
SCons-0e89b87291656533add19491bd698e8ad6c20600.tar.gz
SCons-0e89b87291656533add19491bd698e8ad6c20600.tar.bz2
Work around Cygwin Python's broken idea that it's case-sensitive. (Chad Austin)
-rw-r--r--etc/TestSCons.py8
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Node/FS.py5
-rw-r--r--test/CXX.py4
-rw-r--r--test/Case.py81
5 files changed, 96 insertions, 5 deletions
diff --git a/etc/TestSCons.py b/etc/TestSCons.py
index 1ce60e4..028a815 100644
--- a/etc/TestSCons.py
+++ b/etc/TestSCons.py
@@ -94,7 +94,7 @@ class TestNoResult(Exception):
if os.name == 'posix':
def _failed(self, status = 0):
- if self.status is None:
+ if self.status is None or status is None:
return None
if os.WIFSIGNALED(self.status):
return None
@@ -106,7 +106,8 @@ if os.name == 'posix':
return None
elif os.name == 'nt':
def _failed(self, status = 0):
- return not self.status is None and self.status != status
+ return not (self.status is None or status is None) and \
+ self.status != status
def _status(self):
return self.status
@@ -168,7 +169,8 @@ class TestSCons(TestCmd.TestCmd):
don't test error output.
status The expected exit status from the
- command.
+ command. A value of None means don't
+ test exit status.
By default, this does not test standard output (stdout = None),
and expects that error output is empty (stderr = "").
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index 2b598ae..4d0ad9a 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -28,6 +28,9 @@ RELEASE 0.95 - XXX
- Add support for a "toolpath" Tool() and Environment keyword that
allows Tool modules to be found in specified local directories.
+ - Work around Cygwin Python's silly fiction that it's using a
+ case-sensitive file system.
+
From Chris Burghart:
- Fix the ability to save/restore a PackageOption to a file.
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 45809f9..7c4b383 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -41,6 +41,7 @@ import os.path
import shutil
import stat
import string
+import sys
import cStringIO
import SCons.Action
@@ -218,7 +219,9 @@ class ParentOfRoot:
def src_builder(self):
return _null
-if os.path.normcase("TeSt") == os.path.normpath("TeSt"):
+# Cygwin's os.path.normcase pretends it's on a case-sensitive filesystem.
+_is_cygwin = sys.platform == "cygwin"
+if os.path.normcase("TeSt") == os.path.normpath("TeSt") and not _is_cygwin:
def _my_normcase(x):
return x
else:
diff --git a/test/CXX.py b/test/CXX.py
index bff7708..ad2eb10 100644
--- a/test/CXX.py
+++ b/test/CXX.py
@@ -155,7 +155,9 @@ test.fail_test(test.read('test4' + _exe) != "This is a .c++ file.\n")
test.fail_test(test.read('test5' + _exe) != "This is a .C++ file.\n")
-if os.path.normcase('.c') != os.path.normcase('.C'):
+# Cygwin's os.path.normcase pretends it's on a case-sensitive filesystem.
+_is_cygwin = sys.platform == "cygwin"
+if os.path.normcase('.c') != os.path.normcase('.C') and not _is_cygwin:
test.write('SConstruct', """
env = Environment(LINK = r'%s mylink.py',
diff --git a/test/Case.py b/test/Case.py
new file mode 100644
index 0000000..b6f2a93
--- /dev/null
+++ b/test/Case.py
@@ -0,0 +1,81 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import string
+import sys
+import TestSCons
+
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+test.write('SConstruct', """\
+Program('main', [
+ 'main.c',
+ Object('foo.o', 'foo.c'),
+ Object('FOO.O', 'bar.c')])
+""")
+
+test.write('main.c', """\
+void foo();
+void bar();
+int main() {
+ foo();
+ bar();
+ exit (0);
+}
+""")
+
+test.write('foo.c', """\
+#include <stdio.h>
+void foo() {
+ puts("foo");
+}
+""")
+
+test.write('bar.c', """\
+#include <stdio.h>
+void bar() {
+ puts("bar");
+}
+""")
+
+if sys.platform in ['cygwin', 'win32']:
+ print "Using case-insensitive filesystem, testing for failure"
+
+ test.run(stderr = None, status = None)
+ test.fail_test(string.split(test.stderr(), '\n')[0] ==
+ "scons: *** Multiple ways to build the same target were specified for: foo.o")
+
+ test.pass_test()
+
+else:
+ print "Not using case-insensitive filesystem, testing for success"
+
+ test.run()
+ test.run(program = test.workpath('main' + _exe), stdout = "foo\nbar\n")
+
+ test.pass_test()