[Piglit] [PATCH 02/35] test/piglit_test: add ROOT_DIR variable

Dylan Baker dylan at pnwbakers.com
Wed Apr 4 22:26:50 UTC 2018


This variable always points to the root of the piglit directory, which
contains the tests and generated_tests directories.
---
 framework/test/piglit_test.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py
index b6cec71..cc129ed 100644
--- a/framework/test/piglit_test.py
+++ b/framework/test/piglit_test.py
@@ -45,14 +45,16 @@ __all__ = [
     'PiglitGLTest',
     'PiglitBaseTest',
     'CL_CONCURRENT',
+    'ROOT_DIR',
     'TEST_BIN_DIR',
 ]
 
 if 'PIGLIT_BUILD_DIR' in os.environ:
-    TEST_BIN_DIR = os.path.join(os.environ['PIGLIT_BUILD_DIR'], 'bin')
+    ROOT_DIR = os.environ['PIGLIT_BUILD_DIR']
 else:
-    TEST_BIN_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__),
-                                                 '../../bin'))
+    ROOT_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), '../..'))
+
+TEST_BIN_DIR = os.path.normpath(os.path.join(ROOT_DIR, 'bin'))
 
 CL_CONCURRENT = (not sys.platform.startswith('linux') or
                  glob.glob('/dev/dri/render*'))
-- 
git-series 0.9.1


More information about the Piglit mailing list