Win32 portability.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 6 Jul 2004 10:56:29 +0000 (10:56 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 6 Jul 2004 10:56:29 +0000 (10:56 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@997 fdb21ef1-2011-0410-befe-b5e4ea1792b1

test/Builder-factories.py
test/DSUFFIXES.py
test/bad-drive.py

index 6007d45d6dfc12f59835ca95f4ace714e42da874..8bdcd3a140559ea5d9161bd3aa3c0e4096cc0f29 100644 (file)
@@ -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)
index 188da9bd72c350fcc92706aa2f5e2bd853810f77..9a5a55a14991d520ffe47d6d03756df7d6d5722b 100644 (file)
@@ -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')
index 612b24b033420346cb1ef76ffd6ebb13e6f9d925..1b733a5dcb2239e96a8d3fbd7d3eb11ca6945ac8 100644 (file)
@@ -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',