##// END OF EJS Templates
run-tests: move shell to Test.__init__
Gregory Szorc -
r21517:af7d3a5c default
parent child Browse files
Show More
@@ -342,7 +342,7 b' class Test(unittest.TestCase):'
342 debug=False, nodiff=False, diffviewer=None,
342 debug=False, nodiff=False, diffviewer=None,
343 interactive=False, timeout=defaults['timeout'],
343 interactive=False, timeout=defaults['timeout'],
344 startport=defaults['port'], extraconfigopts=None,
344 startport=defaults['port'], extraconfigopts=None,
345 py3kwarnings=False):
345 py3kwarnings=False, shell=None):
346 """Create a test from parameters.
346 """Create a test from parameters.
347
347
348 options are parsed command line options that control test execution.
348 options are parsed command line options that control test execution.
@@ -380,6 +380,8 b' class Test(unittest.TestCase):'
380 of the form "foo.key=value" will result in "[foo] key=value".
380 of the form "foo.key=value" will result in "[foo] key=value".
381
381
382 py3kwarnings enables Py3k warnings.
382 py3kwarnings enables Py3k warnings.
383
384 shell is the shell to execute tests in.
383 """
385 """
384
386
385 self.path = path
387 self.path = path
@@ -399,6 +401,7 b' class Test(unittest.TestCase):'
399 self._startport = startport
401 self._startport = startport
400 self._extraconfigopts = extraconfigopts or []
402 self._extraconfigopts = extraconfigopts or []
401 self._py3kwarnings = py3kwarnings
403 self._py3kwarnings = py3kwarnings
404 self._shell = shell
402 self._daemonpids = []
405 self._daemonpids = []
403
406
404 self._finished = None
407 self._finished = None
@@ -730,7 +733,7 b' class TTest(Test):'
730 f.write(l)
733 f.write(l)
731 f.close()
734 f.close()
732
735
733 cmd = '%s "%s"' % (self._options.shell, fname)
736 cmd = '%s "%s"' % (self._shell, fname)
734 vlog("# Running", cmd)
737 vlog("# Running", cmd)
735
738
736 exitcode, output = run(cmd, self._testtmp, replacements, env,
739 exitcode, output = run(cmd, self._testtmp, replacements, env,
@@ -747,7 +750,7 b' class TTest(Test):'
747 # TODO do something smarter when all other uses of hghave are gone.
750 # TODO do something smarter when all other uses of hghave are gone.
748 tdir = self._testdir.replace('\\', '/')
751 tdir = self._testdir.replace('\\', '/')
749 proc = Popen4('%s -c "%s/hghave %s"' %
752 proc = Popen4('%s -c "%s/hghave %s"' %
750 (self._options.shell, tdir, ' '.join(reqs)),
753 (self._shell, tdir, ' '.join(reqs)),
751 self._testtmp, 0)
754 self._testtmp, 0)
752 stdout, stderr = proc.communicate()
755 stdout, stderr = proc.communicate()
753 ret = proc.wait()
756 ret = proc.wait()
@@ -1527,7 +1530,8 b' class TestRunner(object):'
1527 timeout=self.options.timeout,
1530 timeout=self.options.timeout,
1528 startport=self.options.port + count * 3,
1531 startport=self.options.port + count * 3,
1529 extraconfigopts=self.options.extra_config_opt,
1532 extraconfigopts=self.options.extra_config_opt,
1530 py3kwarnings=self.options.py3k_warnings)
1533 py3kwarnings=self.options.py3k_warnings,
1534 shell=self.options.shell)
1531
1535
1532 def _cleanup(self):
1536 def _cleanup(self):
1533 """Clean up state from this test invocation."""
1537 """Clean up state from this test invocation."""
General Comments 0
You need to be logged in to leave comments. Login now