summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2018-04-15 20:47:36 -0300
committerThibault Saunier <tsaunier@igalia.com>2018-04-15 20:50:22 -0300
commit77ee198b1b8ce1043c9d28f080b8b2185d9596e4 (patch)
treec763d4fbc2345eaf78799ea7aff91a1ae02363b9
parent25e3b90225cd7b0aab103fe7237fee63e6d96f2b (diff)
validate:launcher: Add support for specifying a workdir in tests
-rw-r--r--validate/launcher/apps/gstcheck.py3
-rw-r--r--validate/launcher/baseclasses.py12
2 files changed, 10 insertions, 5 deletions
diff --git a/validate/launcher/apps/gstcheck.py b/validate/launcher/apps/gstcheck.py
index b12e44d..6271f7b 100644
--- a/validate/launcher/apps/gstcheck.py
+++ b/validate/launcher/apps/gstcheck.py
@@ -49,7 +49,8 @@ class MesonTest(Test):
Test.__init__(self, test_infos['cmd'][0], name, options,
reporter, timeout=timeout, hard_timeout=timeout,
- is_parallel=getattr(test_infos, 'is_parallel', True))
+ is_parallel=getattr(test_infos, 'is_parallel', True),
+ workdir=test_infos['workdir'])
self.test_infos = test_infos
diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py
index 7189c39..340d91a 100644
--- a/validate/launcher/baseclasses.py
+++ b/validate/launcher/baseclasses.py
@@ -71,7 +71,8 @@ class Test(Loggable):
def __init__(self, application_name, classname, options,
reporter, duration=0, timeout=DEFAULT_TIMEOUT,
hard_timeout=None, extra_env_variables=None,
- expected_failures=None, is_parallel=True):
+ expected_failures=None, is_parallel=True,
+ workdir=None):
"""
@timeout: The timeout during which the value return by get_current_value
keeps being exactly equal
@@ -111,6 +112,7 @@ class Test(Loggable):
self.generator = None
# String representation of the test number in the testsuite
self.number = ""
+ self.workdir = workdir
self.clean()
@@ -356,7 +358,8 @@ class Test(Loggable):
self.process = subprocess.Popen(self.command,
stderr=self.out,
stdout=self.out,
- env=self.proc_env)
+ env=self.proc_env,
+ cwd=self.workdir)
self.process.wait()
if self.result is not Result.TIMEOUT:
self.queue.put(None)
@@ -609,7 +612,7 @@ class GstValidateTest(Test):
options, reporter, duration=0,
timeout=DEFAULT_TIMEOUT, scenario=None, hard_timeout=None,
media_descriptor=None, extra_env_variables=None,
- expected_failures=None):
+ expected_failures=None, workdir=None):
extra_env_variables = extra_env_variables or {}
@@ -651,7 +654,8 @@ class GstValidateTest(Test):
timeout=timeout,
hard_timeout=hard_timeout,
extra_env_variables=extra_env_variables,
- expected_failures=expected_failures)
+ expected_failures=expected_failures,
+ workdir=workdir)
# defines how much the process can be outside of the configured
# segment / seek