Improved sorting in performance reports
This commit is contained in:
parent
40d82c0720
commit
7fb5b5f218
@ -32,6 +32,9 @@ def keyselector(a):
|
||||
return ((channels-1) & 511) + (depth << 9)
|
||||
return a
|
||||
|
||||
convert = lambda text: int(text) if text.isdigit() else text
|
||||
alphanum_keyselector = lambda key: [ convert(c) for c in re.split('([0-9]+)', keyselector(key)) ]
|
||||
|
||||
def getValueParams(test):
|
||||
param = test.get("value_param")
|
||||
if not param:
|
||||
@ -174,7 +177,7 @@ if __name__ == "__main__":
|
||||
exit(1)
|
||||
|
||||
for i in range(argsnum):
|
||||
arglists[i] = sorted([str(key) for key in arglists[i].iterkeys()], key=keyselector)
|
||||
arglists[i] = sorted([str(key) for key in arglists[i].iterkeys()], key=alphanum_keyselector)
|
||||
|
||||
if options.generateHtml and options.format != "moinwiki":
|
||||
htmlPrintHeader(sys.stdout, "Report %s for %s" % (args[0], sname))
|
||||
@ -229,4 +232,4 @@ if __name__ == "__main__":
|
||||
break
|
||||
|
||||
if options.generateHtml and options.format != "moinwiki":
|
||||
htmlPrintFooter(sys.stdout)
|
||||
htmlPrintFooter(sys.stdout)
|
||||
|
@ -2,6 +2,9 @@ import testlog_parser, sys, os, xml, glob, re
|
||||
from table_formatter import *
|
||||
from optparse import OptionParser
|
||||
|
||||
convert = lambda text: int(text) if text.isdigit() else text
|
||||
alphanum_keyselector = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
|
||||
|
||||
def getSetName(tset, idx, columns, short = True):
|
||||
if columns and len(columns) >= idx:
|
||||
prefix = columns[idx]
|
||||
@ -121,7 +124,7 @@ if __name__ == "__main__":
|
||||
|
||||
# rows
|
||||
needNewRow = True
|
||||
for name in sorted(test_cases.iterkeys()):
|
||||
for name in sorted(test_cases.iterkeys(), key=alphanum_keyselector):
|
||||
cases = test_cases[name]
|
||||
if needNewRow:
|
||||
tbl.newRow()
|
||||
|
Loading…
Reference in New Issue
Block a user