validate:launcher: Let the user set user options in the config file
authorThibault Saunier <tsaunier@gnome.org>
Thu, 19 Jun 2014 07:22:36 +0000 (09:22 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Mon, 7 Jul 2014 09:27:34 +0000 (11:27 +0200)
validate/tools/launcher/apps/gst-validate.py
validate/tools/launcher/main.py

index 4bcdaf7..e9a75bf 100644 (file)
@@ -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()
index 07e54da..2ed3843 100644 (file)
@@ -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):