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

Dylan Baker dylan at pnwbakers.com
Mon Jun 25 23:29:04 UTC 2018


---
 tests/serializer.py | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/tests/serializer.py b/tests/serializer.py
index 32beb428c..998a72a86 100644
--- a/tests/serializer.py
+++ b/tests/serializer.py
@@ -54,21 +54,16 @@ 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)
+        if value:
+            et.SubElement(elem, 'option', name=f, value=repr(value))
 
 
 def serializer(name, profile, outfile):
-- 
2.17.1



More information about the Piglit mailing list