validate:tools: Add an option to generate .media_info files
authorThibault Saunier <thibault.saunier@collabora.com>
Fri, 10 Jan 2014 14:29:31 +0000 (15:29 +0100)
committerThibault Saunier <thibault.saunier@collabora.com>
Thu, 6 Feb 2014 11:02:58 +0000 (12:02 +0100)
So we can properly choose what media should be tested only placing
media_file as needed.

validate/tools/launcher/apps/gst-validate.py
validate/tools/launcher/main.py

index 6b11a26..572bf91 100644 (file)
@@ -179,8 +179,10 @@ class GstValidateManager(TestsManager, Loggable):
                     return True
                 else:
                     args.extend(["--expected-results", media_info])
-            else:
+            elif self.options.generate_info:
                 args.extend(["--output-file", media_info])
+            else:
+                return True
 
             subprocess.check_output(args)
             self._check_discovering_info(media_info, uri)
@@ -233,7 +235,7 @@ class GstValidateManager(TestsManager, Loggable):
         if "__uri__" in pipe:
             for uri, config in self._list_uris():
                 npipe = pipe
-                if scenario in SEEKING_REQUIERED_SCENARIO:
+                if scenario != "none":
                     if config.getboolean("media-info", "seekable") is False:
                         self.debug("Do not run %s as %s does not support seeking",
                                    scenario, uri)
index b797bf1..c306eaf 100644 (file)
@@ -71,6 +71,9 @@ def main():
     parser.add_option("-n", "--no-color", dest="no_color",
                      action="store_true", default=False,
                      help="Set it to output no colored text in the terminal")
+    parser.add_option("-g", "--generate-media-info", dest="generate_info",
+                     action="store_true", default=False,
+                     help="Set it in order to generate the missing .media_infos files")
 
     loggable.init("GST_VALIDATE_LAUNCHER_DEBUG", True, False)
 
@@ -91,11 +94,6 @@ def main():
 
     tests_launcher.set_settings(options, args)
 
-    if options.list_tests:
-        for test in tests_launcher.tests:
-            printc(test)
-        return 0
-
     if options.paths == [os.path.join(DEFAULT_GST_QA_ASSETS, "medias")]:
         if os.path.exists(DEFAULT_GST_QA_ASSETS):
             launch_command("cd %s && git pull --rebase" % DEFAULT_GST_QA_ASSETS)
@@ -103,6 +101,12 @@ def main():
             launch_command("git clone %s %s" % (DEFAULT_GST_QA_ASSETS_REPO, DEFAULT_GST_QA_ASSETS))
 
     tests_launcher.list_tests()
+
+    if options.list_tests:
+        for test in tests_launcher.tests:
+            printc(test)
+        return 0
+
     tests_launcher.run_tests()
     tests_launcher.final_report()