mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 23:18:52 +00:00
validate:launcher: Allow passing configs paths when loading from dictionary
The same way we allow it for scenarios
This commit is contained in:
parent
b90c097eaa
commit
d1c3607bc3
1 changed files with 6 additions and 3 deletions
|
@ -212,7 +212,10 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
|
||||||
self._valid_scenarios = valid_scenarios
|
self._valid_scenarios = valid_scenarios
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def create_config(config, private_dir, test_name, extra_data):
|
def get_config_file(config, private_dir, test_name, extra_data):
|
||||||
|
if isinstance(config, str):
|
||||||
|
return config
|
||||||
|
|
||||||
os.makedirs(private_dir, exist_ok=True)
|
os.makedirs(private_dir, exist_ok=True)
|
||||||
config_file = os.path.join(private_dir, test_name + '.config')
|
config_file = os.path.join(private_dir, test_name + '.config')
|
||||||
with open(config_file, 'w') as f:
|
with open(config_file, 'w') as f:
|
||||||
|
@ -241,7 +244,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
|
||||||
config = defs.pop('config', None)
|
config = defs.pop('config', None)
|
||||||
scenario_defs = defs.pop('scenarios', [])
|
scenario_defs = defs.pop('scenarios', [])
|
||||||
if not scenario_defs and config:
|
if not scenario_defs and config:
|
||||||
config_files[None] = cls.create_config(config, test_private_dir, test_name, extra_data)
|
config_files[None] = cls.get_config_file(config, test_private_dir, test_name, extra_data)
|
||||||
|
|
||||||
scenarios = []
|
scenarios = []
|
||||||
for scenario in scenario_defs:
|
for scenario in scenario_defs:
|
||||||
|
@ -266,7 +269,7 @@ class GstValidatePipelineTestsGenerator(GstValidateTestsGenerator):
|
||||||
scenarios.append(scenario_file)
|
scenarios.append(scenario_file)
|
||||||
|
|
||||||
if config:
|
if config:
|
||||||
config_files[scenario_name] = cls.create_config(config, test_private_dir, test_name + '.' + scenario_name, extra_data)
|
config_files[scenario_name] = cls.get_config_file(config, test_private_dir, test_name + '.' + scenario_name, extra_data)
|
||||||
|
|
||||||
local_extra_data = extra_data.copy()
|
local_extra_data = extra_data.copy()
|
||||||
local_extra_data.update(defs)
|
local_extra_data.update(defs)
|
||||||
|
|
Loading…
Reference in a new issue