From: stevenknight Date: Fri, 14 Dec 2001 01:42:15 +0000 (+0000) Subject: Last Windows NT portability fixes (this release). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=59d5986f38de7314ed0bee8bcf6cf173f615d803;p=scons.git Last Windows NT portability fixes (this release). git-svn-id: http://scons.tigris.org/svn/scons/trunk@152 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py index 575cb775..6590daf2 100644 --- a/src/engine/SCons/BuilderTests.py +++ b/src/engine/SCons/BuilderTests.py @@ -30,6 +30,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" def Func(): pass +import os.path import sys import unittest @@ -281,13 +282,13 @@ class BuilderTestCase(unittest.TestCase): 'LIBLINKSUFFIX' : '', 'LIBPATH' : ['lib'], 'LIBDIRPREFIX' : '-L', - 'LIBDIRSUFFIX' : '/', + 'LIBDIRSUFFIX' : 'X', 'CPPPATH' : ['c', 'p'], 'INCPREFIX' : '-I', 'INCSUFFIX' : ''} contents = apply(b4.get_contents, (), kw) - assert contents == "-ll1 -ll2 -Llib/ -Ic -Ip", contents + assert contents == "-ll1 -ll2 -LlibX -Ic -Ip", contents # SCons.Node.FS has been imported by our import of # SCons.Node.Builder. It's kind of bogus that we don't @@ -296,7 +297,8 @@ class BuilderTestCase(unittest.TestCase): # to the other module via a direct import. kw['dir'] = SCons.Node.FS.default_fs.Dir('d') contents = apply(b4.get_contents, (), kw) - assert contents == "-ld/l1 -ld/l2 -Ld/lib/ -Id/c -Id/p", contents + expect = os.path.normpath("-ld/l1 -ld/l2 -Ld/libX -Id/c -Id/p") + assert contents == expect, contents + " != " + expect def test_name(self): """Test Builder creation with a specified name diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 523f96b9..45f8e643 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -24,6 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os +import os.path import string import sys import unittest @@ -367,7 +368,7 @@ class FSTestCase(unittest.TestCase): val[d] = 'd' val[e] = 'e' for k, v in val.items(): - assert k == "hash/" + v + assert k == os.path.normpath("hash/" + v) #XXX test exists() diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py index adcd5862..2952fc43 100644 --- a/src/engine/SCons/UtilTests.py +++ b/src/engine/SCons/UtilTests.py @@ -167,7 +167,7 @@ class UtilTestCase(unittest.TestCase): fs = SCons.Node.FS.FS(test.workpath("")) node_derived = fs.File(test.workpath('./bar/baz')) node_derived.builder_set(1) # Any non-zero value. - paths = map(lambda x, fs=fs: fs.Dir(x), ['./', './bar']) + paths = map(lambda x, fs=fs: fs.Dir(x), ['.', './bar']) nodes = find_files(['foo', 'baz'], paths, fs.File) file_names = map(str, nodes) file_names = map(os.path.normpath, file_names) @@ -193,11 +193,11 @@ class UtilTestCase(unittest.TestCase): 'INCSUFFIX' : 'bar'} autogenerate(dict, dir = SCons.Node.FS.default_fs.Dir('/xx')) assert len(dict['_INCFLAGS']) == 3, dict('_INCFLAGS') - assert dict['_INCFLAGS'][0] == 'foo/xx/foobar', \ + assert dict['_INCFLAGS'][0] == os.path.normpath('foo/xx/foobar'), \ dict['_INCFLAGS'][0] - assert dict['_INCFLAGS'][1] == 'foo/xx/barbar', \ + assert dict['_INCFLAGS'][1] == os.path.normpath('foo/xx/barbar'), \ dict['_INCFLAGS'][1] - assert dict['_INCFLAGS'][2] == 'foo/xx/bazbar', \ + assert dict['_INCFLAGS'][2] == os.path.normpath('foo/xx/bazbar'), \ dict['_INCFLAGS'][2]