[Piglit] [PATCH 2/2] framework: add -r/--regressions option to `piglit summary console`

Nicolai Hähnle nhaehnle at gmail.com
Mon Oct 24 14:02:35 UTC 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

---
 framework/programs/summary.py | 5 +++++
 framework/summary/console_.py | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/framework/programs/summary.py b/framework/programs/summary.py
index e400d9a..037bb56 100644
--- a/framework/programs/summary.py
+++ b/framework/programs/summary.py
@@ -138,20 +138,25 @@ def console(input_):
                            action="store_const",
                            const="summary",
                            dest='mode',
                            help="Only display the summary, not the individual "
                                 "test results")
     excGroup1.add_argument("-i", "--incomplete",
                            action="store_const",
                            const="incomplete",
                            dest='mode',
                            help="Only display tests that are incomplete.")
+    excGroup1.add_argument("-r", "--regressions",
+			   action="store_const",
+			   const="regressions",
+			   dest='mode',
+			   help="One display tests that regressed.")
     parser.add_argument("-l", "--list",
                         action="store",
                         help="Use test results from a list file")
     parser.add_argument("results",
                         metavar="<Results Path(s)>",
                         nargs="+",
                         help="Space separated paths to at least one results "
                              "file")
     args = parser.parse_args(unparsed)
 
diff --git a/framework/summary/console_.py b/framework/summary/console_.py
index e17a1d8..baeb6e3 100644
--- a/framework/summary/console_.py
+++ b/framework/summary/console_.py
@@ -92,24 +92,26 @@ def _print_summary(results):
 def _print_result(results, list_):
     """Takes a list of test names to print and prints the name and result."""
     for test in sorted(list_):
         print("{test}: {statuses}".format(
             test=grouptools.format(test),
             statuses=' '.join(str(r) for r in results.get_result(test))))
 
 
 def console(results, mode):
     """ Write summary information to the console """
-    assert mode in ['summary', 'diff', 'incomplete', 'all'], mode
+    assert mode in ['summary', 'diff', 'incomplete', 'regressions', 'all'], mode
     results = Results([backends.load(r) for r in results])
 
     # Print the name of the test and the status from each test run
     if mode == 'all':
         _print_result(results, results.names.all)
         _print_summary(results)
     elif mode == 'diff':
         _print_result(results, results.names.all_changes)
         _print_summary(results)
     elif mode == 'incomplete':
         _print_result(results, results.names.all_incomplete)
+    elif mode == 'regressions':
+        _print_result(results, results.names.all_regressions)
     elif mode == 'summary':
         _print_summary(results)
-- 
2.7.4



More information about the Piglit mailing list