[Piglit] [PATCH v2 6/7] serializer: serialize new fast-skip attributes

Dylan Baker dylan at pnwbakers.com
Tue Jul 10 17:42:13 UTC 2018


v2: - Serialize no-process-isolation shader runner tests
---
 tests/serializer.py | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/tests/serializer.py b/tests/serializer.py
index 32beb428c..4c3daa07b 100644
--- a/tests/serializer.py
+++ b/tests/serializer.py
@@ -54,21 +54,22 @@ def parser():
 
 
 def _serialize_skips(test, elem):
-    if getattr(test, 'gl_required', None):
-        et.SubElement(elem, 'option', name='gl_required',
-                      value=repr(test.gl_required))
-    if getattr(test, 'gl_version', None):
-        et.SubElement(elem, 'option', name='gl_version',
-                      value=repr(test.gl_version))
-    if getattr(test, 'gles_version', None):
-        et.SubElement(elem, 'option', name='gles_version',
-                      value=repr(test.gles_version))
-    if getattr(test, 'glsl_version', None):
-        et.SubElement(elem, 'option', name='glsl_version',
-                      value=repr(test.glsl_version))
-    if getattr(test, 'glsl_es_version', None):
-        et.SubElement(elem, 'option', name='glsl_es_version',
-                      value=repr(test.glsl_es_version))
+    elems = [
+        ('require_shader', 'shader_version'),
+        ('require_api', 'api'),
+        ('require_version', 'api_version'),
+        ('require_extensions', 'extensions'),
+    ]
+    for e, f in elems:
+        value = getattr(test, e, None)
+
+        # For most tests (except MultiShader, we use the test value 'e', but
+        # for MultiShader what's exposed is a FastSkip object, and the methods
+        # are 'f'
+        if not value:
+            value = getattr(test, f, None)
+        if value:
+            et.SubElement(elem, 'option', name=f, value=repr(value))
 
 
 def serializer(name, profile, outfile):
-- 
2.18.0



More information about the Piglit mailing list