[Piglit] [RESEND Patch V2 16/16] framework/core.py: Remove dead code

Dylan Baker baker.dylan.c at gmail.com
Thu Jan 23 09:08:11 PST 2014


This removes a couple of dead functions and classes

v2: - remove more dead code

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/core.py | 62 +------------------------------------------------------
 1 file changed, 1 insertion(+), 61 deletions(-)

diff --git a/framework/core.py b/framework/core.py
index f7f0cf4..a193a2d 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -50,7 +50,6 @@ __all__ = ['PIGLIT_CONFIG',
            'checkDir',
            'loadTestProfile',
            'TestrunResult',
-           'GroupResult',
            'TestResult',
            'TestProfile',
            'Group',
@@ -249,51 +248,6 @@ class TestResult(dict):
             pass
 
 
-class GroupResult(dict):
-    def get_subgroup(self, path, create=True):
-        '''
-        Retrieve subgroup specified by path
-
-        For example, ``self.get_subgroup('a/b/c')`` will attempt to
-        return ``self['a']['b']['c']``. If any subgroup along ``path``
-        does not exist, then it will be created if ``create`` is true;
-        otherwise, ``None`` is returned.
-        '''
-        group = self
-        for subname in path.split('/'):
-            if subname not in group:
-                if create:
-                    group[subname] = GroupResult()
-                else:
-                    return None
-            group = group[subname]
-            assert(isinstance(group, GroupResult))
-        return group
-
-    @staticmethod
-    def make_tree(tests):
-        '''
-        Convert a flat dict of test results to a hierarchical tree
-
-        ``tests`` is a dict whose items have form ``(path, TestResult)``,
-        where path is a string with form ``group1/group2/.../test_name``.
-
-        Return a tree whose leaves are the values of ``tests`` and
-        whose nodes, which have type ``GroupResult``, reflect the
-        paths in ``tests``.
-        '''
-        root = GroupResult()
-
-        for (path, result) in tests.items():
-            group_path = os.path.dirname(path)
-            test_name = os.path.basename(path)
-
-            group = root.get_subgroup(group_path)
-            group[test_name] = TestResult(result)
-
-        return root
-
-
 class TestrunResult:
     def __init__(self, resultfile=None):
         self.serialized_keys = ['options',
@@ -615,20 +569,6 @@ class TestProfile:
         multi.join()
         single.join()
 
-    def remove_test(self, test_path):
-        """Remove a fully qualified test from the profile.
-
-        ``test_path`` is a string with slash ('/') separated
-        components. It has no leading slash. For example::
-                test_path = 'spec/glsl-1.30/linker/do-stuff'
-        """
-
-        l = test_path.split('/')
-        group = self.tests[l[0]]
-        for group_name in l[1:-2]:
-            group = group[group_name]
-        del group[l[-1]]
-
     def filter_tests(self, function):
         """Filter out tests that return false from the supplied function
 
@@ -729,4 +669,4 @@ def parse_listfile(filename):
         ['/home/user/tests1', '/home/users/tests2/main', '/tmp/test3']
     """
     with open(filename, 'r') as file:
-        return [path.expanduser(i.rstrip('\n')) for i in file.readlines()]
+        return [os.path.expanduser(i.rstrip('\n')) for i in file.readlines()]
-- 
1.8.5.3



More information about the Piglit mailing list