summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2015-06-12 09:17:43 (GMT)
committerThibault Saunier <tsaunier@gnome.org>2015-06-12 09:31:13 (GMT)
commit3e978a46b4c88b2da93bf4a99c0b51cda1bac7c7 (patch)
tree5c0106e34e55075c8dc7e490c63bf1c7cb80c9e0
parentab7e9930d1ca0300662d8edf7aab79b856473820 (diff)
downloadgst-devtools-3e978a46b4c88b2da93bf4a99c0b51cda1bac7c7.tar.gz
gst-devtools-3e978a46b4c88b2da93bf4a99c0b51cda1bac7c7.tar.xz
validate:launcher: Avoid printing twice env variables
When printing test command.
-rw-r--r--validate/launcher/baseclasses.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py
index e324b69..8bef580 100644
--- a/validate/launcher/baseclasses.py
+++ b/validate/launcher/baseclasses.py
@@ -84,7 +84,7 @@ class Test(Loggable):
self.logfile = None
self.out = None
self.extra_logfiles = []
- self._env_variable = ''
+ self.__env_variable = []
def __str__(self):
string = self.classname
@@ -114,9 +114,19 @@ class Test(Loggable):
if value is None:
return
- if self._env_variable:
- self._env_variable += " "
- self._env_variable += "%s=%s" % (variable, value)
+ self.__env_variable.append(variable)
+
+ @property
+ def _env_variable(self):
+ res = ""
+ for var in set(self.__env_variable):
+ if res:
+ res += " "
+ value = self.proc_env.get(var, None)
+ if value:
+ res += "%s=%s" % (var, value)
+
+ return res
def open_logfile(self):
path = os.path.join(self.options.logsdir,