Mercurial > hg
changeset 21512:265d94cae168
run-tests: move interactive to Test.__init__
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 22 Apr 2014 12:01:31 -0700 |
parents | 3ec3e81a4110 |
children | acfd19f3e79c |
files | tests/run-tests.py |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Tue Apr 22 11:58:32 2014 -0700 +++ b/tests/run-tests.py Tue Apr 22 12:01:31 2014 -0700 @@ -339,7 +339,8 @@ SKIPPED_STATUS = 80 def __init__(self, options, path, count, tmpdir, abort, keeptmpdir=False, - debug=False, nodiff=False, diffviewer=None): + debug=False, nodiff=False, diffviewer=None, + interactive=False): """Create a test from parameters. options are parsed command line options that control test execution. @@ -363,6 +364,8 @@ diffviewer is the program that should be used to display diffs. Only used when output changes. + + interactive controls whether the test will run interactively. """ self.path = path @@ -378,6 +381,7 @@ self._debug = debug self._nodiff = nodiff self._diffviewer = diffviewer + self._interactive = interactive self._daemonpids = [] self._finished = None @@ -645,7 +649,7 @@ if not self._nodiff: log("\n%s: %s %s" % (warned and 'Warning' or 'ERROR', self.name, msg)) - if (not ret and self._options.interactive and + if (not ret and self._interactive and os.path.exists(self.errpath)): iolock.acquire() print 'Accept this change? [n] ', @@ -1503,7 +1507,8 @@ keeptmpdir=self.options.keep_tmpdir, debug=self.options.debug, nodiff = self.options.nodiff, - diffviewer=self.options.view) + diffviewer=self.options.view, + interactive=self.options.interactive) def _cleanup(self): """Clean up state from this test invocation."""