##// END OF EJS Templates
run-tests: remove arguments from Test._runcommand...
Gregory Szorc -
r24509:27092bb7 default
parent child Browse files
Show More
@@ -722,19 +722,19 b' class Test(unittest.TestCase):'
722 # Failed is denoted by AssertionError (by default at least).
722 # Failed is denoted by AssertionError (by default at least).
723 raise AssertionError(msg)
723 raise AssertionError(msg)
724
724
725 def _runcommand(self, cmd, wd, replacements, env, debug=False,
725 def _runcommand(self, cmd, replacements, env):
726 timeout=None):
727 """Run command in a sub-process, capturing the output (stdout and
726 """Run command in a sub-process, capturing the output (stdout and
728 stderr).
727 stderr).
729
728
730 Return a tuple (exitcode, output). output is None in debug mode.
729 Return a tuple (exitcode, output). output is None in debug mode.
731 """
730 """
732 if debug:
731 if self._debug:
733 proc = subprocess.Popen(cmd, shell=True, cwd=wd, env=env)
732 proc = subprocess.Popen(cmd, shell=True, cwd=self._testtmp,
733 env=env)
734 ret = proc.wait()
734 ret = proc.wait()
735 return (ret, None)
735 return (ret, None)
736
736
737 proc = Popen4(cmd, wd, timeout, env)
737 proc = Popen4(cmd, self._testtmp, self._timeout, env)
738 def cleanup():
738 def cleanup():
739 terminate(proc)
739 terminate(proc)
740 ret = proc.wait()
740 ret = proc.wait()
@@ -780,8 +780,7 b' class PythonTest(Test):'
780 vlog("# Running", cmd)
780 vlog("# Running", cmd)
781 if os.name == 'nt':
781 if os.name == 'nt':
782 replacements.append((r'\r\n', '\n'))
782 replacements.append((r'\r\n', '\n'))
783 result = self._runcommand(cmd, self._testtmp, replacements, env,
783 result = self._runcommand(cmd, replacements, env)
784 debug=self._debug, timeout=self._timeout)
785 if self._aborted:
784 if self._aborted:
786 raise KeyboardInterrupt()
785 raise KeyboardInterrupt()
787
786
@@ -828,9 +827,7 b' class TTest(Test):'
828 cmd = '%s "%s"' % (self._shell, fname)
827 cmd = '%s "%s"' % (self._shell, fname)
829 vlog("# Running", cmd)
828 vlog("# Running", cmd)
830
829
831 exitcode, output = self._runcommand(cmd, self._testtmp, replacements,
830 exitcode, output = self._runcommand(cmd, replacements, env)
832 env, debug=self._debug,
833 timeout=self._timeout)
834
831
835 if self._aborted:
832 if self._aborted:
836 raise KeyboardInterrupt()
833 raise KeyboardInterrupt()
General Comments 0
You need to be logged in to leave comments. Login now