# HG changeset patch # User Patrick Mezard # Date 2011-05-16 19:52:28 # Node ID 862f8cd875468c77093e861c12d406f67e5aafc8 # Parent 439ed4721a6d630cd8f5c34a6ba7d5aca9e8ce7b 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. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -642,45 +642,37 @@ def run(cmd, wd, options, replacements): 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)