Commit a8718f4d authored by Dylan Baker's avatar Dylan Baker

framework/profile: Drop TestProfile.filter_tests

This was just a thin wrapper around the already public
TestProfile.filters list. It seems silly to have such a method when it
does nothing but call self.filters.append.
Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
parent 3ca3557d
......@@ -287,16 +287,6 @@ class TestProfile(object):
raise exceptions.PiglitFatalError(
'There are no tests scheduled to run. Aborting run.')
def filter_tests(self, function):
"""Filter out tests that return false from the supplied function
Arguments:
function -- a callable that takes two parameters: path, test and
returns whether the test should be included in the test
run or not.
"""
self.filters.append(function)
@contextlib.contextmanager
def group_manager(self, test_class, group, prefix=None, **default_args):
"""A context manager to make working with flat groups simple.
......@@ -388,9 +378,9 @@ class TestProfile(object):
This method creates a copy with references to the original instance
(using copy.copy), except for the test_list attribute, which is copied
using copy.deepcopy, which is necessary to ensure that filter_tests
only affects the right instance. This allows profiles to be
"subclassed" by other profiles, without modifying the original.
using copy.deepcopy, which is necessary to ensure that
prepare_test_list only affects the right instance. This allows profiles
to be "subclassed" by other profiles, without modifying the original.
"""
new = copy.copy(self)
new.test_list = copy.deepcopy(self.test_list)
......
......@@ -4914,4 +4914,4 @@ with profile.group_manager(
g(['arb_compute_variable_group_size-minmax'], 'minmax')
if platform.system() is 'Windows':
profile.filter_tests(lambda p, _: not p.startswith('glx'))
profile.filters.append(lambda p, _: not p.startswith('glx'))
......@@ -28,4 +28,4 @@ def filter_gpu(name, test):
return False
profile.filter_tests(filter_gpu)
profile.filters.append(filter_gpu)
......@@ -11,4 +11,4 @@ __all__ = ['profile']
profile = _profile.copy() # pylint: disable=invalid-name
profile.filter_tests(lambda _, t: isinstance(t, GLSLParserTest))
profile.filters.append(lambda _, t: isinstance(t, GLSLParserTest))
......@@ -14,5 +14,5 @@ __all__ = ['profile']
profile = _profile.copy() # pylint: disable=invalid-name
# Remove all parser tests, as they are compiler test
profile.filter_tests(lambda p, t: not isinstance(t, GLSLParserTest))
profile.filter_tests(lambda n, _: not n.startswith('asmparsertest'))
profile.filters.append(lambda p, t: not isinstance(t, GLSLParserTest))
profile.filters.append(lambda n, _: not n.startswith('asmparsertest'))
......@@ -64,5 +64,5 @@ with profile.group_manager(
g(['arb_shader_image_size-builtin', '--quick'], 'builtin')
# These take too long
profile.filter_tests(lambda n, _: '-explosion' not in n)
profile.filter_tests(FilterVsIn())
profile.filters.append(lambda n, _: '-explosion' not in n)
profile.filters.append(FilterVsIn())
......@@ -11,4 +11,4 @@ __all__ = ['profile']
profile = _profile.copy() # pylint: disable=invalid-name
profile.filter_tests(lambda _, t: isinstance(t, (ShaderTest, MultiShaderTest)))
profile.filters.append(lambda _, t: isinstance(t, (ShaderTest, MultiShaderTest)))
......@@ -39,4 +39,4 @@ def xts_render_filter(path, test):
return 'xlib9' in path
profile.filter_tests(xts_render_filter)
profile.filters.append(xts_render_filter)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment