From a9b1c5db784752c31e90de6f78acf30a3b2b67c6 Mon Sep 17 00:00:00 2001 From: Anna Kogan Date: Mon, 25 Feb 2013 19:03:26 +0400 Subject: [PATCH] Added --regressions-only=X-FACTOR option --- modules/ts/misc/summary.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/ts/misc/summary.py b/modules/ts/misc/summary.py index 76c1984..25e02b1 100755 --- a/modules/ts/misc/summary.py +++ b/modules/ts/misc/summary.py @@ -41,6 +41,7 @@ if __name__ == "__main__": parser.add_option("", "--show-all", action="store_true", dest="showall", default=False, help="also include empty and \"notrun\" lines") parser.add_option("", "--match", dest="match", default=None) parser.add_option("", "--match-replace", dest="match_replace", default="") + parser.add_option("", "--regressions-only", dest="regressionsOnly", default=None, metavar="X-FACTOR", help="show only tests with performance regressions not") (options, args) = parser.parse_args() options.generateHtml = detectHtmlOutputType(options.format) @@ -195,6 +196,18 @@ if __name__ == "__main__": if not needNewRow: tbl.trimLastRow() + if options.regressionsOnly: + for r in reversed(range(len(tbl.rows))): + delete = True + i = 1 + for set in metric_sets: + val = tbl.rows[r].cells[len(tbl.rows[r].cells)-i].value + if val is not None and val < float(options.regressionsOnly): + delete = False + i += 1 + if (delete): + tbl.rows.pop(r) + # output table if options.generateHtml: if options.format == "moinwiki": @@ -205,3 +218,6 @@ if __name__ == "__main__": htmlPrintFooter(sys.stdout) else: tbl.consolePrintTable(sys.stdout) + + if options.regressionsOnly: + sys.exit(len(tbl.rows)) -- 2.7.4