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

Submitted by Dylan Baker on June 25, 2018, 11:29 p.m.

Details

Message ID 20180625232906.5646-6-dylan@pnwbakers.com
State New
Headers show
Series "Rework fast skipping to handle compat profile" ( rev: 3 2 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Dylan Baker June 25, 2018, 11:29 p.m.
---
 tests/serializer.py | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

Patch hide | download patch | download mbox

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):