Skip to content

Commit

Permalink
Merge pull request #544 from AnnaKogan8:added-regressions-only-option
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kamaev authored and OpenCV Buildbot committed Feb 27, 2013
2 parents 5b7a4cd + a9b1c5d commit a5d2253
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions modules/ts/misc/summary.py
Expand Up @@ -42,6 +42,7 @@ def getSetName(tset, idx, columns, short = True):
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)
Expand Down Expand Up @@ -212,6 +213,18 @@ def getSetName(tset, idx, columns, short = True):
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":
Expand All @@ -222,3 +235,6 @@ def getSetName(tset, idx, columns, short = True):
htmlPrintFooter(sys.stdout)
else:
tbl.consolePrintTable(sys.stdout)

if options.regressionsOnly:
sys.exit(len(tbl.rows))

0 comments on commit a5d2253

Please sign in to comment.