[Piglit] [PATCH 2/3] sanity: Support generated shader tests

Jordan Justen jordan.l.justen at intel.com
Fri Sep 28 21:28:11 UTC 2018


Cc: Dylan Baker <dylan at pnwbakers.com>
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
 tests/CMakeLists.no_api.txt | 2 +-
 tests/sanity.py             | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tests/CMakeLists.no_api.txt b/tests/CMakeLists.no_api.txt
index 632c6786a..455b059d8 100644
--- a/tests/CMakeLists.no_api.txt
+++ b/tests/CMakeLists.no_api.txt
@@ -61,7 +61,7 @@ add_custom_target(gen-gl-xml)
 piglit_generate_xml(opengl opengl gen-gl-xml "")
 piglit_generate_xml(quick_gl quick_gl gen-gl-xml "")
 piglit_generate_xml(llvmpipe_gl llvmpipe_gl gen-gl-xml "")
-piglit_generate_xml(sanity sanity gen-gl-xml "")
+piglit_generate_xml(sanity sanity gen-gl-xml "" gen-gl-tests)
 
 add_custom_target(gen-gl-gen-xml)
 piglit_generate_xml(glslparser glslparser gen-gl-gen-xml "" gen-gl-tests static-glslparser-tests static-asmparser-tests)
diff --git a/tests/sanity.py b/tests/sanity.py
index ed3aba004..0011000a2 100644
--- a/tests/sanity.py
+++ b/tests/sanity.py
@@ -49,8 +49,13 @@ gen_basepath = os.path.relpath(os.path.join(GENERATED_TESTS_DIR, '..'), basepath
 
 def add_shader_test(shader):
     """Given an adder, creates a group and adds a shader test."""
-    basedir = TESTS_DIR
-    abs_path = os.path.abspath(os.path.join(basedir, shader))
+    for d in (TESTS_DIR, GENERATED_TESTS_DIR,):
+        s = os.path.abspath(os.path.join(d, shader))
+        if os.path.exists(s):
+            basedir = d
+            abs_path = s
+            break
+
     dirpath, filename = os.path.split(os.path.join(basedir, shader))
     dirname = os.path.relpath(dirpath, basepath)
     filepath = os.path.join(dirname, filename)
-- 
2.19.0



More information about the Piglit mailing list