validate: launcher: Make sure to properly setup all testsuites

When a first testsuite will set paths, it does not mean that we should
just register following testsuite test manager default tests.

So we need to make a difference between the media paths the user passed
with --media-path and the ones defined by the testsuite.
This commit is contained in:
Thibault Saunier 2016-03-23 20:02:47 +01:00
parent 9190bcf62a
commit 83c652ba76
2 changed files with 9 additions and 2 deletions

View file

@ -1182,7 +1182,7 @@ class _TestsLauncher(Loggable):
tester.name not in wanted_test_manager: tester.name not in wanted_test_manager:
continue continue
if self.options.paths: if self.options.user_paths:
tester.register_defaults() tester.register_defaults()
loaded = True loaded = True
elif testsuite.setup_tests(tester, self.options): elif testsuite.setup_tests(tester, self.options):

View file

@ -202,6 +202,8 @@ class LauncherConfig(Loggable):
self.num_jobs = 1 self.num_jobs = 1
self.dest = None self.dest = None
self._using_default_paths = False self._using_default_paths = False
# paths passed with --media-path, and not defined by a testsuite
self.user_paths = []
self.paths = [] self.paths = []
self.testsuites_dir = DEFAULT_TESTSUITES_DIR self.testsuites_dir = DEFAULT_TESTSUITES_DIR
@ -275,6 +277,11 @@ class LauncherConfig(Loggable):
if not isinstance(self.paths, list): if not isinstance(self.paths, list):
self.paths = [self.paths] self.paths = [self.paths]
if not isinstance(self.user_paths, list):
self.user_paths = [self.user_paths]
self.paths = list(set(self.paths).union(set(self.user_paths)))
if self.generate_info_full is True: if self.generate_info_full is True:
self.generate_info = True self.generate_info = True
@ -450,7 +457,7 @@ Note that all testsuite should be inside python modules, so the directory should
help="Directory where to store logs, default is OUTPUT_DIR/logs.") help="Directory where to store logs, default is OUTPUT_DIR/logs.")
dir_group.add_argument("-R", "--render-path", dest="dest", dir_group.add_argument("-R", "--render-path", dest="dest",
help="Set the path to which projects should be rendered, default is OUTPUT_DIR/rendered") help="Set the path to which projects should be rendered, default is OUTPUT_DIR/rendered")
dir_group.add_argument("-p", "--medias-paths", dest="paths", action="append", dir_group.add_argument("-p", "--medias-paths", dest="user_paths", action="append",
help="Paths in which to look for media files") help="Paths in which to look for media files")
dir_group.add_argument("-a", "--clone-dir", dest="clone_dir", dir_group.add_argument("-a", "--clone-dir", dest="clone_dir",
help="Paths where to clone the testuite to run " help="Paths where to clone the testuite to run "