summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-10-13 16:33:39 -0700
committerDylan Baker <dylan@pnwbakers.com>2016-11-10 10:51:00 -0800
commita8718f4da77dd8641cf844cc3af3733dcbdf263f (patch)
tree311139b0ec5d479312bc80ff7a6caf2367dce299
parent3ca3557d9d634c00d4435560f63b356b00258c23 (diff)
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: Dylan Baker <dylanx.c.baker@intel.com>
-rw-r--r--framework/profile.py16
-rw-r--r--tests/all.py2
-rw-r--r--tests/cpu.py2
-rw-r--r--tests/glslparser.py2
-rw-r--r--tests/gpu.py4
-rw-r--r--tests/quick.py4
-rw-r--r--tests/shader.py2
-rw-r--r--tests/xts-render.py2
8 files changed, 12 insertions, 22 deletions
diff --git a/framework/profile.py b/framework/profile.py
index e4b8308e1..e016a3689 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -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)
diff --git a/tests/all.py b/tests/all.py
index cc9471e93..a35b76c63 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -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'))
diff --git a/tests/cpu.py b/tests/cpu.py
index 7fc905eaa..65d999062 100644
--- a/tests/cpu.py
+++ b/tests/cpu.py
@@ -28,4 +28,4 @@ def filter_gpu(name, test):
return False
-profile.filter_tests(filter_gpu)
+profile.filters.append(filter_gpu)
diff --git a/tests/glslparser.py b/tests/glslparser.py
index fccc353f1..5d0facbc2 100644
--- a/tests/glslparser.py
+++ b/tests/glslparser.py
@@ -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))
diff --git a/tests/gpu.py b/tests/gpu.py
index c9e3d15a4..fce550c67 100644
--- a/tests/gpu.py
+++ b/tests/gpu.py
@@ -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'))
diff --git a/tests/quick.py b/tests/quick.py
index b3e8bd817..ad879bd26 100644
--- a/tests/quick.py
+++ b/tests/quick.py
@@ -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())
diff --git a/tests/shader.py b/tests/shader.py
index ed5635a22..d283a577c 100644
--- a/tests/shader.py
+++ b/tests/shader.py
@@ -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)))
diff --git a/tests/xts-render.py b/tests/xts-render.py
index 234fb2ff4..d2cd843f2 100644
--- a/tests/xts-render.py
+++ b/tests/xts-render.py
@@ -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)