From 1fd8c1501afd5fcacda4608a568d6188dfd70bfa Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Cerveau?= Date: Thu, 29 Apr 2021 10:09:05 +0200 Subject: [PATCH] validate: add config file support Each test can now use a config file for the given media file used to test. Part-of: --- validate/launcher/apps/gstvalidate.py | 6 +++--- validate/launcher/baseclasses.py | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/validate/launcher/apps/gstvalidate.py b/validate/launcher/apps/gstvalidate.py index 51828c5..b9b11dd 100644 --- a/validate/launcher/apps/gstvalidate.py +++ b/validate/launcher/apps/gstvalidate.py @@ -696,7 +696,7 @@ class GstValidateLaunchTest(GstValidateTest): media_descriptor=None, duration=0, hard_timeout=None, extra_env_variables=None, expected_issues=None): - extra_env_variables = extra_env_variables or {} + self.extra_env_variables = extra_env_variables or {} if scenario: duration = scenario.get_duration() @@ -732,7 +732,7 @@ class GstValidateMediaCheckTest(GstValidateTest): uri, minfo_path, timeout=DEFAULT_TIMEOUT, extra_env_variables=None, expected_issues=None): - extra_env_variables = extra_env_variables or {} + self.extra_env_variables = extra_env_variables or {} super( GstValidateMediaCheckTest, self).__init__(GstValidateBaseTestManager.MEDIA_CHECK_COMMAND, classname, @@ -764,7 +764,7 @@ class GstValidateTranscodingTest(GstValidateTest, GstValidateEncodingTestInterfa expected_issues=None): Loggable.__init__(self) - extra_env_variables = extra_env_variables or {} + self.extra_env_variables = extra_env_variables or {} file_dur = int(media_descriptor.get_duration()) / GST_SECOND if not media_descriptor.get_num_tracks("video"): diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index 00832bc..5f9f29f 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -871,6 +871,10 @@ class GstValidateTest(Test): extra_env_variables=extra_env_variables, expected_issues=expected_issues, workdir=workdir) + if media_descriptor and media_descriptor.get_media_filepath(): + config_file = os.path.join(media_descriptor.get_media_filepath() + '.config') + if os.path.isfile(config_file): + self.add_validate_config(config_file, extra_env_variables) if scenario is None or scenario.name.lower() == "none": self.scenario = None -- 2.7.4