From 423e36d347a8b2d68d8ae4f26499719d11d1476f Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sun, 12 Dec 2010 13:28:21 +0100 Subject: [PATCH] Show statistics in result pages --- gw-tests/genhtml/genhtml.py | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/gw-tests/genhtml/genhtml.py b/gw-tests/genhtml/genhtml.py index cd4985b..6218004 100755 --- a/gw-tests/genhtml/genhtml.py +++ b/gw-tests/genhtml/genhtml.py @@ -155,6 +155,25 @@ class Test(object): return "
" % \ (pngName[:-4]+".pdf", pngName) + def htmlPrintStats(self, html): + cwd = os.getcwd() + os.chdir(self.path) + stats = glob.glob("*-stat.txt") + print >>html, "

Statistics

" + print >>html, "" + stats.sort() + for i in stats: + lines = open(i).readlines() + def stripComment(l): + comment = l.find("#") + if comment >= 0: + l = l[:comment-1] + return l + lines = [stripComment(l) for l in lines if l.find("cmdline=") != 0] + print >>html, "" % (i, "
".join(lines)) + print >>html, "

%s

%s
" + os.chdir(cwd) + def generateHtml(self): html = open(os.path.join(self.path, 'results.html'), "w") title = "CAN gateway timing analysis" @@ -188,20 +207,20 @@ class Test(object): print >>html, "" print >>html, self.fullImgLink("graph.png") - print >>html, "Raw data
" - print >>html, "Script source
" % (cdup+self.name+".sh.html") - print >>html, "Back to top
" % cdup - + self.htmlPrintStats(html) cwd = os.getcwd() os.chdir(self.path) additionalImgs = glob.glob("graph?*.png") - if additionalImgs: - print "XXX" - print >>html, "

Additional graphs

" + if additionalImgs: print >>html, "

Additional graphs

" for i in additionalImgs: print >>html, self.fullImgLink(i) os.chdir(cwd) + print >>html, "
" + print >>html, "Raw data
" + print >>html, "Script source
" % (cdup+self.name+".sh.html") + print >>html, "Back to top
" % cdup + html.close() class Space(list): -- 2.39.2