[Piglit] [PATCH 1/2] tests/igt.py: read IGT_TEST_ROOT to determine the location of the tests

Thomas Wood thomas.wood at intel.com
Mon Jun 2 07:14:46 PDT 2014


Allow the IGT_TEST_ROOT environment variable to specify the location of
the intel-gpu-tools tests. Check for the presence of the test lists to
determine whether the location is correct.

Signed-off-by: Thomas Wood <thomas.wood at intel.com>
---
 tests/igt.py | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/tests/igt.py b/tests/igt.py
index aeb875e..2b812a7 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -64,13 +64,22 @@ def checkEnvironment():
     print "Test Environment check: Succeeded."
     return True
 
-if not os.path.exists(os.path.join(TEST_BIN_DIR, 'igt')):
-    print "igt symlink not found!"
+if 'IGT_TEST_ROOT' in os.environ:
+    igtTestRoot = os.environ['IGT_TEST_ROOT']
+else:
+    # Chase the piglit/bin/igt symlink to find where the tests really live.
+    if os.path.exists(path.join(TEST_BIN_DIR, 'igt')):
+        igtTestRoot = path.join(path.realpath(path.join(TEST_BIN_DIR, 'igt')),
+                                'tests')
+    else:
+        igtTestRoot=''
+
+# check for the test lists
+if not (os.path.exists(os.path.join(igtTestRoot, 'single-tests.txt'))
+        and os.path.exists(os.path.join(igtTestRoot, 'multi-tests.txt'))):
+    print "intel-gpu-tools test lists not found."
     sys.exit(0)
 
-# Chase the piglit/bin/igt symlink to find where the tests really live.
-igtTestRoot = path.join(path.realpath(path.join(TEST_BIN_DIR, 'igt')), 'tests')
-
 igtEnvironmentOk = checkEnvironment()
 
 profile = TestProfile()
-- 
1.9.0



More information about the Piglit mailing list