From 4faa0280b31792a8ce58c2cc8877c67279a55f6b Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Mon, 3 Jan 2005 20:35:15 +0000 Subject: Win32 portability fixes. --- src/engine/SCons/Node/NodeTests.py | 2 +- src/engine/SCons/Util.py | 4 ++-- src/engine/SCons/UtilTests.py | 14 ++++++++++---- test/Java/JAVACCOMSTR.py | 11 +++++++++-- test/RCS/implicit.py | 8 +++++++- test/multi.py | 6 ++++-- test/pre-post-actions.py | 5 +++-- test/scan-once.py | 4 ++-- 8 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py index 106e44e..ee0e82b 100644 --- a/src/engine/SCons/Node/NodeTests.py +++ b/src/engine/SCons/Node/NodeTests.py @@ -1179,7 +1179,7 @@ class NodeListTestCase(unittest.TestCase): assert s == "['n3', 'n2', 'n1']", s r = repr(nl) - r = re.sub('at (0x)?[0-9a-z]+', 'at 0x', r) + r = re.sub('at (0[xX])?[0-9a-fA-F]+', 'at 0x', r) # Don't care about ancestry: just leaf value of MyNode r = re.sub('<.*?\.MyNode', ' foo.c diff --git a/test/multi.py b/test/multi.py index 7ae1736..1977679 100644 --- a/test/multi.py +++ b/test/multi.py @@ -28,9 +28,11 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test various cases where a target is "built" by multiple builder calls. """ +import os.path +import string + import TestCmd import TestSCons -import os.path test = TestSCons.TestSCons(match=TestCmd.match_re) @@ -173,7 +175,7 @@ test.run(arguments='file4.out', stderr=TestSCons.re_escape(""" scons: warning: Two different environments were specified for target file4.out, but they appear to have the same action: %(python)s build.py \$foo \$TARGET \$SOURCES -""" % {'python':TestSCons.python}) + TestSCons.file_expr) +""" % {'python':string.replace(TestSCons.python, '\\', '\\\\')}) + TestSCons.file_expr) test.must_match('file4.out', "3\nfile4a.in\nfile4b.in\n") diff --git a/test/pre-post-actions.py b/test/pre-post-actions.py index 860ae24..2d8458c 100644 --- a/test/pre-post-actions.py +++ b/test/pre-post-actions.py @@ -28,6 +28,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os +import os.path import stat import sys import TestSCons @@ -162,8 +163,8 @@ env.Command('dir/file', [], build) test.run(chdir = 'work3', arguments = 'dir/file', stdout=test.wrap_stdout("""\ pre(["dir"], []) post(["dir"], []) -build(["dir/file"], []) -""")) +build(["%s"], []) +""" % os.path.join('dir', 'file'))) test.must_match(['work3', 'dir', 'file'], "build()\n") diff --git a/test/scan-once.py b/test/scan-once.py index 4436310..cdacccc 100644 --- a/test/scan-once.py +++ b/test/scan-once.py @@ -96,7 +96,7 @@ test.write(['SLF', 'SConscript'], """\ ### don't seem to work well! ARRGH!!!! ### -experimenttop = "%s" +experimenttop = r"%s" import os import os.path @@ -287,7 +287,7 @@ static_hdrs = "libg_w.h" #exported_hdrs = generated_hdrs + " " + static_hdrs exported_hdrs = static_hdrs lib_name = "g" -lib_fullname = "libg.a" +lib_fullname = env.subst("${LIBPREFIX}g${LIBSUFFIX}") lib_srcs = string.split("libg_1.c libg_2.c libg_3.c") import re lib_objs = map(lambda x: re.sub("\.c$", ".o", x), lib_srcs) -- cgit v0.12