# HG changeset patch # User Gregory Szorc # Date 1427577177 25200 # Node ID 27092bb7029386717ca7670822a03530244a1161 # Parent fbe2fb71a6e6ca093f9dca6789d0cb394ed377f4 run-tests: remove arguments from Test._runcommand Now that runcommand is part of the Test class, arguments that were previously coming from Test attributes can now be switched to lookups inline. diff -r fbe2fb71a6e6 -r 27092bb70293 tests/run-tests.py --- a/tests/run-tests.py Sat Mar 28 14:08:25 2015 -0700 +++ b/tests/run-tests.py Sat Mar 28 14:12:57 2015 -0700 @@ -722,19 +722,19 @@ # Failed is denoted by AssertionError (by default at least). raise AssertionError(msg) - def _runcommand(self, cmd, wd, replacements, env, debug=False, - timeout=None): + def _runcommand(self, cmd, replacements, env): """Run command in a sub-process, capturing the output (stdout and stderr). Return a tuple (exitcode, output). output is None in debug mode. """ - if debug: - proc = subprocess.Popen(cmd, shell=True, cwd=wd, env=env) + if self._debug: + proc = subprocess.Popen(cmd, shell=True, cwd=self._testtmp, + env=env) ret = proc.wait() return (ret, None) - proc = Popen4(cmd, wd, timeout, env) + proc = Popen4(cmd, self._testtmp, self._timeout, env) def cleanup(): terminate(proc) ret = proc.wait() @@ -780,8 +780,7 @@ vlog("# Running", cmd) if os.name == 'nt': replacements.append((r'\r\n', '\n')) - result = self._runcommand(cmd, self._testtmp, replacements, env, - debug=self._debug, timeout=self._timeout) + result = self._runcommand(cmd, replacements, env) if self._aborted: raise KeyboardInterrupt() @@ -828,9 +827,7 @@ cmd = '%s "%s"' % (self._shell, fname) vlog("# Running", cmd) - exitcode, output = self._runcommand(cmd, self._testtmp, replacements, - env, debug=self._debug, - timeout=self._timeout) + exitcode, output = self._runcommand(cmd, replacements, env) if self._aborted: raise KeyboardInterrupt()