From eb23274a5b8d6bcc3dc5f96f32eb69cfcddc556b Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 10 Jan 2014 15:29:31 +0100 Subject: [PATCH] validate:tools: Add an option to generate .media_info files So we can properly choose what media should be tested only placing media_file as needed. --- validate/tools/launcher/apps/gst-validate.py | 6 ++++-- validate/tools/launcher/main.py | 14 +++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/validate/tools/launcher/apps/gst-validate.py b/validate/tools/launcher/apps/gst-validate.py index 6b11a26e31..572bf91b03 100644 --- a/validate/tools/launcher/apps/gst-validate.py +++ b/validate/tools/launcher/apps/gst-validate.py @@ -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) diff --git a/validate/tools/launcher/main.py b/validate/tools/launcher/main.py index b797bf1449..c306eafc1e 100644 --- a/validate/tools/launcher/main.py +++ b/validate/tools/launcher/main.py @@ -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()