validate: launcher: Make sure to properly setup all testsuites
authorThibault Saunier <tsaunier@gnome.org>
Wed, 23 Mar 2016 19:02:47 +0000 (20:02 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Wed, 23 Mar 2016 19:10:51 +0000 (20:10 +0100)
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.

validate/launcher/baseclasses.py
validate/launcher/main.py

index 75f9e8d..b94c20e 100644 (file)
@@ -1182,7 +1182,7 @@ class _TestsLauncher(Loggable):
                         tester.name not in wanted_test_manager:
                     continue
 
-                if self.options.paths:
+                if self.options.user_paths:
                     tester.register_defaults()
                     loaded = True
                 elif testsuite.setup_tests(tester, self.options):
index 85344f0..d6f0088 100644 (file)
@@ -202,6 +202,8 @@ class LauncherConfig(Loggable):
         self.num_jobs = 1
         self.dest = None
         self._using_default_paths = False
+        # paths passed with --media-path, and not defined by a testsuite
+        self.user_paths = []
         self.paths = []
         self.testsuites_dir = DEFAULT_TESTSUITES_DIR
 
@@ -275,6 +277,11 @@ class LauncherConfig(Loggable):
         if not isinstance(self.paths, list):
             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:
             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.")
     dir_group.add_argument("-R", "--render-path", dest="dest",
                            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")
     dir_group.add_argument("-a", "--clone-dir", dest="clone_dir",
                            help="Paths where to clone the testuite to run "