run-tests: use the common test path on Windows and Java stable
authorPatrick Mezard <pmezard@gmail.com>
Mon, 16 May 2011 21:52:28 +0200
branchstable
changeset 945 83e828101e3c
parent 944 37aff8ccb33e
child 946 b6a39effa432
run-tests: use the common test path on Windows and Java The alternate one did not run in the test directory and controlling the jobs execution with threads instead of process made it harder to fix. [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Mon May 16 21:41:46 2011 +0200
+++ b/tests/run-tests.py	Mon May 16 21:52:28 2011 +0200
@@ -642,45 +642,37 @@
         ret = proc.wait()
         return (ret, None)
 
-    if os.name == 'nt' or sys.platform.startswith('java'):
-        tochild, fromchild = os.popen4(cmd)
-        tochild.close()
-        output = fromchild.read()
-        ret = fromchild.close()
-        if ret is None:
-            ret = 0
-    else:
-        proc = Popen4(cmd, wd, options.timeout)
-        def cleanup():
-            try:
-                proc.terminate()
-            except OSError:
-                pass
-            ret = proc.wait()
-            if ret == 0:
-                ret = signal.SIGTERM << 8
-            killdaemons()
-            return ret
+    proc = Popen4(cmd, wd, options.timeout)
+    def cleanup():
+        try:
+            proc.terminate()
+        except OSError:
+            pass
+        ret = proc.wait()
+        if ret == 0:
+            ret = signal.SIGTERM << 8
+        killdaemons()
+        return ret
+
+    output = ''
+    proc.tochild.close()
 
-        output = ''
-        proc.tochild.close()
-
-        try:
-            output = proc.fromchild.read()
-        except KeyboardInterrupt:
-            vlog('# Handling keyboard interrupt')
-            cleanup()
-            raise
+    try:
+        output = proc.fromchild.read()
+    except KeyboardInterrupt:
+        vlog('# Handling keyboard interrupt')
+        cleanup()
+        raise
 
-        ret = proc.wait()
-        if wifexited(ret):
-            ret = os.WEXITSTATUS(ret)
+    ret = proc.wait()
+    if wifexited(ret):
+        ret = os.WEXITSTATUS(ret)
 
-        if proc.timeout:
-            ret = 'timeout'
+    if proc.timeout:
+        ret = 'timeout'
 
-        if ret:
-            killdaemons()
+    if ret:
+        killdaemons()
 
     for s, r in replacements:
         output = re.sub(s, r, output)