[Piglit] [PATCH 4/9] framework: Set env var PIGLIT_SOURCE_DIR if unset

Chad Versace chad.versace at linux.intel.com
Mon Jul 9 10:43:32 PDT 2012


Otherwise, if the user forgets to set PIGLIT_SOURCE_DIR himself, then
tests that use piglit_source_dir() will fail.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 framework/core.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/framework/core.py b/framework/core.py
index 4c255ca..b20fd89 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -206,6 +206,9 @@ if 'PIGLIT_BUILD_DIR' in os.environ:
 else:
     testBinDir = os.path.dirname(__file__) + '/../bin/'
 
+if 'PIGLIT_SOURCE_DIR' not in os.environ:
+    p = os.path
+    os.environ['PIGLIT_SOURCE_DIR'] = p.abspath(p.join(p.dirname(__file__), '..'))
 
 #############################################################################
 ##### Result classes
-- 
1.7.11.1



More information about the Piglit mailing list