X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/9bcefa0e5fa0e0bc776aa07dbe37853dbc6f0ba8..bb9ef76d74d6c1e6d1c5b156c660003a2811a182:/tests/genhtml.py
diff --git a/tests/genhtml.py b/tests/genhtml.py
index f6f55c5..9367a1e 100755
--- a/tests/genhtml.py
+++ b/tests/genhtml.py
@@ -3,6 +3,7 @@
import os;
import dircache;
import sys;
+import urllib
os.chdir(sys.argv[1])
@@ -11,46 +12,62 @@ class Axis:
self.type = atype
self.values = dircache.listdir('by-%s'%atype)
- def __str__(self):
- if self.type == "kern": return "kernel"
- elif self.type == "clck": return "CPU clock"
- elif self.type == "test": return "test"
- else: raise Exception, "Unknown type"
-
def __iter__(self):
return iter(self.values)
def __getitem__(self, key):
return self.values[key]
- def getLabel(self, v):
- if self.type == "clck": return v+" MHz"
- elif self.type == "test": return "%s"%(v, v)
- else: return v
-
-
def labels(self):
for v in self.values:
yield self.getLabel(v)
+
+class AxisKern(Axis):
+ def __init__(self):
+ Axis.__init__(self, 'kern')
+ def getLabel(self, v):
+ i=v.find(":")
+ if i>0: kver=v[:i]
+ else: kver=v
+ return v+"
config"%(urllib.quote(kver))
+ def versions(self):
+ for v in self.values:
+ i=v.find(":")
+ if i>0: kver=v[:i]
+ else: kver=v
+ yield kver
-kernels = Axis('kern')
-clocks = Axis('clck')
-tests = Axis('test')
+
+
+class AxisClck(Axis):
+ def __init__(self):
+ Axis.__init__(self, 'clck')
+ def getLabel(self, v):
+ return v+" MHz"
+
+class AxisTest(Axis):
+ def __init__(self):
+ Axis.__init__(self, 'test')
+ def getLabel(self, v):
+ return v+"
source"%(urllib.quote(v))
+
+kernels = AxisKern()
+clocks = AxisClck()
+tests = AxisTest()
class PageSet:
- def __init__(self, values, x, y):
+ def __init__(self, pageclass, values, x, y):
+ self.pageclass = pageclass
self.values = values
self.x = x
self.y = y
def getPages(self):
for v in self.values:
- yield Page(self.values.type, str(self.values), v, self.x, self.y)
+ yield self.pageclass(v, self.x, self.y)
class Page:
- def __init__(self, prefix, name, value, xvals, yvals):
- self.prefix = prefix
- self.name = name
+ def __init__(self, value, xvals, yvals):
self.value = value
self.xvals = xvals
self.yvals = yvals
@@ -63,22 +80,26 @@ class Page: