tests/run-tests.py
branchstable
changeset 1183 f5d89f804e6f
parent 1182 e553e222bd7e
child 1186 d821f658f7a3
equal deleted inserted replaced
1182:e553e222bd7e 1183:f5d89f804e6f
   747 def run(cmd, wd, options, replacements):
   747 def run(cmd, wd, options, replacements):
   748     """Run command in a sub-process, capturing the output (stdout and stderr).
   748     """Run command in a sub-process, capturing the output (stdout and stderr).
   749     Return a tuple (exitcode, output).  output is None in debug mode."""
   749     Return a tuple (exitcode, output).  output is None in debug mode."""
   750     # TODO: Use subprocess.Popen if we're running on Python 2.4
   750     # TODO: Use subprocess.Popen if we're running on Python 2.4
   751     if options.debug:
   751     if options.debug:
   752         proc = subprocess.Popen(cmd, shell=True, cwd=wd)
   752         proc = subprocess.Popen(cmd, shell=True, cwd=wd, stdin=subprocess.PIPE)
       
   753         proc.stdin.close()
   753         ret = proc.wait()
   754         ret = proc.wait()
   754         return (ret, None)
   755         return (ret, None)
   755 
   756 
   756     proc = Popen4(cmd, wd, options.timeout)
   757     proc = Popen4(cmd, wd, options.timeout)
   757     def cleanup():
   758     def cleanup():