[Checkins] SVN: z3c.recipe.compattest/branches/jim-windows-whimper/src/z3c/recipe/compattest/runner. checkpoint

Jim Fulton jim at zope.com
Sun Aug 16 10:23:32 EDT 2009


Log message for revision 102855:
  checkpoint

Changed:
  U   z3c.recipe.compattest/branches/jim-windows-whimper/src/z3c/recipe/compattest/runner.py
  U   z3c.recipe.compattest/branches/jim-windows-whimper/src/z3c/recipe/compattest/runner.txt

-=-
Modified: z3c.recipe.compattest/branches/jim-windows-whimper/src/z3c/recipe/compattest/runner.py
===================================================================
--- z3c.recipe.compattest/branches/jim-windows-whimper/src/z3c/recipe/compattest/runner.py	2009-08-16 13:46:27 UTC (rev 102854)
+++ z3c.recipe.compattest/branches/jim-windows-whimper/src/z3c/recipe/compattest/runner.py	2009-08-16 14:23:32 UTC (rev 102855)
@@ -15,10 +15,14 @@
 options you can use, refer to the test runner documentation.
 """ % sys.argv[0]
 
+windoze = sys.platform.startswith('win')
+
 class Job(object):
 
     def __init__(self, script, args):
         self.script = script
+        if windoze:
+            self.script += '-script.py'
         self.args = args
         self.name = os.path.basename(script)
         self.output = StringIO.StringIO()
@@ -31,15 +35,19 @@
             stdin=subprocess.PIPE,
             stdout=subprocess.PIPE,
             stderr=subprocess.STDOUT,
-            close_fds=True)
+            close_fds = not windoze,
+            )
 
     def poll(self):
         self.exitcode = self.process.poll()
         if self.exitcode is not None:
             self.end = time.time()
-        read, _, _ = select.select([self.process.stdout], [], [], 0.01)
-        if read:
-            self.output.write(read[0].read())
+            # We're done, get it all
+            data = self.process.stdout.read()
+        else:
+            # We're not done, so just get some
+            data = self.process.stdout.readline()
+        self.output.write(data.replace('\r\n', '\n'))
 
 
 def main(max_jobs, *scripts):

Modified: z3c.recipe.compattest/branches/jim-windows-whimper/src/z3c/recipe/compattest/runner.txt
===================================================================
--- z3c.recipe.compattest/branches/jim-windows-whimper/src/z3c/recipe/compattest/runner.txt	2009-08-16 13:46:27 UTC (rev 102854)
+++ z3c.recipe.compattest/branches/jim-windows-whimper/src/z3c/recipe/compattest/runner.txt	2009-08-16 14:23:32 UTC (rev 102855)
@@ -11,18 +11,18 @@
 
     >>> import os, sys
 
-    >>> ok_script = os.path.join(sample_buildout, 'test-ok')
-    >>> failure_script = os.path.join(sample_buildout, 'test-failure')
+    >>> ok_script = ok_path = os.path.join(sample_buildout, 'test-ok')
+    >>> failure_script = failure_path = os.path.join(sample_buildout, 'test-failure')
     >>> if sys.platform.startswith('win'):
-    ...     ok_script += '-script.py'
-    ...     failure_script += '-script.py'
+    ...     ok_path += '-script.py'
+    ...     failure_path += '-script.py'
 
-    >>> write(ok_script, """
+    >>> write(ok_path, """
     ... import time
     ... time.sleep(1)
     ... print 'ok'
     ... """)
-    >>> write(failure_script, """
+    >>> write(failure_path, """
     ... import time
     ... time.sleep(1)
     ... raise SystemError('Fail!')



More information about the Checkins mailing list