[pitivi] validate: Use os.environ to set the environment variable
- From: Alexandru Băluț <alexbalut src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] validate: Use os.environ to set the environment variable
- Date: Wed, 9 Nov 2016 13:13:47 +0000 (UTC)
commit 7ae07af78820e8f13ff18481b103242d9eda4059
Author: Alexandru Băluț <alexandru balut gmail com>
Date: Tue Oct 25 16:35:12 2016 +0200
validate: Use os.environ to set the environment variable
Reviewed-by: Thibault Saunier <tsaunier gnome org>
Differential Revision: https://phabricator.freedesktop.org/D1427
tests/validate-tests/runtests | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/tests/validate-tests/runtests b/tests/validate-tests/runtests
index 76e627f..cbd2a03 100755
--- a/tests/validate-tests/runtests
+++ b/tests/validate-tests/runtests
@@ -1,6 +1,9 @@
#!/usr/bin/env python3
+"""Wrapper script for running the Pitivi integration tests."""
+
import os
+import subprocess
import sys
GST_VALIDATE_LAUNCHER_COMMAND = "gst-validate-launcher"
@@ -10,8 +13,10 @@ if (os.system(GST_VALIDATE_LAUNCHER_COMMAND + " -h > %s 2>&1" % os.devnull) != 0
" before running the testsuite")
sys.exit(127)
-sys.exit(os.system("GST_VALIDATE_APPS_DIR=%s %s %s %s"
- % (os.path.abspath(os.path.join(os.path.dirname(__file__))),
- GST_VALIDATE_LAUNCHER_COMMAND,
- os.path.join(os.path.abspath(os.path.join(os.path.dirname(__file__))), "pitivi.py"),
- ' '.join(sys.argv[1:]))))
+path = os.path.abspath(os.path.join(os.path.dirname(__file__))) # pylint: disable=invalid-name
+# Path to scan for GstValidate TestsManager subclasses.
+os.environ["GST_VALIDATE_APPS_DIR"] = path
+testsuite = os.path.join(path, "pitivi.py") # pylint: disable=invalid-name
+command = [GST_VALIDATE_LAUNCHER_COMMAND, testsuite] # pylint: disable=invalid-name
+command.extend(sys.argv[1:])
+sys.exit(subprocess.call(command))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]