[Piglit] [PATCH 6/7] summary: Remove optimization with no impact

Dylan Baker baker.dylan.c at gmail.com
Fri Sep 27 14:39:20 PDT 2013


Generating these lists is rather trivial, so just generate them all the
time.

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

diff --git a/framework/summary.py b/framework/summary.py
index bab545d..1a899e7 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -377,7 +377,7 @@ class Summary:
             # Create a list with all the test names in it
             self.tests['all'] = set(self.tests['all']) | set(each.tests)
 
-    def __generate_lists(self, lists):
+    def __generate_lists(self):
         """
         Private: Generate the lists of changes, problems, regressions, fixes,
         and skips
@@ -399,31 +399,28 @@ class Summary:
                 except KeyError:
                     status.append(so.NotRun())
 
-            if 'problems' in lists:
-                # If that staus falls between Skip (The worst status) and
-                # Pass (the best status) it's a problem
-                if so.Skip() > max(status) > so.Pass():
-                    self.tests['problems'].add(test)
-
-            if 'skipped' in lists:
-                # Find all tests with a status of skip
-                if so.Skip() in status:
-                    self.tests['skipped'].add(test)
-
-            if 'fixes' in lists:
-                # find fixes, regressions, and changes
-                for i in xrange(len(status) - 1):
-                    first = status[i]
-                    last = status[i + 1]
-                    if first < last and so.NotRun() not in (first, last):
-                        self.tests['regressions'].add(test)
-                    if first > last and so.NotRun() not in (first, last):
-                        self.tests['fixes'].add(test)
-                    # Changes cannot be added in the fixes and regressions
-                    # passes becasue NotRun is a change, but not a regression
-                    # or fix
-                    if first != last:
-                        self.tests['changes'].add(test)
+            # If that staus falls between Skip (The worst status) and
+            # Pass (the best status) it's a problem
+            if so.Skip() > max(status) > so.Pass():
+                self.tests['problems'].add(test)
+
+            # Find all tests with a status of skip
+            if so.Skip() in status:
+                self.tests['skipped'].add(test)
+
+            # find fixes, regressions, and changes
+            for i in xrange(len(status) - 1):
+                first = status[i]
+                last = status[i + 1]
+                if first < last and so.NotRun() not in (first, last):
+                    self.tests['regressions'].add(test)
+                if first > last and so.NotRun() not in (first, last):
+                    self.tests['fixes'].add(test)
+                # Changes cannot be added in the fixes and regressions
+                # passes becasue NotRun is a change, but not a regression
+                # or fix
+                if first != last:
+                    self.tests['changes'].add(test)
 
     def __find_totals(self):
         """
@@ -512,15 +509,7 @@ class Summary:
                                 output_encoding="utf-8",
                                 module_directory=".makotmp")
 
-        # A list of pages to be generated
-        # If there is only one set of results, then there cannot be changes,
-        # regressions or fixes, so don't generate those pages.
-        if len(self.results) > 1:
-            pages = ['changes', 'problems', 'skipped', 'fixes', 'regressions']
-        else:
-            pages = ['problems', 'skipped']
-
-        self.__generate_lists(pages)
+        self.__generate_lists()
 
         # Index.html is a bit of a special case since there is index, all, and
         # alltests, where the other pages all use the same name. ie,
@@ -555,7 +544,7 @@ class Summary:
 
         # If there are more than one set of results we need to find changes
         if len(self.results) > 1:
-            self.__generate_lists(['changes', 'fixes', 'regressions'])
+            self.__generate_lists()
 
         # Print the name of the test and the status from each test run
         if not summary:
-- 
1.8.1.5



More information about the Piglit mailing list