validate: launcher: Make sure testsuites are used/configured once only

This commit is contained in:
Thibault Saunier 2018-04-28 10:15:17 +02:00
parent ef9ff93405
commit 2dc7dd1257

View file

@ -1424,7 +1424,7 @@ class _TestsLauncher(Loggable):
return (None, exceptions) return (None, exceptions)
def _load_testsuites(self): def _load_testsuites(self):
testsuites = [] testsuites = set()
for testsuite in self.options.testsuites: for testsuite in self.options.testsuites:
if os.path.exists(testsuite): if os.path.exists(testsuite):
testsuite = os.path.abspath(os.path.expanduser(testsuite)) testsuite = os.path.abspath(os.path.expanduser(testsuite))
@ -1446,13 +1446,13 @@ class _TestsLauncher(Loggable):
testsuite, loaded_module[1]), Colors.FAIL) testsuite, loaded_module[1]), Colors.FAIL)
continue continue
testsuites.append(module) testsuites.add(module)
if not hasattr(module, "TEST_MANAGER"): if not hasattr(module, "TEST_MANAGER"):
module.TEST_MANAGER = [tester.name for tester in self.testers] module.TEST_MANAGER = [tester.name for tester in self.testers]
elif not isinstance(module.TEST_MANAGER, list): elif not isinstance(module.TEST_MANAGER, list):
module.TEST_MANAGER = [module.TEST_MANAGER] module.TEST_MANAGER = [module.TEST_MANAGER]
self.options.testsuites = testsuites self.options.testsuites = list(testsuites)
def _setup_testsuites(self): def _setup_testsuites(self):
for testsuite in self.options.testsuites: for testsuite in self.options.testsuites: