From 5266fee48c62a888ac9a42a7f61a995c13295c83 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Thu, 19 Jun 2014 09:22:36 +0200 Subject: [PATCH] validate:launcher: Let the user set user options in the config file --- validate/tools/launcher/apps/gst-validate.py | 4 ++++ validate/tools/launcher/main.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/validate/tools/launcher/apps/gst-validate.py b/validate/tools/launcher/apps/gst-validate.py index 4bcdaf7..e9a75bf 100644 --- a/validate/tools/launcher/apps/gst-validate.py +++ b/validate/tools/launcher/apps/gst-validate.py @@ -477,6 +477,9 @@ You can also set default values with: * gst_validate_register_default_test_generators: Sets default values for the TestGenerators to be used * gst_validate_register_default_scenarios: Sets default values for the scenarios to be executed * gst_validate_register_default_encoding_formats: Sets default values for the encoding formats to be tested + +Note: In the config file, you have acces to the options variable resulting from the parsing of the command line +user argument, you can thus overrides command line options using that. """) def _populate_testsuite(self, options): @@ -485,6 +488,7 @@ You can also set default values with: return if options.validate_config: + globals()["options"] = options execfile(options.validate_config, globals()) else: gst_validate_register_defaults() diff --git a/validate/tools/launcher/main.py b/validate/tools/launcher/main.py index 07e54da..2ed3843 100644 --- a/validate/tools/launcher/main.py +++ b/validate/tools/launcher/main.py @@ -134,7 +134,7 @@ DEFAULT_GST_QA_ASSETS_REPO = "git://people.freedesktop.org/~tsaunier/gst-qa-asse class PrintUsage(argparse.Action): def __init__(self, option_strings, dest=argparse.SUPPRESS, default=argparse.SUPPRESS, help=None): - super(PrintUsage, self).__init__( option_strings=option_strings, dest=dest, + super(PrintUsage, self).__init__(option_strings=option_strings, dest=dest, default=default, nargs=0, help=help) def __call__(self, parser, namespace, values, option_string=None): -- 2.7.4