[Piglit] [PATCH v2] arb_texture_barrier: use itertools.product instead of nested loops

Alejandro PiƱeiro apinheiro at igalia.com
Fri Jul 22 13:35:50 UTC 2016


v2: move the array definitions out of line (Ilia)
---

Although Ilia suggested RESOLUTIONS, I used lowercase names, as when I searched
on all.py, most of the array definitions are lowercase.

I also used the _set suffix, instead of pluralize the name of the parameter, because
that was hard with the parameters that are already on plural (like draw_passes).

 tests/all.py | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/tests/all.py b/tests/all.py
index 2c78b0a..3846d07 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4719,16 +4719,19 @@ with profile.group_manager(
               '{} with {}'.format(object_type, operation))
 
 # Group ARB_texture_barrier
+resolution_set = ['32', '512']
+blend_passes_set = ['1', '42']
+num_textures_set = ['1', '8']
+granularity_set = ['8', '64', '128']
+draw_passes_set = ['1', '2', '3', '4', '7', '8']
+
 with profile.group_manager(
         PiglitGLTest,
         grouptools.join('spec', 'arb_texture_barrier')) as g:
-    for resolution in ['32', '512']:
-        for blend_passes in ['1', '42']:
-            for num_textures in ['1', '8']:
-                for granularity in ['8', '64', '128']:
-                    for draw_passes in ['1', '2', '3', '4', '7', '8']:
-                        g(['arb_texture_barrier-blending-in-shader', resolution,
-                           blend_passes, num_textures, granularity, draw_passes])
+    for resolution, blend_passes, num_textures, granularity, draw_passes in itertools.product(
+            resolution_set, blend_passes_set, num_textures_set, granularity_set, draw_passes_set):
+        g(['arb_texture_barrier-blending-in-shader', resolution,
+           blend_passes, num_textures, granularity, draw_passes])
 
 
 # Group ARB_invalidate_subdata
-- 
2.7.4



More information about the Piglit mailing list