Test fixes: Win32 portability in Delete.py; fix a problem in msvs.py introduced...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 30 Aug 2004 05:04:22 +0000 (05:04 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Mon, 30 Aug 2004 05:04:22 +0000 (05:04 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1047 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/SConfTests.py
src/engine/SCons/UtilTests.py
test/Delete.py
test/msvs.py

index 9b3f2a6246e05d31c3b84f81ddcf16d22a4b7c14..f9c144c32dd4c3a5cf8691eac9fb32e5c1ddd3ad 100644 (file)
@@ -160,6 +160,7 @@ class SConfTestCase(unittest.TestCase):
                         self.name = name
                         self.state = None
                         self.side_effects = []
+                        self.builder = None
                     def has_builder(self):
                         return 1
                     def add_pre_action(self, *actions):
@@ -180,9 +181,22 @@ class SConfTestCase(unittest.TestCase):
                         pass
                     def clear(self):
                         pass
+                    def current(self, calc=None):
+                        return None
+                    def prepare(self):
+                        pass
+                    def retrieve_from_cache(self):
+                        return 0
+                    def build(self, **kw):
+                        return
+                    def built(self):
+                        pass
                 return [MyNode('n1'), MyNode('n2')]
-        self.scons_env.Append(BUILDERS = {'SConfActionBuilder' : MyBuilder()})
-        sconf.TryBuild(self.scons_env.SConfActionBuilder)
+        try:
+            self.scons_env.Append(BUILDERS = {'SConfActionBuilder' : MyBuilder()})
+            sconf.TryBuild(self.scons_env.SConfActionBuilder)
+        finally:
+            sconf.Finish()
 
     def test_TryCompile(self):
         """Test SConf.TryCompile
index 0cda461478038fc11d82251134d610d8c0cfad0a..52f56a710d9f26df04f467208265b03995db2cef 100644 (file)
@@ -1252,8 +1252,14 @@ class UtilTestCase(unittest.TestCase):
         import tempfile
         filename = tempfile.mktemp()
         str = '1234567890 ' + filename
-        open(filename, 'w').write(str)
-        assert open(get_native_path(filename)).read() == str
+        try:
+            open(filename, 'w').write(str)
+            assert open(get_native_path(filename)).read() == str
+        finally:
+            try:
+                os.unlink(filename)
+            except OSError:
+                pass
 
     def test_subst_dict(self):
         """Test substituting dictionary values in an Action
index c57a810f3cc867f822b199592ebbe61165312331..138dc950414c5601f4c4b2e519dccaf4edf0a2d1 100644 (file)
@@ -161,6 +161,8 @@ test.write('f14.in', "f14.in\n")
 
 test.run(status=2, stderr=None)
 
-test.fail_test(string.find(test.stderr(), "No such file or directory") == -1)
+stderr = test.stderr()
+test.fail_test(string.find(stderr, "No such file or directory") == -1 and
+               string.find(stderr, "The system cannot find the path specified") == -1)
 
 test.pass_test()
index fb4190596124b2608737dfdd9b6923984d1ab117..9dfd6f71ac9826ac5f19ee16c569ee2c5aa815fa 100644 (file)
@@ -68,8 +68,8 @@ CFG=Test - Win32 Release
 # PROP BASE Use_Debug_Libraries 0
 # PROP BASE Output_Dir "<WORKPATH>"
 # PROP BASE Intermediate_Dir "<WORKPATH>"
-# PROP BASE Cmd_Line "<PYTHON> -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct <WORKPATH>\Test.exe"
-# PROP BASE Rebuild_Opt "-c && <PYTHON> -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct <WORKPATH>\Test.exe"
+# PROP BASE Cmd_Line ""<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct <WORKPATH>\Test.exe"
+# PROP BASE Rebuild_Opt "-c && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct <WORKPATH>\Test.exe"
 # PROP BASE Target_File "<WORKPATH>\Test.exe"
 # PROP BASE Bsc_Name ""
 # PROP BASE Target_Dir ""
@@ -77,8 +77,8 @@ CFG=Test - Win32 Release
 # PROP Use_Debug_Libraries 0
 # PROP Output_Dir "<WORKPATH>"
 # PROP Intermediate_Dir "<WORKPATH>"
-# PROP Cmd_Line "<PYTHON> -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct <WORKPATH>\Test.exe"
-# PROP Rebuild_Opt "-c && <PYTHON> -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct <WORKPATH>\Test.exe"
+# PROP Cmd_Line ""<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct <WORKPATH>\Test.exe"
+# PROP Rebuild_Opt "-c && "<PYTHON>" -c "<SCONS_SCRIPT_MAIN>" -C <WORKPATH> -f SConstruct <WORKPATH>\Test.exe"
 # PROP Target_File "<WORKPATH>\Test.exe"
 # PROP Bsc_Name ""
 # PROP Target_Dir ""