Commit 8bf3256d authored by Thibault Saunier's avatar Thibault Saunier 🌵
Browse files

validate: Add a way to use validate configs with scenarios

Config files should have the-scenario-name.scenario.config to be picked automatically
parent b8b9441a
...@@ -311,7 +311,7 @@ Available options:""") ...@@ -311,7 +311,7 @@ Available options:""")
def register_defaults(self, project_paths=None, scenarios_path=None): def register_defaults(self, project_paths=None, scenarios_path=None):
projects = list() projects = list()
all_scenarios = list() all_scenarios = {}
if not self.args: if not self.args:
if project_paths == None: if project_paths == None:
path = self.options.projects_paths path = self.options.projects_paths
...@@ -332,7 +332,11 @@ Available options:""") ...@@ -332,7 +332,11 @@ Available options:""")
for f in files: for f in files:
if not f.endswith(".scenario"): if not f.endswith(".scenario"):
continue continue
all_scenarios.append(os.path.join(root, f)) f = os.path.join(root, f)
config = f + ".config"
if not os.path.exists(config):
config = None
all_scenarios[f] = config
else: else:
for proj_uri in self.args: for proj_uri in self.args:
if not utils.isuri(proj_uri): if not utils.isuri(proj_uri):
...@@ -387,9 +391,10 @@ Available options:""") ...@@ -387,9 +391,10 @@ Available options:""")
combination=comb) combination=comb)
) )
if all_scenarios: if all_scenarios:
for scenario in self._scenarios.discover_scenarios(all_scenarios): for scenario in self._scenarios.discover_scenarios(list(all_scenarios.keys())):
config = all_scenarios[scenario.path]
classname = "scenario.%s" % scenario.name classname = "scenario.%s" % scenario.name
self.add_test(GESScenarioTest(classname, test = GESScenarioTest(classname, self.options, self.reporter, scenario=scenario)
self.options, if config:
self.reporter, test.add_validate_config(config)
scenario=scenario)) self.add_test(test)
\ No newline at end of file \ No newline at end of file
...@@ -61,7 +61,6 @@ bin_element_added (GstTracer * runner, GstClockTime ts, ...@@ -61,7 +61,6 @@ bin_element_added (GstTracer * runner, GstClockTime ts,
if (!monitor->is_decoder) if (!monitor->is_decoder)
return; return;
parent = gst_object_get_parent (GST_OBJECT (element)); parent = gst_object_get_parent (GST_OBJECT (element));
do { do {
if (GES_IS_TRACK (parent)) { if (GES_IS_TRACK (parent)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment