[Piglit] [PATCH 1/4] framework/summary.py: fix console output with no options

Dylan Baker baker.dylan.c at gmail.com
Mon May 11 14:57:27 PDT 2015


Currently piglit/summary console <result> hits an assert, this fixes
that.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/programs/summary.py |  2 +-
 framework/summary.py          | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/framework/programs/summary.py b/framework/programs/summary.py
index 67dd8cc..2d51acb 100644
--- a/framework/programs/summary.py
+++ b/framework/programs/summary.py
@@ -146,7 +146,7 @@ def console(input_):
 
     # Generate the output
     output = summary.Summary(args.results)
-    output.generate_text(args.mode)
+    output.generate_text(args.mode or 'all')
 
 
 def csv(input_):
diff --git a/framework/summary.py b/framework/summary.py
index 66f100a..5d6436c 100644
--- a/framework/summary.py
+++ b/framework/summary.py
@@ -560,24 +560,24 @@ class Summary:
 
     def generate_text(self, mode):
         """ Write summary information to the console """
-        assert mode in ['summary', 'diff', 'incomplete']
+        assert mode in ['summary', 'diff', 'incomplete', 'all'], mode
         self.__find_totals(self.results[-1])
 
         # Print the name of the test and the status from each test run
-        if mode == 'diff':
-            for test in self.tests['changes']:
+        if mode == 'all':
+            for test in self.tests['all']:
                 print("{test}: {statuses}".format(
                     test=test,
                     statuses=' '.join(str(i.tests.get(test, {'result': so.SKIP})
                                           ['result']) for i in self.results)))
-        elif mode == 'incomplete':
-            for test in self.tests['incomplete']:
+        elif mode == 'diff':
+            for test in self.tests['changes']:
                 print("{test}: {statuses}".format(
                     test=test,
                     statuses=' '.join(str(i.tests.get(test, {'result': so.SKIP})
                                           ['result']) for i in self.results)))
-        elif mode != 'summary':
-            for test in self.tests['all']:
+        elif mode == 'incomplete':
+            for test in self.tests['incomplete']:
                 print("{test}: {statuses}".format(
                     test=test,
                     statuses=' '.join(str(i.tests.get(test, {'result': so.SKIP})
-- 
2.4.0



More information about the Piglit mailing list