validate:launcher: Do not sort tests all the time

Do it once only once it is fully populated
This commit is contained in:
Thibault Saunier 2019-02-09 17:25:03 -03:00
parent 05ce6d3b92
commit 5a6307f913

View file

@ -1203,11 +1203,9 @@ class TestsManager(Loggable):
if self._is_test_wanted(test):
if test not in self.tests:
self.tests.append(test)
self.tests.sort(key=lambda test: test.classname)
else:
if test not in self.tests:
self.unwanted_tests.append(test)
self.unwanted_tests.sort(key=lambda test: test.classname)
def get_tests(self):
return self.tests
@ -1692,7 +1690,8 @@ class _TestsLauncher(Loggable):
raise RuntimeError("Unexpected new test in testsuite.")
self.tests.extend(tests)
return sorted(list(self.tests), key=lambda t: t.classname)
self.tests.sort(key=lambda test: test.classname)
return self.tests
def _tester_needed(self, tester):
for testsuite in self.options.testsuites: