comparison tests/run-tests.py @ 18230:f5842787a958

run-tests.py: don't use console for stdin when running in debug mode Tests would wait for input instead of using non-interactive mode.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 07 Jan 2013 02:00:43 +0100
parents 77d06793a20d
children 5a3c71b0e042
comparison
equal deleted inserted replaced
18229:77d06793a20d 18230:f5842787a958
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():