##// END OF EJS Templates
run-tests: move timeout into Test.__init__
Gregory Szorc -
r21513:acfd19f3 default
parent child Browse files
Show More
@@ -340,7 +340,7 b' class Test(unittest.TestCase):'
340
340
341 def __init__(self, options, path, count, tmpdir, abort, keeptmpdir=False,
341 def __init__(self, options, path, count, tmpdir, abort, keeptmpdir=False,
342 debug=False, nodiff=False, diffviewer=None,
342 debug=False, nodiff=False, diffviewer=None,
343 interactive=False):
343 interactive=False, timeout=defaults['timeout']):
344 """Create a test from parameters.
344 """Create a test from parameters.
345
345
346 options are parsed command line options that control test execution.
346 options are parsed command line options that control test execution.
@@ -366,6 +366,9 b' class Test(unittest.TestCase):'
366 used when output changes.
366 used when output changes.
367
367
368 interactive controls whether the test will run interactively.
368 interactive controls whether the test will run interactively.
369
370 timeout controls the maximum run time of the test. It is ignored when
371 debug is True.
369 """
372 """
370
373
371 self.path = path
374 self.path = path
@@ -382,6 +385,7 b' class Test(unittest.TestCase):'
382 self._nodiff = nodiff
385 self._nodiff = nodiff
383 self._diffviewer = diffviewer
386 self._diffviewer = diffviewer
384 self._interactive = interactive
387 self._interactive = interactive
388 self._timeout = timeout
385 self._daemonpids = []
389 self._daemonpids = []
386
390
387 self._finished = None
391 self._finished = None
@@ -684,7 +688,7 b' class PythonTest(Test):'
684 if os.name == 'nt':
688 if os.name == 'nt':
685 replacements.append((r'\r\n', '\n'))
689 replacements.append((r'\r\n', '\n'))
686 return run(cmd, self._testtmp, replacements, env, self._abort,
690 return run(cmd, self._testtmp, replacements, env, self._abort,
687 debug=self._debug, timeout=self._options.timeout)
691 debug=self._debug, timeout=self._timeout)
688
692
689 class TTest(Test):
693 class TTest(Test):
690 """A "t test" is a test backed by a .t file."""
694 """A "t test" is a test backed by a .t file."""
@@ -720,7 +724,7 b' class TTest(Test):'
720
724
721 exitcode, output = run(cmd, self._testtmp, replacements, env,
725 exitcode, output = run(cmd, self._testtmp, replacements, env,
722 self._abort, debug=self._debug,
726 self._abort, debug=self._debug,
723 timeout=self._options.timeout)
727 timeout=self._timeout)
724 # Do not merge output if skipped. Return hghave message instead.
728 # Do not merge output if skipped. Return hghave message instead.
725 # Similarly, with --debug, output is None.
729 # Similarly, with --debug, output is None.
726 if exitcode == self.SKIPPED_STATUS or output is None:
730 if exitcode == self.SKIPPED_STATUS or output is None:
@@ -1508,7 +1512,8 b' class TestRunner(object):'
1508 debug=self.options.debug,
1512 debug=self.options.debug,
1509 nodiff = self.options.nodiff,
1513 nodiff = self.options.nodiff,
1510 diffviewer=self.options.view,
1514 diffviewer=self.options.view,
1511 interactive=self.options.interactive)
1515 interactive=self.options.interactive,
1516 timeout=self.options.timeout)
1512
1517
1513 def _cleanup(self):
1518 def _cleanup(self):
1514 """Clean up state from this test invocation."""
1519 """Clean up state from this test invocation."""
General Comments 0
You need to be logged in to leave comments. Login now