# HG changeset patch # User Gregory Szorc # Date 1398463683 25200 # Node ID 9d2ba7e2324dc4d9f33af1f07e3b748470690f67 # Parent 7fcda22acc43ce8a2cbf9832158df5998aeee24c run-tests: move loop to a named argument of TestSuite.__init__ diff -r 7fcda22acc43 -r 9d2ba7e2324d tests/run-tests.py --- a/tests/run-tests.py Fri Apr 25 15:06:23 2014 -0700 +++ b/tests/run-tests.py Fri Apr 25 15:08:03 2014 -0700 @@ -1154,7 +1154,7 @@ """Custom unitest TestSuite that knows how to execute Mercurial tests.""" def __init__(self, runner, jobs=1, whitelist=None, blacklist=None, - retest=False, keywords=None, + retest=False, keywords=None, loop=False, *args, **kwargs): """Create a new instance that can run tests with a configuration. @@ -1174,6 +1174,8 @@ keywords denotes key words that will be used to filter which tests to execute. This arguably belongs outside of TestSuite. + + loop denotes whether to loop over tests forever. """ super(TestSuite, self).__init__(*args, **kwargs) @@ -1183,6 +1185,7 @@ self._blacklist = blacklist self._retest = retest self._keywords = keywords + self._loop = loop def run(self, result): # We have a number of filters that need to be applied. We do this @@ -1245,7 +1248,7 @@ running -= 1 if tests and not running == self._jobs: test = tests.pop(0) - if self._runner.options.loop: + if self._loop: tests.append(test) t = threading.Thread(target=job, name=test.name, args=(test, result)) @@ -1511,6 +1514,7 @@ blacklist=self.options.blacklist, retest=self.options.retest, keywords=self.options.keywords, + loop=self.options.loop, tests=tests) verbosity = 1 if self.options.verbose: