[Piglit] [RFC 10/30] shader_test.py: remove add_shader_test

Dylan Baker baker.dylan.c at gmail.com
Tue Jan 27 14:58:44 PST 2015


This is a function to wrap a single line of code, which takes the same
number of arguments and does nothing special. Better yet, it is used
exactly once in add_shader_test_dir.

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/test/shader_test.py        | 15 +--------------
 framework/tests/shader_test_tests.py |  6 ------
 2 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
index ea4df3d..ee44ddb 100644
--- a/framework/test/shader_test.py
+++ b/framework/test/shader_test.py
@@ -33,7 +33,6 @@ from .piglit_test import PiglitBaseTest
 __all__ = [
     'ShaderTest',
     'ShaderTestParserException',
-    'add_shader_test',
     'add_shader_test_dir'
 ]
 
@@ -101,18 +100,6 @@ class ShaderTestParserException(Exception):
     pass
 
 
-def add_shader_test(group, testname, filepath):
-    """ Add a shader test to a group
-
-    Arguments:
-    group -- a dictionary-like object to add the test to
-    testname -- the key to use in the group
-    filepath -- the argument to pass to ShaderTest
-
-    """
-    group[testname] = ShaderTest(filepath)
-
-
 def add_shader_test_dir(group, dirpath):
     """Add all shader tests in a directory to the given group."""
     for filename in os.listdir(dirpath):
@@ -124,4 +111,4 @@ def add_shader_test_dir(group, dirpath):
             if ext != 'shader_test':
                 continue
             testname = filename[0:-(len(ext) + 1)]  # +1 for '.'
-            add_shader_test(group, testname, filepath)
+            group[testname] = ShaderTest(filepath)
diff --git a/framework/tests/shader_test_tests.py b/framework/tests/shader_test_tests.py
index 068f32f..bc4a5f5 100644
--- a/framework/tests/shader_test_tests.py
+++ b/framework/tests/shader_test_tests.py
@@ -75,12 +75,6 @@ def test_parse_gles3_test():
             "but instead ran with " + os.path.basename(test.command[0]))
 
 
-def test_add_shader_test():
-    """ Test that add_shader_test works """
-    testm.add_shader_test(
-        {}, 'test', 'tests/spec/glsl-es-3.00/execution/sanity.shader_test')
-
-
 def test_add_shader_test_dir():
     """ Test that add_shader_test_dir works """
     testm.add_shader_test_dir({}, 'tests/spec/glsl-es-3.00/execution')
-- 
2.2.2



More information about the Piglit mailing list