From dda974d133bd371862466986cd77c8b2e0702d9c Mon Sep 17 00:00:00 2001 From: stevenknight Date: Tue, 6 Jul 2004 10:56:29 +0000 Subject: [PATCH] Win32 portability. git-svn-id: http://scons.tigris.org/svn/scons/trunk@997 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- test/Builder-factories.py | 4 ++-- test/DSUFFIXES.py | 16 +++++++++++----- test/bad-drive.py | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/test/Builder-factories.py b/test/Builder-factories.py index 6007d45d..8bdcd3a1 100644 --- a/test/Builder-factories.py +++ b/test/Builder-factories.py @@ -43,10 +43,10 @@ import os.path def mkdir(env, source, target): t = str(target[0]) os.makedirs(t) - open(os.path.join(t, 'marker'), 'w').write("MakeDirectory\\n") + open(os.path.join(t, 'marker'), 'wb').write("MakeDirectory\\n") MakeDirectory = Builder(action=mkdir, target_factory=Dir) def collect(env, source, target): - out = open(str(target[0]), 'w') + out = open(str(target[0]), 'wb') dir = str(source[0]) for f in os.listdir(dir): f = os.path.join(dir, f) diff --git a/test/DSUFFIXES.py b/test/DSUFFIXES.py index 188da9bd..9a5a55a1 100644 --- a/test/DSUFFIXES.py +++ b/test/DSUFFIXES.py @@ -50,11 +50,17 @@ sys.exit(0) """) test.write('SConstruct', """ -env = Environment(DPATH = ['.'], - DC = r'%s mydc.py', - DFLAGS = [], - DCOM = '$DC $TARGET $SOURCES', - OBJSUFFIX = '.o') +# Force the 'dmd' tool to get added to the Environment, even if it's not +# installed, so we get its definition of variables to deal with turning +# '.d' suffix files into objects. +env = Environment() +Tool('dmd')(env) +# Now replace those suffixes with our fake-D things. +env.Replace(DPATH = ['.'], + DC = r'%s mydc.py', + DFLAGS = [], + DCOM = '$DC $TARGET $SOURCES', + OBJSUFFIX = '.o') env.Append(CPPSUFFIXES = ['.x']) env.Object(target = 'test1', source = 'test1.d') env.InstallAs('test1_d', 'test1.d') diff --git a/test/bad-drive.py b/test/bad-drive.py index 612b24b0..1b733a5d 100644 --- a/test/bad-drive.py +++ b/test/bad-drive.py @@ -86,7 +86,7 @@ test.run(arguments = 'aaa.out') test.fail_test(test.read('aaa.out') != "aaa.in\n") test.run(arguments = bad_drive + 'not_mentioned', - stderr = "scons: *** No drive `%s' for target `%snot_mentioned'. Stop.\n" % (bad_drive, bad_drive), + stderr = "scons: *** Do not know how to make target `%snot_mentioned'. Stop.\n" % (bad_drive,), status = 2) test.run(arguments = bad_drive + 'no_target_1', -- 2.26.2