tests/run-tests.py
branchstable
changeset 1203 67fb241fb0b1
parent 1196 c0daf79e5680
child 1204 469ccfe7aa92
equal deleted inserted replaced
1201:6f2f7246e4be 1203:67fb241fb0b1
   749 def run(cmd, wd, options, replacements):
   749 def run(cmd, wd, options, replacements):
   750     """Run command in a sub-process, capturing the output (stdout and stderr).
   750     """Run command in a sub-process, capturing the output (stdout and stderr).
   751     Return a tuple (exitcode, output).  output is None in debug mode."""
   751     Return a tuple (exitcode, output).  output is None in debug mode."""
   752     # TODO: Use subprocess.Popen if we're running on Python 2.4
   752     # TODO: Use subprocess.Popen if we're running on Python 2.4
   753     if options.debug:
   753     if options.debug:
   754         proc = subprocess.Popen(cmd, shell=True, cwd=wd, stdin=subprocess.PIPE)
   754         proc = subprocess.Popen(cmd, shell=True, cwd=wd)
   755         proc.stdin.close()
       
   756         ret = proc.wait()
   755         ret = proc.wait()
   757         return (ret, None)
   756         return (ret, None)
   758 
   757 
   759     proc = Popen4(cmd, wd, options.timeout)
   758     proc = Popen4(cmd, wd, options.timeout)
   760     def cleanup():
   759     def cleanup():