[Piglit] [PATCH 1/3] framework: Add a name to test profiles

Dylan Baker dylan at pnwbakers.com
Wed Apr 12 17:55:04 UTC 2017


Attaching a name has infinite uses, in this case it's groundwork for the
next patch to give better error messages.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/profile.py   | 6 ++++--
 framework/test/deqp.py | 4 ++--
 tests/all.py           | 2 +-
 tests/cl.py            | 2 +-
 tests/cpu.py           | 2 +-
 tests/cts_gl.py        | 1 +
 tests/cts_gl45.py      | 1 +
 tests/cts_gles.py      | 1 +
 tests/deqp_egl.py      | 1 +
 tests/deqp_gles2.py    | 1 +
 tests/deqp_gles3.py    | 1 +
 tests/deqp_gles31.py   | 1 +
 tests/deqp_vk.py       | 1 +
 tests/es3conform.py    | 4 ++--
 tests/glslparser.py    | 2 +-
 tests/gpu.py           | 2 +-
 tests/igt.py           | 2 +-
 tests/llvmpipe.py      | 2 +-
 tests/oglconform.py    | 2 +-
 tests/quick.py         | 2 +-
 tests/quick_cl.py      | 2 +-
 tests/sanity.py        | 2 +-
 tests/shader.py        | 2 +-
 tests/xts-render.py    | 2 +-
 tests/xts.py           | 2 +-
 25 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/framework/profile.py b/framework/profile.py
index 94efd0a2c..4604367e1 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -278,7 +278,8 @@ class TestProfile(object):
     handled by the run function in this module, which is able to process and
     run multiple TestProfile objects at once.
     """
-    def __init__(self):
+    def __init__(self, name):
+        self.name = name
         self.test_list = TestDict()
         self.forced_test_list = []
         self.filters = []
@@ -293,7 +294,7 @@ class TestProfile(object):
     def teardown(self):
         """Method to od post-run teardown."""
 
-    def copy(self):
+    def copy(self, name):
         """Create a copy of the TestProfile.
 
         This method creates a copy with references to the original instance
@@ -301,6 +302,7 @@ class TestProfile(object):
         profiles, without modifying the original.
         """
         new = copy.copy(self)
+        new.name = name
         new.test_list = copy.copy(self.test_list)
         new.forced_test_list = copy.copy(self.forced_test_list)
         new.filters = copy.copy(self.filters)
diff --git a/framework/test/deqp.py b/framework/test/deqp.py
index 871ce2545..c623fb357 100644
--- a/framework/test/deqp.py
+++ b/framework/test/deqp.py
@@ -79,9 +79,9 @@ def select_source(bin_, filename, mustpass, extra_args):
             gen_caselist_txt(bin_, filename, extra_args))
 
 
-def make_profile(test_list, test_class):
+def make_profile(name, test_list, test_class):
     """Create a TestProfile instance."""
-    profile = TestProfile()
+    profile = TestProfile(name)
     for testname in test_list:
         # deqp uses '.' as the testgroup separator.
         piglit_name = testname.replace('.', grouptools.SEPARATOR)
diff --git a/tests/all.py b/tests/all.py
index 9a6c6f963..f44431275 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -206,7 +206,7 @@ def power_set(s):
 
 ######
 # Collecting all tests
-profile = TestProfile()  # pylint: disable=invalid-name
+profile = TestProfile('OpenGL: All')  # pylint: disable=invalid-name
 
 shader_tests = collections.defaultdict(list)
 
diff --git a/tests/cl.py b/tests/cl.py
index f06b3f638..fb1d12299 100644
--- a/tests/cl.py
+++ b/tests/cl.py
@@ -20,7 +20,7 @@ from .py_modules.constants import TESTS_DIR, GENERATED_TESTS_DIR
 
 __all__ = ['profile']
 
-profile = TestProfile()
+profile = TestProfile('OpenCL: Piglit')
 
 # Custom
 with profile.test_list.group_manager(PiglitCLTest, 'custom') as g:
diff --git a/tests/cpu.py b/tests/cpu.py
index 65d999062..c3c83b042 100644
--- a/tests/cpu.py
+++ b/tests/cpu.py
@@ -18,7 +18,7 @@ from framework.test import GLSLParserTest
 
 __all__ = ['profile']
 
-profile = _profile.copy()  # pylint: disable=invalid-name
+profile = _profile.copy('OpenGL: CPU tests')  # pylint: disable=invalid-name
 
 
 def filter_gpu(name, test):
diff --git a/tests/cts_gl.py b/tests/cts_gl.py
index d650ffd4b..9e961dc8c 100644
--- a/tests/cts_gl.py
+++ b/tests/cts_gl.py
@@ -67,6 +67,7 @@ class DEQPCTSTest(deqp.DEQPBaseTest):
 
 # Add all of the suites by default, users can use filters to remove them.
 profile = deqp.make_profile(  # pylint: disable=invalid-name
+    'OpenGL: CTS',
     itertools.chain(
         deqp.iter_deqp_test_cases(
             deqp.gen_caselist_txt(_CTS_BIN, 'GL30-CTS-cases.txt', _EXTRA_ARGS)),
diff --git a/tests/cts_gl45.py b/tests/cts_gl45.py
index 2782e18f4..76c1ad0a2 100644
--- a/tests/cts_gl45.py
+++ b/tests/cts_gl45.py
@@ -61,6 +61,7 @@ class DEQPCTSTest(deqp.DEQPBaseTest):
             [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]
 
 profile = deqp.make_profile(  # pylint: disable=invalid-name
+    'OpenGL: GL4.5 CTS',
     itertools.chain(
         deqp.iter_deqp_test_cases(
             deqp.gen_caselist_txt(_CTS_BIN, 'GL45-CTS-cases.txt', _EXTRA_ARGS)),
diff --git a/tests/cts_gles.py b/tests/cts_gles.py
index 64de79d7f..03d6533ec 100644
--- a/tests/cts_gles.py
+++ b/tests/cts_gles.py
@@ -69,6 +69,7 @@ class DEQPCTSTest(deqp.DEQPBaseTest):
 
 # Add all of the suites by default, users can use filters to remove them.
 profile = deqp.make_profile(  # pylint: disable=invalid-name
+    'OpenGL: ES CTS',
     itertools.chain(
         deqp.iter_deqp_test_cases(
             deqp.gen_caselist_txt(_CTS_BIN, 'ES2-CTS-cases.txt', _EXTRA_ARGS)),
diff --git a/tests/deqp_egl.py b/tests/deqp_egl.py
index 7422c82e3..053d0ad33 100644
--- a/tests/deqp_egl.py
+++ b/tests/deqp_egl.py
@@ -48,6 +48,7 @@ class DEQPEGLTest(deqp.DEQPBaseTest):
 
 
 profile = deqp.make_profile(  # pylint: disable=invalid-name
+    'OpenGL: EGL CTS',
     deqp.iter_deqp_test_cases(
         deqp.gen_caselist_txt(_EGL_BIN, 'dEQP-EGL-cases.txt',
                               _EXTRA_ARGS)),
diff --git a/tests/deqp_gles2.py b/tests/deqp_gles2.py
index 518a4e04c..bb2aa80a5 100644
--- a/tests/deqp_gles2.py
+++ b/tests/deqp_gles2.py
@@ -54,6 +54,7 @@ class DEQPGLES2Test(deqp.DEQPBaseTest):
 
 
 profile = deqp.make_profile(  # pylint: disable=invalid-name
+    'OpenGL: DEQP-GLES2',
     deqp.select_source(_DEQP_GLES2_BIN, 'dEQP-GLES2-cases.txt', _DEQP_MUSTPASS,
                        _EXTRA_ARGS),
     DEQPGLES2Test)
diff --git a/tests/deqp_gles3.py b/tests/deqp_gles3.py
index 210c6e4ed..9753d9775 100644
--- a/tests/deqp_gles3.py
+++ b/tests/deqp_gles3.py
@@ -93,6 +93,7 @@ class DEQPGLES3Test(deqp.DEQPBaseTest):
 
 
 profile = deqp.make_profile(  # pylint: disable=invalid-name
+    'OpenGL: DEQP GLES3',
     deqp.select_source(_DEQP_GLES3_BIN, 'dEQP-GLES3-cases.txt', _DEQP_MUSTPASS,
                        _EXTRA_ARGS),
     DEQPGLES3Test)
diff --git a/tests/deqp_gles31.py b/tests/deqp_gles31.py
index 7021e8966..baef12825 100644
--- a/tests/deqp_gles31.py
+++ b/tests/deqp_gles31.py
@@ -53,6 +53,7 @@ class DEQPGLES31Test(deqp.DEQPBaseTest):
 
 
 profile = deqp.make_profile(  # pylint: disable=invalid-name
+    'OpenGL: DEQP-GLES31',
     deqp.select_source(_DEQP_GLES31_BIN, 'dEQP-GLES31-cases.txt',
                        _DEQP_MUSTPASS, _EXTRA_ARGS),
     DEQPGLES31Test)
diff --git a/tests/deqp_vk.py b/tests/deqp_vk.py
index 4df9e3b63..cf1d33d07 100644
--- a/tests/deqp_vk.py
+++ b/tests/deqp_vk.py
@@ -72,6 +72,7 @@ class DEQPVKTest(deqp.DEQPBaseTest):
 
 
 profile = deqp.make_profile(  # pylint: disable=invalid-name
+    'Vulkan: CTS',
     deqp.iter_deqp_test_cases(
         deqp.gen_caselist_txt(_DEQP_VK_BIN, 'dEQP-VK-cases.txt',
                               _EXTRA_ARGS)),
diff --git a/tests/es3conform.py b/tests/es3conform.py
index 6bdcf2ba9..22b4dc939 100644
--- a/tests/es3conform.py
+++ b/tests/es3conform.py
@@ -1,4 +1,4 @@
-#
+j
 # 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
@@ -45,7 +45,7 @@ if not path.exists(path.join(TEST_BIN_DIR, 'GTF3')):
     raise exceptions.PiglitFatalError(
         'Missing GTF3 symlink. Unable to run es3conform tests.')
 
-profile = TestProfile()
+    profile = TestProfile('OpenGL: GTF3')
 
 # Chase the piglit/bin/GTF symlink to find where the tests really live.
 gtfroot = path.dirname(path.realpath(path.join(TEST_BIN_DIR, 'GTF3')))
diff --git a/tests/glslparser.py b/tests/glslparser.py
index 5d0facbc2..ffec9ef7d 100644
--- a/tests/glslparser.py
+++ b/tests/glslparser.py
@@ -9,6 +9,6 @@ from tests.all import profile as _profile
 
 __all__ = ['profile']
 
-profile = _profile.copy()  # pylint: disable=invalid-name
+profile = _profile.copy('OpenGL: GLSL Parser')  # pylint: disable=invalid-name
 
 profile.filters.append(lambda _, t: isinstance(t, GLSLParserTest))
diff --git a/tests/gpu.py b/tests/gpu.py
index fce550c67..389b8d120 100644
--- a/tests/gpu.py
+++ b/tests/gpu.py
@@ -11,7 +11,7 @@ from framework.test import GLSLParserTest
 
 __all__ = ['profile']
 
-profile = _profile.copy()  # pylint: disable=invalid-name
+profile = _profile.copy('OpenGL: GPU only tests')  # pylint: disable=invalid-name
 
 # Remove all parser tests, as they are compiler test
 profile.filters.append(lambda p, t: not isinstance(t, GLSLParserTest))
diff --git a/tests/igt.py b/tests/igt.py
index 87b61dccb..33e6981cb 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -101,7 +101,7 @@ class IGTTestProfile(TestProfile):
                 raise exceptions.PiglitFatalError(str(e))
 
 
-profile = IGTTestProfile()  # pylint: disable=invalid-name
+profile = IGTTestProfile('Linux: DRM subsystem')  # pylint: disable=invalid-name
 
 
 class IGTTest(Test):
diff --git a/tests/llvmpipe.py b/tests/llvmpipe.py
index 0ebd88b0d..219918124 100644
--- a/tests/llvmpipe.py
+++ b/tests/llvmpipe.py
@@ -12,7 +12,7 @@ from tests.gpu import profile as _profile
 
 __all__ = ['profile']
 
-profile = _profile.copy()  # pylint: disable=invalid-name
+profile = _profile.copy('OpenGL: LLVMPipe specific tests')  # pylint: disable=invalid-name
 
 
 def remove(key):
diff --git a/tests/oglconform.py b/tests/oglconform.py
index 5104f442b..6814f3148 100644
--- a/tests/oglconform.py
+++ b/tests/oglconform.py
@@ -84,7 +84,7 @@ class OGLCTest(Test):
 
 def _make_profile():
     """Create and populate a TestProfile instance."""
-    profile_ = TestProfile()
+    profile_ = TestProfile('OpenGL: OGL Conform')
 
     with tempfile.NamedTemporaryFile() as f:
         with open(os.devnull, "w") as d:
diff --git a/tests/quick.py b/tests/quick.py
index c587357f6..cef72b9b8 100644
--- a/tests/quick.py
+++ b/tests/quick.py
@@ -39,7 +39,7 @@ class FilterVsIn(object):
         return True
 
 
-profile = _profile.copy()  # pylint: disable=invalid-name
+profile = _profile.copy('OpenGL: Piglit Quick')  # pylint: disable=invalid-name
 
 GleanTest.GLOBAL_PARAMS += ["--quick"]
 
diff --git a/tests/quick_cl.py b/tests/quick_cl.py
index 831e8fda0..e941dcad9 100644
--- a/tests/quick_cl.py
+++ b/tests/quick_cl.py
@@ -31,7 +31,7 @@ from __future__ import (
 from tests.cl import profile as _profile
 from framework.test import add_opencv_tests, add_oclconform_tests
 
-profile = _profile.copy()  # pylint: disable=invalid-name
+profile = _profile.copy('OpenCL: Native + External')  # pylint: disable=invalid-name
 
 add_opencv_tests(profile)
 add_oclconform_tests(profile)
diff --git a/tests/sanity.py b/tests/sanity.py
index cb66bd33c..95a31da7d 100644
--- a/tests/sanity.py
+++ b/tests/sanity.py
@@ -12,7 +12,7 @@ from framework.test import PiglitGLTest
 
 __all__ = ['profile']
 
-profile = TestProfile()
+profile = TestProfile('OpenGL: Sanity')
 
 with profile.test_list.group_manager(
         PiglitGLTest,
diff --git a/tests/shader.py b/tests/shader.py
index d283a577c..742ee5d1c 100644
--- a/tests/shader.py
+++ b/tests/shader.py
@@ -9,6 +9,6 @@ from tests.all import profile as _profile
 
 __all__ = ['profile']
 
-profile = _profile.copy()  # pylint: disable=invalid-name
+profile = _profile.copy('OpenGL: Shader')  # pylint: disable=invalid-name
 
 profile.filters.append(lambda _, t: isinstance(t, (ShaderTest, MultiShaderTest)))
diff --git a/tests/xts-render.py b/tests/xts-render.py
index d2cd843f2..ba6163658 100644
--- a/tests/xts-render.py
+++ b/tests/xts-render.py
@@ -27,7 +27,7 @@ from tests.xts import profile as _profile
 
 __all__ = ['profile']
 
-profile = _profile.copy()  # pylint: disable=invalid-name
+profile = _profile.copy('X.org: X render')  # pylint: disable=invalid-name
 
 
 def xts_render_filter(path, test):
diff --git a/tests/xts.py b/tests/xts.py
index 715ecfa47..4fc6035ca 100644
--- a/tests/xts.py
+++ b/tests/xts.py
@@ -260,7 +260,7 @@ def _populate_profile_rendercheck(profile):
 def _populate_profile():
     """ Populate the profile attribute """
     # Add all tests to the profile
-    profile = XTSProfile()  # pylint: disable=redefined-outer-name
+    profile = XTSProfile('X.org: X')  # pylint: disable=redefined-outer-name
     _populate_profile_xts(profile)
     _populate_profile_rendercheck(profile)
     return profile
-- 
2.12.2



More information about the Piglit mailing list