validate:launcher: Extract method to set a validate configuration on tests

This commit is contained in:
Thibault Saunier 2018-04-12 23:05:01 -03:00
parent b9ea967275
commit 55dee0b8a6

View file

@ -414,14 +414,7 @@ class Test(Loggable):
self.timeout *= VALGRIND_TIMEOUT_FACTOR
# Enable 'valgrind.config'
vg_config = get_data_file('data', 'valgrind.config')
if self.proc_env.get('GST_VALIDATE_CONFIG'):
subenv['GST_VALIDATE_CONFIG'] = '%s%s%s' % (
self.proc_env['GST_VALIDATE_CONFIG'], os.pathsep, vg_config)
else:
subenv['GST_VALIDATE_CONFIG'] = vg_config
self.add_validate_config(get_data_file('data', 'valgrind.config'), subenv)
if subenv == self.proc_env:
self.add_env_variable('G_DEBUG', 'gc-friendly')
self.add_env_variable('G_SLICE', 'always-malloc')
@ -430,6 +423,16 @@ class Test(Loggable):
return command
def add_validate_config(self, config, subenv=None):
if not subenv:
subenv = self.extra_env_variables
if subenv.get('GST_VALIDATE_CONFIG'):
subenv['GST_VALIDATE_CONFIG'] = '%s%s%s' % (
self.proc_env['GST_VALIDATE_CONFIG'], os.pathsep, config)
else:
subenv['GST_VALIDATE_CONFIG'] = config
def launch_server(self):
return None