[Piglit] [PATCH 04/15] framework: Split PiglitTest into specific GL and CL classes

Dylan Baker baker.dylan.c at gmail.com
Fri Oct 3 17:57:45 PDT 2014


This creates two separate classes for OpenGL and OpenCL tests. This
allows the implementation of features, workarounds, etc for only one
standard without adversely effecting the other.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/test/base.py                             |   9 +-
 framework/test/glsl_parser_test.py                 |   4 +-
 framework/test/piglit_test.py                      |  44 ++++--
 framework/test/shader_test.py                      |   4 +-
 .../tests/{exectest_test.py => base_tests.py}      |  38 -----
 framework/tests/piglit_test_tests.py               |  72 ++++++++++
 tests/all.py                                       | 158 ++++++++++-----------
 tests/cl.py                                        |   4 +-
 8 files changed, 193 insertions(+), 140 deletions(-)
 rename framework/tests/{exectest_test.py => base_tests.py} (67%)
 create mode 100644 framework/tests/piglit_test_tests.py

diff --git a/framework/test/base.py b/framework/test/base.py
index 348568e..87575e4 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -209,12 +209,7 @@ class Test(object):
             self.result['returncode'] = None
             return
 
-        # https://bugzilla.gnome.org/show_bug.cgi?id=680214 is affecting many
-        # developers. If we catch it happening, try just re-running the test.
-        for _ in xrange(5):
-            self.__run_command()
-            if "Got spurious window resize" not in self.result['out']:
-                break
+        self._run_command()
 
         # If the result is skip then the test wasn't run, return early
         # This usually is triggered when a test is not built for a specific
@@ -258,7 +253,7 @@ class Test(object):
         if hasattr(os, 'setpgrp'):
             os.setpgrp()
 
-    def __run_command(self):
+    def _run_command(self):
         """ Run the test command and get the result
 
         This method sets environment options, then runs the executable. If the
diff --git a/framework/test/glsl_parser_test.py b/framework/test/glsl_parser_test.py
index 77c3ac1..1c2d175 100644
--- a/framework/test/glsl_parser_test.py
+++ b/framework/test/glsl_parser_test.py
@@ -27,7 +27,7 @@ import os.path as path
 import re
 import sys
 
-from .piglit_test import PiglitTest
+from .piglit_test import PiglitGLTest
 
 __all__ = [
     'GLSLParserTest',
@@ -73,7 +73,7 @@ def import_glsl_parser_tests(group, basepath, subdirectories):
                     add_glsl_parser_test(group, filepath, testname)
 
 
-class GLSLParserTest(PiglitTest):
+class GLSLParserTest(PiglitGLTest):
     """ Read the options in a glsl parser test and create a Test object
 
     Specifically it is necessary to parse a glsl_parser_test to get information
diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py
index 0f1f40e..2f11491 100644
--- a/framework/test/piglit_test.py
+++ b/framework/test/piglit_test.py
@@ -32,7 +32,8 @@ from .base import Test
 
 
 __all__ = [
-    'PiglitTest',
+    'PiglitGLTest',
+    'PiglitCLTest',
     'TEST_BIN_DIR'
 ]
 
@@ -43,7 +44,7 @@ else:
                                                  '../../bin'))
 
 
-class PiglitTest(Test):
+class PiglitBaseTest(Test):
     """
     PiglitTest: Run a "native" piglit test executable
 
@@ -51,11 +52,30 @@ class PiglitTest(Test):
     dictionary. The plain output is appended to this dictionary
     """
     def __init__(self, *args, **kwargs):
-        super(PiglitTest, self).__init__(*args, **kwargs)
+        super(PiglitBaseTest, self).__init__(*args, **kwargs)
 
         # Prepend TEST_BIN_DIR to the path.
         self._command[0] = os.path.join(TEST_BIN_DIR, self._command[0])
 
+    def interpret_result(self):
+        outlines = self.result['out'].split('\n')
+        outpiglit = (s[7:] for s in outlines if s.startswith('PIGLIT:'))
+
+        for piglit in outpiglit:
+            self.result.recursive_update(json.loads(piglit))
+        self.result['out'] = '\n'.join(
+            s for s in outlines if not s.startswith('PIGLIT:'))
+
+
+class PiglitGLTest(PiglitBaseTest):
+    """ OpenGL specific Piglit test class
+
+    This Subclass provides two methods that differ from PiglitBaseTest, first
+    it provides an is_skip() method that skips glx tests on non-glx platforms,
+    and it provides a _run_command() method that repeats tests if they fail due
+    to window manager resizing bug
+
+    """
     def is_skip(self):
         """ Native Piglit-test specific skip checking
 
@@ -70,11 +90,15 @@ class PiglitTest(Test):
                 return True
         return False
 
-    def interpret_result(self):
-        outlines = self.result['out'].split('\n')
-        outpiglit = (s[7:] for s in outlines if s.startswith('PIGLIT:'))
+    def _run_command(self):
+        # https://bugzilla.gnome.org/show_bug.cgi?id=680214 is affecting many
+        # developers. If we catch it happening, try just re-running the test.
+        for _ in xrange(5):
+            super(PiglitGLTest, self)._run_command()
+            if "Got spurious window resize" not in self.result['out']:
+                break
 
-        for piglit in outpiglit:
-            self.result.recursive_update(json.loads(piglit))
-        self.result['out'] = '\n'.join(
-            s for s in outlines if not s.startswith('PIGLIT:'))
+
+class PiglitCLTest(PiglitBaseTest):
+    """ OpenCL specific Test class """
+    pass
diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
index 1ec4930..b9453bc 100644
--- a/framework/test/shader_test.py
+++ b/framework/test/shader_test.py
@@ -27,7 +27,7 @@ import os
 import os.path as path
 import re
 
-from .piglit_test import PiglitTest
+from .piglit_test import PiglitGLTest
 
 __all__ = [
     'ShaderTest',
@@ -37,7 +37,7 @@ __all__ = [
 ]
 
 
-class ShaderTest(PiglitTest):
+class ShaderTest(PiglitGLTest):
     """ Parse a shader test file and return a PiglitTest instance
 
     This function parses a shader test to determine if it's a GL, GLES2 or
diff --git a/framework/tests/exectest_test.py b/framework/tests/base_tests.py
similarity index 67%
rename from framework/tests/exectest_test.py
rename to framework/tests/base_tests.py
index 3d7e0e9..f0a5d7d 100644
--- a/framework/tests/exectest_test.py
+++ b/framework/tests/base_tests.py
@@ -20,9 +20,7 @@
 
 """ Tests for the exectest module """
 
-import nose.tools as nt
 import framework.tests.utils as utils
-from framework.test import PiglitTest
 from framework.test.base import Test
 
 
@@ -41,11 +39,6 @@ class TestTest(Test):
 
 
 # Tests
-def test_initialize_piglittest():
-    """ Test that PiglitTest initializes correctly """
-    PiglitTest('/bin/true')
-
-
 def test_run_return_early():
     """ Test.run() exits early when Test._run_command() has exception """
     def helper():
@@ -86,34 +79,3 @@ def test_timeout_pass():
     test.timeout = 1
     test.run()
     assert test.result['result'] == 'pass'
-
-
-def test_piglittest_interpret_result():
-    """ PiglitTest.interpret_result() works no subtests """
-    test = PiglitTest('foo')
-    test.result['out'] = 'PIGLIT: {"result": "pass"}\n'
-    test.interpret_result()
-    assert test.result['result'] == 'pass'
-
-
-def test_piglittest_interpret_result_subtest():
-    """ PiglitTest.interpret_result() works with subtests """
-    test = PiglitTest('foo')
-    test.result['out'] = ('PIGLIT: {"result": "pass"}\n'
-                          'PIGLIT: {"subtest": {"subtest": "pass"}}\n')
-    test.interpret_result()
-    assert test.result['subtest']['subtest'] == 'pass'
-
-
-def test_piglitest_no_clobber():
-    """ PiglitTest.interpret_result() does not clobber subtest entires """
-    test = PiglitTest(['a', 'command'])
-    test.result['out'] = (
-        'PIGLIT: {"result": "pass"}\n'
-        'PIGLIT: {"subtest": {"test1": "pass"}}\n'
-        'PIGLIT: {"subtest": {"test2": "pass"}}\n'
-    )
-    test.interpret_result()
-
-    nt.assert_dict_equal(test.result['subtest'],
-                         {'test1': 'pass', 'test2': 'pass'})
diff --git a/framework/tests/piglit_test_tests.py b/framework/tests/piglit_test_tests.py
new file mode 100644
index 0000000..f4f5bbc
--- /dev/null
+++ b/framework/tests/piglit_test_tests.py
@@ -0,0 +1,72 @@
+# Copyright (c) 2014 Intel Corporation
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+""" Tests for the exectest module """
+
+import nose.tools as nt
+from framework.test.piglit_test import (PiglitBaseTest, PiglitGLTest,
+                                        PiglitCLTest)
+
+
+def test_initialize_piglitgltest():
+    """ Test that PiglitGLTest initializes correctly """
+    try:
+        PiglitGLTest('/bin/true')
+    except Exception as e:
+        raise AssertionError(e)
+
+
+def test_initialize_piglitcltest():
+    """ Test that PiglitCLTest initializes correctly """
+    try:
+        PiglitCLTest('/bin/true')
+    except Exception as e:
+        raise AssertionError(e)
+
+
+def test_piglittest_interpret_result():
+    """ PiglitBaseTest.interpret_result() works no subtests """
+    test = PiglitBaseTest('foo')
+    test.result['out'] = 'PIGLIT: {"result": "pass"}\n'
+    test.interpret_result()
+    assert test.result['result'] == 'pass'
+
+
+def test_piglittest_interpret_result_subtest():
+    """ PiglitBaseTest.interpret_result() works with subtests """
+    test = PiglitBaseTest('foo')
+    test.result['out'] = ('PIGLIT: {"result": "pass"}\n'
+                          'PIGLIT: {"subtest": {"subtest": "pass"}}\n')
+    test.interpret_result()
+    assert test.result['subtest']['subtest'] == 'pass'
+
+
+def test_piglitest_no_clobber():
+    """ PiglitBaseTest.interpret_result() does not clobber subtest entires """
+    test = PiglitBaseTest(['a', 'command'])
+    test.result['out'] = (
+        'PIGLIT: {"result": "pass"}\n'
+        'PIGLIT: {"subtest": {"test1": "pass"}}\n'
+        'PIGLIT: {"subtest": {"test2": "pass"}}\n'
+    )
+    test.interpret_result()
+
+    nt.assert_dict_equal(test.result['subtest'],
+                         {'test1': 'pass', 'test2': 'pass'})
diff --git a/tests/all.py b/tests/all.py
index 89649cd..0c44647 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -10,7 +10,7 @@ import subprocess
 import sys
 
 from framework.profile import TestProfile
-from framework.test import (PiglitTest, GleanTest,
+from framework.test import (PiglitGLTest, GleanTest,
                             add_glsl_parser_test, import_glsl_parser_tests,
                             add_shader_test_dir)
 
@@ -27,9 +27,9 @@ generatedTestDir = os.path.normpath(os.path.join(
     os.environ.get('PIGLIT_BUILD_DIR', os.path.join(testsDir, '..')),
     'generated_tests'))
 
-# Quick wrapper for PiglitTest for our usual concurrent args.
+# Quick wrapper for PiglitGLTest for our usual concurrent args.
 def plain_test(args):
-    return PiglitTest(args.split() + ['-auto'])
+    return PiglitGLTest(args.split() + ['-auto'])
 
 def add_single_param_test_set(group, name, *params):
     for param in params:
@@ -572,15 +572,15 @@ glx['extension string sanity'] = concurrent_test('glx-string-sanity')
 
 import_context = {};
 glx['GLX_EXT_import_context'] = import_context
-import_context['free context'] = PiglitTest(['glx-free-context'])
-import_context['get context ID'] = PiglitTest(['glx-get-context-id'])
-import_context['get current display'] = PiglitTest(['glx-get-current-display-ext'])
-import_context['imported context has same context ID'] = PiglitTest(['glx-import-context-has-same-context-id'])
-import_context['import context, multi process'] = PiglitTest(['glx-import-context-multi-process'])
-import_context['import context, single process'] = PiglitTest(['glx-import-context-single-process'])
-import_context['make current, multi process'] = PiglitTest(['glx-make-current-multi-process'])
-import_context['make current, single process'] = PiglitTest(['glx-make-current-single-process'])
-import_context['query context info'] = PiglitTest(['glx-query-context-info-ext'])
+import_context['free context'] = PiglitGLTest(['glx-free-context'])
+import_context['get context ID'] = PiglitGLTest(['glx-get-context-id'])
+import_context['get current display'] = PiglitGLTest(['glx-get-current-display-ext'])
+import_context['imported context has same context ID'] = PiglitGLTest(['glx-import-context-has-same-context-id'])
+import_context['import context, multi process'] = PiglitGLTest(['glx-import-context-multi-process'])
+import_context['import context, single process'] = PiglitGLTest(['glx-import-context-single-process'])
+import_context['make current, multi process'] = PiglitGLTest(['glx-make-current-multi-process'])
+import_context['make current, single process'] = PiglitGLTest(['glx-make-current-single-process'])
+import_context['query context info'] = PiglitGLTest(['glx-query-context-info-ext'])
 
 create_context = {};
 glx['GLX_ARB_create_context'] = create_context
@@ -663,8 +663,8 @@ spec['!OpenGL 1.1'] = gl11
 add_texwrap_target_tests(gl11, '1D')
 add_texwrap_target_tests(gl11, '2D')
 add_texwrap_format_tests(gl11)
-gl11['copyteximage 1D'] = PiglitTest(['copyteximage', '-auto', '1D'])
-gl11['copyteximage 2D'] = PiglitTest(['copyteximage', '-auto', '2D'])
+gl11['copyteximage 1D'] = PiglitGLTest(['copyteximage', '-auto', '1D'])
+gl11['copyteximage 2D'] = PiglitGLTest(['copyteximage', '-auto', '2D'])
 add_plain_test(gl11, 'drawbuffer-modes')
 add_plain_test(gl11, 'fdo10370')
 add_plain_test(gl11, 'fdo23489')
@@ -724,11 +724,11 @@ add_plain_test(gl11, 'scissor-many')
 add_plain_test(gl11, 'scissor-offscreen')
 add_concurrent_test(gl11, 'scissor-polygon')
 add_plain_test(gl11, 'scissor-stencil-clear')
-gl11['GL_SELECT - no test function'] = PiglitTest(['select', 'gl11'])
-gl11['GL_SELECT - depth-test enabled'] = PiglitTest(['select', 'depth'])
-gl11['GL_SELECT - stencil-test enabled'] = PiglitTest(['select', 'stencil'])
-gl11['GL_SELECT - alpha-test enabled'] = PiglitTest(['select', 'alpha'])
-gl11['GL_SELECT - scissor-test enabled'] = PiglitTest(['select', 'scissor'])
+gl11['GL_SELECT - no test function'] = PiglitGLTest(['select', 'gl11'])
+gl11['GL_SELECT - depth-test enabled'] = PiglitGLTest(['select', 'depth'])
+gl11['GL_SELECT - stencil-test enabled'] = PiglitGLTest(['select', 'stencil'])
+gl11['GL_SELECT - alpha-test enabled'] = PiglitGLTest(['select', 'alpha'])
+gl11['GL_SELECT - scissor-test enabled'] = PiglitGLTest(['select', 'scissor'])
 add_plain_test(gl11, 'stencil-drawpixels')
 add_plain_test(gl11, 'texgen')
 add_plain_test(gl11, 'two-sided-lighting')
@@ -834,7 +834,7 @@ add_msaa_visual_plain_tests(gl14, 'copy-pixels')
 add_plain_test(gl14, 'draw-batch')
 add_plain_test(gl14, 'stencil-wrap')
 add_plain_test(gl14, 'triangle-rasterization')
-gl14['triangle-rasterization-fbo'] = PiglitTest(['triangle-rasterization', '-auto', '-use_fbo'])
+gl14['triangle-rasterization-fbo'] = PiglitGLTest(['triangle-rasterization', '-auto', '-use_fbo'])
 add_plain_test(gl14, 'triangle-rasterization-overdraw')
 gl14['tex-miplevel-selection'] = concurrent_test('tex-miplevel-selection -nobias -nolod')
 gl14['tex-miplevel-selection-lod'] = concurrent_test('tex-miplevel-selection -nobias')
@@ -843,13 +843,13 @@ gl14['tex-miplevel-selection-lod-bias'] = concurrent_test('tex-miplevel-selectio
 gl15 = {}
 spec['!OpenGL 1.5'] = gl15
 add_plain_test(gl15, 'draw-elements')
-gl15['draw-elements-user'] = PiglitTest(['draw-elements', '-auto', 'user'])
+gl15['draw-elements-user'] = PiglitGLTest(['draw-elements', '-auto', 'user'])
 add_plain_test(gl15, 'draw-vertices')
-gl15['draw-vertices-user'] = PiglitTest(['draw-vertices', '-auto', 'user'])
+gl15['draw-vertices-user'] = PiglitGLTest(['draw-vertices', '-auto', 'user'])
 add_plain_test(gl15, 'isbufferobj')
 add_plain_test(gl15, 'depth-tex-compare')
-gl15['normal3b3s-invariance-byte'] = PiglitTest(['gl-1.5-normal3b3s-invariance', 'GL_BYTE', '-auto'])
-gl15['normal3b3s-invariance-short'] = PiglitTest(['gl-1.5-normal3b3s-invariance', 'GL_SHORT', '-auto'])
+gl15['normal3b3s-invariance-byte'] = PiglitGLTest(['gl-1.5-normal3b3s-invariance', 'GL_BYTE', '-auto'])
+gl15['normal3b3s-invariance-short'] = PiglitGLTest(['gl-1.5-normal3b3s-invariance', 'GL_SHORT', '-auto'])
 
 gl20 = {}
 spec['!OpenGL 2.0'] = gl20
@@ -1081,7 +1081,7 @@ def add_recursion_test(group, name):
     # This may cause false negatives on systems that map the framebuffer
     # into the processes address space.  This happens on X with DRI1 based
     # drivers, for example.
-    group[name] = PiglitTest(['recursion', '-auto', '-rlimit', '268435456', name])
+    group[name] = PiglitGLTest(['recursion', '-auto', '-rlimit', '268435456', name])
 
 rec = {}
 spec['glsl-1.20']['recursion'] = rec
@@ -1188,7 +1188,7 @@ add_plain_test(spec['glsl-1.30']['linker']['clipping'], 'mixing-clip-distance-an
 add_plain_test(spec['glsl-1.30']['execution']['clipping'], 'max-clip-distances')
 for arg in ['vs_basic', 'vs_xfb', 'vs_fbo', 'fs_basic', 'fs_fbo']:
     test_name = 'isinf-and-isnan ' + arg
-    spec['glsl-1.30']['execution'][test_name] = PiglitTest(test_name + ' -auto')
+    spec['glsl-1.30']['execution'][test_name] = PiglitGLTest(test_name + ' -auto')
 spec['glsl-1.30']['execution']['clipping']['clip-plane-transformation pos'] = \
     concurrent_test('clip-plane-transformation pos')
 spec['glsl-1.30']['texel-offset-limits'] = concurrent_test('glsl-1.30-texel-offset-limits')
@@ -1505,8 +1505,8 @@ add_concurrent_test(spec['glsl-es-3.00']['execution'], 'varying-struct-centroid_
 spec['glsl-es-3.00']['built-in constants'] = concurrent_test('built-in-constants_gles3 ' + os.path.join(testsDir, 'spec/glsl-es-3.00/minimum-maximums.txt'))
 
 # AMD_performance_monitor
-profile.test_list['spec/AMD_performance_monitor/api'] = PiglitTest('amd_performance_monitor_api -auto')
-profile.test_list['spec/AMD_performance_monitor/measure'] = PiglitTest('amd_performance_monitor_measure -auto')
+profile.test_list['spec/AMD_performance_monitor/api'] = PiglitGLTest('amd_performance_monitor_api -auto')
+profile.test_list['spec/AMD_performance_monitor/measure'] = PiglitGLTest('amd_performance_monitor_measure -auto')
 
 # Group AMD_conservative_depth
 spec['AMD_conservative_depth'] = {}
@@ -1684,10 +1684,10 @@ arb_draw_elements_base_vertex = {}
 spec['ARB_draw_elements_base_vertex'] = arb_draw_elements_base_vertex
 arb_draw_elements_base_vertex['dlist'] = concurrent_test('arb_draw_elements_base_vertex-dlist')
 add_plain_test(arb_draw_elements_base_vertex, 'arb_draw_elements_base_vertex-drawelements')
-arb_draw_elements_base_vertex['arb_draw_elements_base_vertex-drawelements-user_varrays'] = PiglitTest(['arb_draw_elements_base_vertex-drawelements', '-auto', 'user_varrays'])
+arb_draw_elements_base_vertex['arb_draw_elements_base_vertex-drawelements-user_varrays'] = PiglitGLTest(['arb_draw_elements_base_vertex-drawelements', '-auto', 'user_varrays'])
 add_plain_test(arb_draw_elements_base_vertex, 'arb_draw_elements_base_vertex-negative-index')
 add_plain_test(arb_draw_elements_base_vertex, 'arb_draw_elements_base_vertex-bounds')
-arb_draw_elements_base_vertex['arb_draw_elements_base_vertex-negative-index-user_varrays'] = PiglitTest(['arb_draw_elements_base_vertex-negative-index', '-auto', 'user_varrays'])
+arb_draw_elements_base_vertex['arb_draw_elements_base_vertex-negative-index-user_varrays'] = PiglitGLTest(['arb_draw_elements_base_vertex-negative-index', '-auto', 'user_varrays'])
 add_plain_test(arb_draw_elements_base_vertex, 'arb_draw_elements_base_vertex-drawelements-instanced')
 add_plain_test(arb_draw_elements_base_vertex, 'arb_draw_elements_base_vertex-drawrangeelements')
 add_plain_test(arb_draw_elements_base_vertex, 'arb_draw_elements_base_vertex-multidrawelements')
@@ -1977,17 +1977,17 @@ TEST_SAMPLE_COUNTS = (0,) + MSAA_SAMPLE_COUNTS
 for num_samples in TEST_SAMPLE_COUNTS:
     test_name = 'builtin-gl-num-samples {0}'.format(num_samples)
     executable = 'arb_sample_shading-{0} -auto'.format(test_name)
-    arb_sample_shading[test_name] = PiglitTest(executable)
+    arb_sample_shading[test_name] = PiglitGLTest(executable)
 
 for num_samples in TEST_SAMPLE_COUNTS:
     test_name = 'builtin-gl-sample-id {0}'.format(num_samples)
     executable = 'arb_sample_shading-{0} -auto'.format(test_name)
-    arb_sample_shading[test_name] = PiglitTest(executable)
+    arb_sample_shading[test_name] = PiglitGLTest(executable)
 
 for num_samples in TEST_SAMPLE_COUNTS:
     test_name = 'builtin-gl-sample-mask {0}'.format(num_samples)
     executable = 'arb_sample_shading-{0} -auto'.format(test_name)
-    arb_sample_shading[test_name] = PiglitTest(executable)
+    arb_sample_shading[test_name] = PiglitGLTest(executable)
 
 for num_samples in (0,2,4,6,8):
     test_name = 'builtin-gl-sample-mask-simple {0}'.format(num_samples)
@@ -1997,17 +1997,17 @@ for num_samples in (0,2,4,6,8):
 for num_samples in TEST_SAMPLE_COUNTS:
     test_name = 'builtin-gl-sample-position {0}'.format(num_samples)
     executable = 'arb_sample_shading-{0} -auto'.format(test_name)
-    arb_sample_shading[test_name] = PiglitTest(executable)
+    arb_sample_shading[test_name] = PiglitGLTest(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = 'interpolate-at-sample-position {0}'.format(num_samples)
     executable = 'arb_sample_shading-{0} -auto'.format(test_name)
-    arb_sample_shading[test_name] = PiglitTest(executable)
+    arb_sample_shading[test_name] = PiglitGLTest(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = 'ignore-centroid-qualifier {0}'.format(num_samples)
     executable = 'arb_sample_shading-{0} -auto'.format(test_name)
-    arb_sample_shading[test_name] = PiglitTest(executable)
+    arb_sample_shading[test_name] = PiglitGLTest(executable)
 
 import_glsl_parser_tests(spec['ARB_sample_shading'],
                          os.path.join(testsDir, 'spec', 'arb_sample_shading'),
@@ -2153,7 +2153,7 @@ add_plain_test(arb_explicit_attrib_location, 'glsl-explicit-location-05')
 for test_type in ('shader', 'api'):
     test_name = 'overlapping-locations-input-attribs {0}'.format(test_type)
     executable = '{0} -auto'.format(test_name)
-    arb_explicit_attrib_location[test_name] = PiglitTest(executable)
+    arb_explicit_attrib_location[test_name] = PiglitGLTest(executable)
 
 # Group ARB_explicit_uniform_location
 arb_explicit_uniform_location = {}
@@ -2373,8 +2373,8 @@ add_plain_test(apple_vertex_array_object, 'vao-01')
 add_plain_test(apple_vertex_array_object, 'vao-02')
 apple_vertex_array_object['isvertexarray'] = concurrent_test('arb_vertex_array-isvertexarray apple')
 
-profile.test_list['spec/ARB_vertex_array_bgra/api-errors'] = PiglitTest('arb_vertex_array_bgra-api-errors -auto')
-profile.test_list['spec/ARB_vertex_array_bgra/get'] = PiglitTest('arb_vertex_array_bgra-get -auto')
+profile.test_list['spec/ARB_vertex_array_bgra/api-errors'] = PiglitGLTest('arb_vertex_array_bgra-api-errors -auto')
+profile.test_list['spec/ARB_vertex_array_bgra/get'] = PiglitGLTest('arb_vertex_array_bgra-get -auto')
 
 arb_vertex_array_object = {}
 spec['ARB_vertex_array_object'] = arb_vertex_array_object
@@ -2383,8 +2383,8 @@ arb_vertex_array_object['isvertexarray'] = concurrent_test('arb_vertex_array-isv
 
 arb_vertex_buffer_object = {}
 spec['ARB_vertex_buffer_object'] = arb_vertex_buffer_object
-arb_vertex_buffer_object['elements-negative-offset'] = PiglitTest(['arb_vertex_buffer_object-elements-negative-offset', '-auto'])
-arb_vertex_buffer_object['mixed-immediate-and-vbo'] = PiglitTest(['arb_vertex_buffer_object-mixed-immediate-and-vbo', '-auto'])
+arb_vertex_buffer_object['elements-negative-offset'] = PiglitGLTest(['arb_vertex_buffer_object-elements-negative-offset', '-auto'])
+arb_vertex_buffer_object['mixed-immediate-and-vbo'] = PiglitGLTest(['arb_vertex_buffer_object-mixed-immediate-and-vbo', '-auto'])
 add_plain_test(arb_vertex_buffer_object, 'fdo14575')
 add_plain_test(arb_vertex_buffer_object, 'fdo22540')
 add_plain_test(arb_vertex_buffer_object, 'fdo31934')
@@ -2402,8 +2402,8 @@ add_plain_test(arb_vertex_buffer_object, 'vbo-subdata-zero')
 
 arb_vertex_program = {}
 spec['ARB_vertex_program'] = arb_vertex_program
-arb_vertex_program['getenv4d-with-error'] = PiglitTest(['arb_vertex_program-getenv4d-with-error', '-auto'])
-arb_vertex_program['getlocal4d-with-error'] = PiglitTest(['arb_vertex_program-getlocal4d-with-error', '-auto'])
+arb_vertex_program['getenv4d-with-error'] = PiglitGLTest(['arb_vertex_program-getenv4d-with-error', '-auto'])
+arb_vertex_program['getlocal4d-with-error'] = PiglitGLTest(['arb_vertex_program-getlocal4d-with-error', '-auto'])
 arb_vertex_program['getlocal4f-max'] = concurrent_test('arb_vertex_program-getlocal4f-max')
 arb_vertex_program['getlocal4-errors'] = concurrent_test('arb_vertex_program-getlocal4-errors')
 arb_vertex_program['clip-plane-transformation arb'] = concurrent_test('clip-plane-transformation arb')
@@ -2530,7 +2530,7 @@ for num_samples in MSAA_SAMPLE_COUNTS:
 for num_samples in MSAA_SAMPLE_COUNTS:
     test_name = ' '.join(['turn-on-off', str(num_samples)])
     executable = 'ext_framebuffer_multisample-{0} -auto'.format(test_name)
-    ext_framebuffer_multisample[test_name] = PiglitTest(executable)
+    ext_framebuffer_multisample[test_name] = PiglitGLTest(executable)
 
 for num_samples in MSAA_SAMPLE_COUNTS:
     for buffer_type in ('color', 'depth', 'stencil'):
@@ -2786,8 +2786,8 @@ add_plain_test(ext_image_dma_buf_import, 'ext_image_dma_buf_import-invalid_hints
 add_plain_test(ext_image_dma_buf_import, 'ext_image_dma_buf_import-invalid_attributes')
 add_plain_test(ext_image_dma_buf_import, 'ext_image_dma_buf_import-missing_attributes')
 add_plain_test(ext_image_dma_buf_import, 'ext_image_dma_buf_import-ownership_transfer')
-ext_image_dma_buf_import['ext_image_dma_buf_import-sample_argb8888'] = PiglitTest(['ext_image_dma_buf_import-sample_rgb', '-fmt=AR24', '-auto'])
-ext_image_dma_buf_import['ext_image_dma_buf_import-sample_xrgb8888'] = PiglitTest(['ext_image_dma_buf_import-sample_rgb', '-auto', '-fmt=XR24', '-alpha-one'])
+ext_image_dma_buf_import['ext_image_dma_buf_import-sample_argb8888'] = PiglitGLTest(['ext_image_dma_buf_import-sample_rgb', '-fmt=AR24', '-auto'])
+ext_image_dma_buf_import['ext_image_dma_buf_import-sample_xrgb8888'] = PiglitGLTest(['ext_image_dma_buf_import-sample_rgb', '-auto', '-fmt=XR24', '-alpha-one'])
 add_plain_test(ext_image_dma_buf_import, 'ext_image_dma_buf_import-intel_unsupported_format')
 add_plain_test(ext_image_dma_buf_import, 'ext_image_dma_buf_import-intel_external_sampler_only')
 add_plain_test(ext_image_dma_buf_import, 'ext_image_dma_buf_import-intel_external_sampler_with_dma_only')
@@ -2799,7 +2799,7 @@ add_fbo_stencil_tests(ext_packed_depth_stencil, 'GL_DEPTH24_STENCIL8')
 add_fbo_depthstencil_tests(ext_packed_depth_stencil, 'GL_DEPTH24_STENCIL8', 0)
 add_fbo_formats_tests('spec/EXT_packed_depth_stencil', 'GL_EXT_packed_depth_stencil')
 add_texwrap_format_tests(ext_packed_depth_stencil, 'GL_EXT_packed_depth_stencil')
-ext_packed_depth_stencil['readpixels-24_8'] = PiglitTest(['ext_packed_depth_stencil-readpixels-24_8', '-auto'])
+ext_packed_depth_stencil['readpixels-24_8'] = PiglitGLTest(['ext_packed_depth_stencil-readpixels-24_8', '-auto'])
 add_plain_test(ext_packed_depth_stencil, 'fbo-blit-d24s8')
 add_depthstencil_render_miplevels_tests(
         ext_packed_depth_stencil,
@@ -2839,7 +2839,7 @@ add_concurrent_test(ext_texture_array, 'getteximage-targets 1D_ARRAY')
 add_concurrent_test(ext_texture_array, 'getteximage-targets 2D_ARRAY')
 for test_mode in ['teximage', 'texsubimage']:
     test_name = 'compressed {0}'.format(test_mode)
-    ext_texture_array[test_name] = PiglitTest('ext_texture_array-' + test_name + ' -auto -fbo')
+    ext_texture_array[test_name] = PiglitGLTest('ext_texture_array-' + test_name + ' -auto -fbo')
 
 arb_texture_cube_map = {}
 spec['ARB_texture_cube_map'] = arb_texture_cube_map
@@ -2847,10 +2847,10 @@ add_msaa_visual_plain_tests(arb_texture_cube_map, 'copyteximage CUBE')
 add_plain_test(arb_texture_cube_map, 'crash-cubemap-order')
 add_plain_test(arb_texture_cube_map, 'cubemap')
 add_concurrent_test(arb_texture_cube_map, 'cubemap-getteximage-pbo')
-arb_texture_cube_map['cubemap npot'] = PiglitTest(['cubemap', '-auto', 'npot'])
+arb_texture_cube_map['cubemap npot'] = PiglitGLTest(['cubemap', '-auto', 'npot'])
 add_plain_test(arb_texture_cube_map, 'cubemap-shader')
-arb_texture_cube_map['cubemap-shader lod'] = PiglitTest(['cubemap-shader', '-auto', 'lod'])
-arb_texture_cube_map['cubemap-shader bias'] = PiglitTest(['cubemap-shader', '-auto', 'bias'])
+arb_texture_cube_map['cubemap-shader lod'] = PiglitGLTest(['cubemap-shader', '-auto', 'lod'])
+arb_texture_cube_map['cubemap-shader bias'] = PiglitGLTest(['cubemap-shader', '-auto', 'bias'])
 add_concurrent_test(arb_texture_cube_map, 'getteximage-targets CUBE')
 
 arb_texture_cube_map_array = {}
@@ -3179,10 +3179,10 @@ ext_transform_feedback['geometry-shaders-basic'] = concurrent_test(
 
 arb_transform_feedback2 = {}
 spec['ARB_transform_feedback2'] = arb_transform_feedback2
-arb_transform_feedback2['Change objects while paused'] = PiglitTest(['arb_transform_feedback2-change-objects-while-paused', '-auto'])
-arb_transform_feedback2['Change objects while paused (GLES3)'] = PiglitTest(['arb_transform_feedback2-change-objects-while-paused_gles3', '-auto'])
-arb_transform_feedback2['draw-auto'] = PiglitTest(['arb_transform_feedback2-draw-auto', '-auto'])
-arb_transform_feedback2['istranformfeedback'] = PiglitTest(['arb_transform_feedback2-istransformfeedback', '-auto'])
+arb_transform_feedback2['Change objects while paused'] = PiglitGLTest(['arb_transform_feedback2-change-objects-while-paused', '-auto'])
+arb_transform_feedback2['Change objects while paused (GLES3)'] = PiglitGLTest(['arb_transform_feedback2-change-objects-while-paused_gles3', '-auto'])
+arb_transform_feedback2['draw-auto'] = PiglitGLTest(['arb_transform_feedback2-draw-auto', '-auto'])
+arb_transform_feedback2['istranformfeedback'] = PiglitGLTest(['arb_transform_feedback2-istransformfeedback', '-auto'])
 arb_transform_feedback2['glGenTransformFeedbacks names only'] = concurrent_test('arb_transform_feedback2-gen-names-only')
 arb_transform_feedback2['cannot bind when another object is active'] = concurrent_test('arb_transform_feedback2-cannot-bind-when-active')
 arb_transform_feedback2['misc. API queries'] = concurrent_test('arb_transform_feedback2-api-queries')
@@ -3190,7 +3190,7 @@ arb_transform_feedback2['counting with pause'] = concurrent_test('arb_transform_
 
 arb_transform_feedback_instanced = {}
 spec['ARB_transform_feedback_instanced'] = arb_transform_feedback_instanced
-arb_transform_feedback_instanced['draw-auto instanced'] = PiglitTest(['arb_transform_feedback2-draw-auto', '-auto', 'instanced'])
+arb_transform_feedback_instanced['draw-auto instanced'] = PiglitGLTest(['arb_transform_feedback2-draw-auto', '-auto', 'instanced'])
 
 arb_transform_feedback3 = {}
 spec['ARB_transform_feedback3'] = arb_transform_feedback3
@@ -3203,16 +3203,16 @@ for param in ['gl_NextBuffer-1', 'gl_NextBuffer-2', 'gl_SkipComponents1-1',
     arb_transform_feedback3[param] = concurrent_test(
             'ext_transform_feedback-output-type {0}'.format(param))
 
-arb_transform_feedback3['arb_transform_feedback3-bind_buffer_invalid_index'] = PiglitTest(['arb_transform_feedback3-bind_buffer_invalid_index', '-auto'])
-arb_transform_feedback3['arb_transform_feedback3-query_with_invalid_index'] = PiglitTest(['arb_transform_feedback3-query_with_invalid_index', '-auto'])
-arb_transform_feedback3['arb_transform_feedback3-end_query_with_name_zero'] = PiglitTest(['arb_transform_feedback3-end_query_with_name_zero', '-auto'])
-arb_transform_feedback3['arb_transform_feedback3-draw_using_invalid_stream_index'] = PiglitTest(['arb_transform_feedback3-draw_using_invalid_stream_index', '-auto'])
-arb_transform_feedback3['arb_transform_feedback3-set_varyings_with_invalid_args'] = PiglitTest(['arb_transform_feedback3-set_varyings_with_invalid_args', '-auto'])
-arb_transform_feedback3['arb_transform_feedback3-set_invalid_varyings'] = PiglitTest(['arb_transform_feedback3-set_invalid_varyings', '-auto'])
+arb_transform_feedback3['arb_transform_feedback3-bind_buffer_invalid_index'] = PiglitGLTest(['arb_transform_feedback3-bind_buffer_invalid_index', '-auto'])
+arb_transform_feedback3['arb_transform_feedback3-query_with_invalid_index'] = PiglitGLTest(['arb_transform_feedback3-query_with_invalid_index', '-auto'])
+arb_transform_feedback3['arb_transform_feedback3-end_query_with_name_zero'] = PiglitGLTest(['arb_transform_feedback3-end_query_with_name_zero', '-auto'])
+arb_transform_feedback3['arb_transform_feedback3-draw_using_invalid_stream_index'] = PiglitGLTest(['arb_transform_feedback3-draw_using_invalid_stream_index', '-auto'])
+arb_transform_feedback3['arb_transform_feedback3-set_varyings_with_invalid_args'] = PiglitGLTest(['arb_transform_feedback3-set_varyings_with_invalid_args', '-auto'])
+arb_transform_feedback3['arb_transform_feedback3-set_invalid_varyings'] = PiglitGLTest(['arb_transform_feedback3-set_invalid_varyings', '-auto'])
 
-arb_transform_feedback3['arb_transform_feedback3-ext_interleaved_two_bufs_vs'] = PiglitTest(['arb_transform_feedback3-ext_interleaved_two_bufs', '-auto', 'vs'])
-arb_transform_feedback3['arb_transform_feedback3-ext_interleaved_two_bufs_gs'] = PiglitTest(['arb_transform_feedback3-ext_interleaved_two_bufs', '-auto', 'gs'])
-arb_transform_feedback3['arb_transform_feedback3-ext_interleaved_two_bufs_gs_max'] = PiglitTest(['arb_transform_feedback3-ext_interleaved_two_bufs', '-auto', 'gs_max'])
+arb_transform_feedback3['arb_transform_feedback3-ext_interleaved_two_bufs_vs'] = PiglitGLTest(['arb_transform_feedback3-ext_interleaved_two_bufs', '-auto', 'vs'])
+arb_transform_feedback3['arb_transform_feedback3-ext_interleaved_two_bufs_gs'] = PiglitGLTest(['arb_transform_feedback3-ext_interleaved_two_bufs', '-auto', 'gs'])
+arb_transform_feedback3['arb_transform_feedback3-ext_interleaved_two_bufs_gs_max'] = PiglitGLTest(['arb_transform_feedback3-ext_interleaved_two_bufs', '-auto', 'gs_max'])
 
 arb_uniform_buffer_object = {}
 spec['ARB_uniform_buffer_object'] = arb_uniform_buffer_object
@@ -3260,8 +3260,8 @@ arb_uniform_buffer_object['uniformblockbinding'] = concurrent_test('arb_uniform_
 ati_draw_buffers = {}
 spec['ATI_draw_buffers'] = ati_draw_buffers
 add_plain_test(ati_draw_buffers, 'ati_draw_buffers-arbfp')
-ati_draw_buffers['arbfp-no-index'] = PiglitTest(['ati_draw_buffers-arbfp-no-index', '-auto'])
-ati_draw_buffers['arbfp-no-option'] = PiglitTest(['ati_draw_buffers-arbfp-no-option', '-auto'])
+ati_draw_buffers['arbfp-no-index'] = PiglitGLTest(['ati_draw_buffers-arbfp-no-index', '-auto'])
+ati_draw_buffers['arbfp-no-option'] = PiglitGLTest(['ati_draw_buffers-arbfp-no-option', '-auto'])
 
 ati_envmap_bumpmap = {}
 spec['ATI_envmap_bumpmap'] = ati_envmap_bumpmap
@@ -3336,16 +3336,16 @@ nv_conditional_render = {}
 spec['NV_conditional_render'] = nv_conditional_render
 nv_conditional_render['begin-while-active'] = concurrent_test('nv_conditional_render-begin-while-active')
 nv_conditional_render['begin-zero'] = concurrent_test('nv_conditional_render-begin-zero')
-nv_conditional_render['bitmap'] = PiglitTest(['nv_conditional_render-bitmap', '-auto'])
-nv_conditional_render['blitframebuffer'] = PiglitTest(['nv_conditional_render-blitframebuffer', '-auto'])
-nv_conditional_render['clear'] = PiglitTest(['nv_conditional_render-clear', '-auto'])
-nv_conditional_render['copypixels'] = PiglitTest(['nv_conditional_render-copypixels', '-auto'])
-nv_conditional_render['copyteximage'] = PiglitTest(['nv_conditional_render-copyteximage', '-auto'])
-nv_conditional_render['copytexsubimage'] = PiglitTest(['nv_conditional_render-copytexsubimage', '-auto'])
-nv_conditional_render['dlist'] = PiglitTest(['nv_conditional_render-dlist', '-auto'])
-nv_conditional_render['drawpixels'] = PiglitTest(['nv_conditional_render-drawpixels', '-auto'])
-nv_conditional_render['generatemipmap'] = PiglitTest(['nv_conditional_render-generatemipmap', '-auto'])
-nv_conditional_render['vertex_array'] = PiglitTest(['nv_conditional_render-vertex_array', '-auto'])
+nv_conditional_render['bitmap'] = PiglitGLTest(['nv_conditional_render-bitmap', '-auto'])
+nv_conditional_render['blitframebuffer'] = PiglitGLTest(['nv_conditional_render-blitframebuffer', '-auto'])
+nv_conditional_render['clear'] = PiglitGLTest(['nv_conditional_render-clear', '-auto'])
+nv_conditional_render['copypixels'] = PiglitGLTest(['nv_conditional_render-copypixels', '-auto'])
+nv_conditional_render['copyteximage'] = PiglitGLTest(['nv_conditional_render-copyteximage', '-auto'])
+nv_conditional_render['copytexsubimage'] = PiglitGLTest(['nv_conditional_render-copytexsubimage', '-auto'])
+nv_conditional_render['dlist'] = PiglitGLTest(['nv_conditional_render-dlist', '-auto'])
+nv_conditional_render['drawpixels'] = PiglitGLTest(['nv_conditional_render-drawpixels', '-auto'])
+nv_conditional_render['generatemipmap'] = PiglitGLTest(['nv_conditional_render-generatemipmap', '-auto'])
+nv_conditional_render['vertex_array'] = PiglitGLTest(['nv_conditional_render-vertex_array', '-auto'])
 
 oes_matrix_get = {}
 spec['OES_matrix_get'] = oes_matrix_get
@@ -3489,7 +3489,7 @@ add_concurrent_test(arb_copy_image, 'arb_copy_image-formats --samples=8')
 arb_half_float_vertex = {}
 spec['ARB_half_float_vertex'] = arb_half_float_vertex
 add_plain_test(arb_half_float_vertex, 'draw-vertices-half-float')
-arb_half_float_vertex['draw-vertices-half-float-user'] = PiglitTest(['draw-vertices-half-float', '-auto', 'user'])
+arb_half_float_vertex['draw-vertices-half-float-user'] = PiglitGLTest(['draw-vertices-half-float', '-auto', 'user'])
 
 arb_vertex_type_2_10_10_10_rev = {}
 spec['ARB_vertex_type_2_10_10_10_rev'] = arb_vertex_type_2_10_10_10_rev
@@ -4198,7 +4198,7 @@ for tex_format in ('rgb8', 'srgb8', 'rgba8', 'srgb8-alpha8', 'r11', 'rg11', 'rgb
 gles30['minmax'] = concurrent_test('minmax_gles3')
 for test_mode in ['teximage', 'texsubimage']:
     test_name = 'ext_texture_array-compressed_gles3 {0}'.format(test_mode)
-    gles30[test_name] = PiglitTest(test_name + ' -auto -fbo')
+    gles30[test_name] = PiglitGLTest(test_name + ' -auto -fbo')
 gles30['texture-immutable-levels'] = concurrent_test('texture-immutable-levels_gles3')
 gles30['gl_VertexID used with glDrawArrays'] = concurrent_test('gles-3.0-drawarrays-vertexid')
 
diff --git a/tests/cl.py b/tests/cl.py
index 885c43a..8325728 100644
--- a/tests/cl.py
+++ b/tests/cl.py
@@ -11,7 +11,7 @@ import platform
 import glob
 
 from framework.profile import TestProfile
-from framework.test import PiglitTest
+from framework.test import PiglitCLTest
 
 ######
 # Helper functions
@@ -19,7 +19,7 @@ from framework.test import PiglitTest
 can_do_concurrent = platform.system().lower()[0:5] != 'linux' or glob.glob('/dev/dri/render*')
 
 def add_plain_test(group, name, args):
-        group[name] = PiglitTest(args, run_concurrent=can_do_concurrent)
+        group[name] = PiglitCLTest(args, run_concurrent=can_do_concurrent)
 
 def add_plain_program_tester_test(group, name, path):
         add_plain_test(group, name, ['cl-program-tester', path])
-- 
2.1.2



More information about the Piglit mailing list