diff --git a/validate/launcher/apps/gstvalidate.py b/validate/launcher/apps/gstvalidate.py index c93341b0cf..cf2559cf70 100644 --- a/validate/launcher/apps/gstvalidate.py +++ b/validate/launcher/apps/gstvalidate.py @@ -187,7 +187,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator): scenarios = [None] elif self._valid_scenarios: scenarios = [scenario for scenario in scenarios if - scenario.name in self._valid_scenarios] + scenario is not None and scenario.name in self._valid_scenarios] return super(GstValidatePipelineTestsGenerator, self).generate_tests( uri_minfo_special_scenarios, scenarios) @@ -246,6 +246,7 @@ class GstValidatePlaybinTestsGenerator(GstValidatePipelineTestsGenerator): protocol = minfo.media_descriptor.get_protocol() pipe += " uri=%s" % uri + for scenario in special_scenarios + scenarios: cpipe = pipe if not minfo.media_descriptor.is_compatible(scenario): diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index 6150ce25ae..210465ab2a 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -910,6 +910,7 @@ class _TestsLauncher(Loggable): if env_dirs is not None: for dir_ in env_dirs.split(":"): app_dirs.append(dir_) + sys.path.append(dir_) return app_dirs @@ -1206,9 +1207,9 @@ class ScenarioManager(Loggable): def find_special_scenarios(self, mfile): scenarios = [] mfile_bname = os.path.basename(mfile) + for f in os.listdir(os.path.dirname(mfile)): - if re.findall("%s\..*\.%s$" % (mfile_bname, self.FILE_EXTENDION), - f): + if re.findall("%s\..*\.%s$" % (mfile_bname, self.FILE_EXTENDION), f): scenarios.append(os.path.join(os.path.dirname(mfile), f)) if scenarios: @@ -1241,7 +1242,10 @@ class ScenarioManager(Loggable): for section in config.sections(): if scenario_paths: for scenario_path in scenario_paths: - if section in scenario_path: + if mfile is None: + name = section + path = scenario_path + elif section in scenario_path: # The real name of the scenario is: # filename.REALNAME.scenario name = scenario_path.replace(mfile + ".", "").replace( @@ -1260,6 +1264,12 @@ class ScenarioManager(Loggable): return scenarios def get_scenario(self, name): + if os.path.isabs(name) and name.endswith(self.FILE_EXTENDION): + scenarios = self.discover_scenarios([name]) + + if scenarios: + return scenarios[0] + if self.discovered is False: self.discover_scenarios()