[Piglit] [PATCH 23/35] py_modules: Add support for out of tree builds

Dylan Baker dylan at pnwbakers.com
Wed Apr 4 22:27:11 UTC 2018


For out of tree builds we need to point at a TESTS_DIR that is in tree,
and a GENERATED_TESTS dir that is out of tree. At no other time do we
need to do this.
---
 tests/py_modules/constants.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/py_modules/constants.py b/tests/py_modules/constants.py
index 94a41db..c9a7a41 100644
--- a/tests/py_modules/constants.py
+++ b/tests/py_modules/constants.py
@@ -32,9 +32,11 @@ TESTS_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
 # If the PIGLIT_BUILD_DIR env var is set, we want to look for the
 # generated tests in $PIGLIT_BUILD_DIR/generated_tests/.  Otherwise,
 # look in TESTS_DIR/../generated_tests.
-GENERATED_TESTS_DIR = os.path.abspath(os.path.join(
-    os.environ.get('PIGLIT_BUILD_DIR', os.path.join(TESTS_DIR, '..')),
-    'generated_tests'))
+build_dir = os.environ.get('PIGLIT_BUILD_TREE')
+if not build_dir:
+    build_dir = os.environ.get('PIGLIT_BUILD_DIR', os.path.join(TESTS_DIR, '..'))
+
+GENERATED_TESTS_DIR = os.path.abspath(os.path.join(build_dir, 'generated_tests'))
 
 # If on cygwin convert to a dos style path
 if sys.platform == 'cygwin':
-- 
git-series 0.9.1


More information about the Piglit mailing list