Windows NT portability.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 31 May 2002 23:52:14 +0000 (23:52 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 31 May 2002 23:52:14 +0000 (23:52 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@380 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Util.py
test/SharedLibrary.py
test/option--debug.py
test/timestamp-fallback.py

index c66b99c872b1be878c93f8100a9986bff2802be1..d366d9ad62590d603363c2a19bba3c28a316dfb7 100644 (file)
@@ -56,10 +56,9 @@ def updrive(path):
     """
     drive, rest = os.path.splitdrive(path)
     if drive:
-       return os.path.join(string.upper(drive),rest)
-    else:
-       return path
-       
+        path = string.upper(drive) + rest
+    return path
+
 class PathList(UserList.UserList):
     """This class emulates the behavior of a list, but also implements
     the special "path dissection" attributes we can use to find
index 8675c4b4f1f4f9f47a7a29cb0ce0558746731246..e1b832cfa6395eb2a9acfd9a36c0122da43de215 100644 (file)
@@ -182,7 +182,7 @@ test.run(program = test.workpath('prog'),
          stdout = "f1.c\nf2a.c\nf2b.c\nf2c.c\nf3a.c\nf3b.c\nf3c.c\nprog.c\n")
 
 test.run(arguments = '-f SConstructFoo', status=2, stderr='''
-SCons error: Source file: foo.o must be built with shared=1 in order to be compatible with the selected target.
+SCons error: Source file: foo\..* must be built with shared=1 in order to be compatible with the selected target.
 File ".*", line .*, in .*
 '''
 )
index a4cf39abd8760ebb7cdc7269a2fc215945673243..95a3a9c2d4342244f43de9a838863fea1feecbd0 100644 (file)
@@ -158,15 +158,19 @@ test.run(arguments = "--debug=time .")
 expected_total_time = time.time() - start_time - overhead
 line = string.split(test.stdout(), '\n')
 
-expected_command_time = num(r'Command execution time: (\d+\.\d+) seconds', line[1])
-expected_command_time = expected_command_time + num(r'Command execution time: (\d+\.\d+) seconds', line[3])
-expected_command_time = expected_command_time + num(r'Command execution time: (\d+\.\d+) seconds', line[5])
-expected_command_time = expected_command_time + num(r'Command execution time: (\d+\.\d+) seconds', line[6])
-
-total_time = num(r'Total build time: (\d+\.\d+) seconds', line[7])
-sconscript_time = num(r'Total SConscript file execution time: (\d+\.\d+) seconds', line[8])
-scons_time = num(r'Total SCons execution time: (\d+\.\d+) seconds', line[9])
-command_time = num(r'Total command execution time: (\d+\.\d+) seconds', line[10])
+cmdline = filter(lambda x: x[:23] == "Command execution time:", line)
+
+expected_command_time = num(r'Command execution time: (\d+\.\d+) seconds', cmdline[0])
+expected_command_time = expected_command_time + num(r'Command execution time: (\d+\.\d+) seconds', cmdline[1])
+expected_command_time = expected_command_time + num(r'Command execution time: (\d+\.\d+) seconds', cmdline[2])
+expected_command_time = expected_command_time + num(r'Command execution time: (\d+\.\d+) seconds', cmdline[3])
+
+totalline = filter(lambda x: x[:6] == "Total ", line)
+
+total_time = num(r'Total build time: (\d+\.\d+) seconds', totalline[0])
+sconscript_time = num(r'Total SConscript file execution time: (\d+\.\d+) seconds', totalline[1])
+scons_time = num(r'Total SCons execution time: (\d+\.\d+) seconds', totalline[2])
+command_time = num(r'Total command execution time: (\d+\.\d+) seconds', totalline[3])
 
 def check(expected, actual, tolerance):
     return abs((expected-actual)/actual) <= tolerance
index bfa4600ea816dbe0f11b256b393e8957bb70ac46..8f5e2624306250d1b4352a4c556ef0a2d52987bd 100644 (file)
 
 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
 
-import os.path
+import imp
 import os
-import string
-import sys
+import os.path
+
 import TestSCons
 
 test = TestSCons.TestSCons()
 
+try:
+    file, name, desc = imp.find_module('md5')
+except ImportError:
+    pass
+else:
+    if desc[2] == imp.C_BUILTIN:
+       print "The 'md5' module is built in to this version of Python."
+       print "Cannot test falling back to timestamps."
+        test.no_result(1);
+
 test.write('md5.py', r"""
 raise ImportError
 """)