mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-28 17:25:05 +00:00
validate:launcher: Allow passing extra env variables to the tests
Summary: Depends on D173 Reviewers: Mathieu_Du, gdesmott Differential Revision: http://phabricator.freedesktop.org/D174
This commit is contained in:
parent
817ef82bb0
commit
4ada36dbfc
|
@ -364,7 +364,8 @@ class GstValidateLaunchTest(GstValidateTest):
|
||||||
|
|
||||||
def __init__(self, classname, options, reporter, pipeline_desc,
|
def __init__(self, classname, options, reporter, pipeline_desc,
|
||||||
timeout=DEFAULT_TIMEOUT, scenario=None,
|
timeout=DEFAULT_TIMEOUT, scenario=None,
|
||||||
media_descriptor=None, duration=0, hard_timeout=None):
|
media_descriptor=None, duration=0, hard_timeout=None,
|
||||||
|
extra_env_variables={}):
|
||||||
try:
|
try:
|
||||||
timeout = GST_VALIDATE_PROTOCOL_TIMEOUTS[
|
timeout = GST_VALIDATE_PROTOCOL_TIMEOUTS[
|
||||||
media_descriptor.get_protocol()]
|
media_descriptor.get_protocol()]
|
||||||
|
@ -384,7 +385,8 @@ class GstValidateLaunchTest(GstValidateTest):
|
||||||
duration=duration,
|
duration=duration,
|
||||||
scenario=scenario,
|
scenario=scenario,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
hard_timeout=hard_timeout)
|
hard_timeout=hard_timeout,
|
||||||
|
extra_env_variables=extra_env_variables)
|
||||||
|
|
||||||
self.pipeline_desc = pipeline_desc
|
self.pipeline_desc = pipeline_desc
|
||||||
self.media_descriptor = media_descriptor
|
self.media_descriptor = media_descriptor
|
||||||
|
@ -400,11 +402,12 @@ class GstValidateLaunchTest(GstValidateTest):
|
||||||
class GstValidateMediaCheckTest(GstValidateTest):
|
class GstValidateMediaCheckTest(GstValidateTest):
|
||||||
|
|
||||||
def __init__(self, classname, options, reporter, media_descriptor,
|
def __init__(self, classname, options, reporter, media_descriptor,
|
||||||
uri, minfo_path, timeout=DEFAULT_TIMEOUT):
|
uri, minfo_path, timeout=DEFAULT_TIMEOUT, extra_env_variables={}):
|
||||||
super(
|
super(
|
||||||
GstValidateMediaCheckTest, self).__init__(G_V_DISCOVERER_COMMAND, classname,
|
GstValidateMediaCheckTest, self).__init__(G_V_DISCOVERER_COMMAND, classname,
|
||||||
options, reporter,
|
options, reporter,
|
||||||
timeout=timeout)
|
timeout=timeout,
|
||||||
|
extra_env_variables=extra_env_variables)
|
||||||
self._uri = uri
|
self._uri = uri
|
||||||
self.media_descriptor = media_descriptor
|
self.media_descriptor = media_descriptor
|
||||||
self._media_info_path = minfo_path
|
self._media_info_path = minfo_path
|
||||||
|
@ -421,7 +424,7 @@ class GstValidateTranscodingTest(GstValidateTest, GstValidateEncodingTestInterfa
|
||||||
def __init__(self, classname, options, reporter,
|
def __init__(self, classname, options, reporter,
|
||||||
combination, uri, media_descriptor,
|
combination, uri, media_descriptor,
|
||||||
timeout=DEFAULT_TIMEOUT,
|
timeout=DEFAULT_TIMEOUT,
|
||||||
scenario=None):
|
scenario=None, extra_env_variables={}):
|
||||||
|
|
||||||
Loggable.__init__(self)
|
Loggable.__init__(self)
|
||||||
|
|
||||||
|
@ -446,7 +449,8 @@ class GstValidateTranscodingTest(GstValidateTest, GstValidateEncodingTestInterfa
|
||||||
reporter,
|
reporter,
|
||||||
duration=duration,
|
duration=duration,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
scenario=scenario)
|
scenario=scenario,
|
||||||
|
extra_env_variables=extra_env_variables)
|
||||||
|
|
||||||
GstValidateEncodingTestInterface.__init__(
|
GstValidateEncodingTestInterface.__init__(
|
||||||
self, combination, media_descriptor)
|
self, combination, media_descriptor)
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Test(Loggable):
|
||||||
|
|
||||||
def __init__(self, application_name, classname, options,
|
def __init__(self, application_name, classname, options,
|
||||||
reporter, duration=0, timeout=DEFAULT_TIMEOUT,
|
reporter, duration=0, timeout=DEFAULT_TIMEOUT,
|
||||||
hard_timeout=None):
|
hard_timeout=None, extra_env_variables={}):
|
||||||
"""
|
"""
|
||||||
@timeout: The timeout during which the value return by get_current_value
|
@timeout: The timeout during which the value return by get_current_value
|
||||||
keeps being exactly equal
|
keeps being exactly equal
|
||||||
|
@ -71,6 +71,8 @@ class Test(Loggable):
|
||||||
self.queue = None
|
self.queue = None
|
||||||
self.duration = duration
|
self.duration = duration
|
||||||
|
|
||||||
|
self.extra_env_variables = extra_env_variables
|
||||||
|
|
||||||
self.clean()
|
self.clean()
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
@ -342,6 +344,10 @@ class Test(Loggable):
|
||||||
self.build_arguments()
|
self.build_arguments()
|
||||||
self.proc_env = self.get_subproc_env()
|
self.proc_env = self.get_subproc_env()
|
||||||
|
|
||||||
|
for var, value in self.extra_env_variables.items():
|
||||||
|
self.proc_env[var] = self.proc_env.get(var, '') + os.pathsep + value
|
||||||
|
self.add_env_variable(var, self.proc_env[var])
|
||||||
|
|
||||||
if self.options.valgrind:
|
if self.options.valgrind:
|
||||||
self.use_valgrind()
|
self.use_valgrind()
|
||||||
|
|
||||||
|
@ -396,7 +402,8 @@ class GstValidateTest(Test):
|
||||||
|
|
||||||
def __init__(self, application_name, classname,
|
def __init__(self, application_name, classname,
|
||||||
options, reporter, duration=0,
|
options, reporter, duration=0,
|
||||||
timeout=DEFAULT_TIMEOUT, scenario=None, hard_timeout=None):
|
timeout=DEFAULT_TIMEOUT, scenario=None, hard_timeout=None,
|
||||||
|
extra_env_variables=[]):
|
||||||
|
|
||||||
if not hard_timeout and self.HARD_TIMEOUT_FACTOR:
|
if not hard_timeout and self.HARD_TIMEOUT_FACTOR:
|
||||||
if timeout:
|
if timeout:
|
||||||
|
@ -418,7 +425,8 @@ class GstValidateTest(Test):
|
||||||
options, reporter,
|
options, reporter,
|
||||||
duration=duration,
|
duration=duration,
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
hard_timeout=hard_timeout)
|
hard_timeout=hard_timeout,
|
||||||
|
extra_env_variables=extra_env_variables)
|
||||||
|
|
||||||
# defines how much the process can be outside of the configured
|
# defines how much the process can be outside of the configured
|
||||||
# segment / seek
|
# segment / seek
|
||||||
|
|
Loading…
Reference in a new issue