Add new dimension (traffic) to html generator
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 3 Dec 2010 23:36:43 +0000 (00:36 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 3 Dec 2010 23:36:43 +0000 (00:36 +0100)
gw-tests/genhtml/genhtml.py

index 08a6dac..4c16a95 100755 (executable)
@@ -56,6 +56,12 @@ class DimensionTest(Dimension):
     def htmlLabel(self, v):
        return v+"<br><a href='%s.sh.html'>source</a>"%(urllib.quote(v))
 
+class DimensionTraffic(Dimension):
+    def __init__(self):
+       Dimension.__init__(self, 'traf', 'Traffic')
+    def htmlLabel(self, v):
+       return v
+
 class Test:
     @classmethod
     def isOnPath(cls, path):
@@ -103,7 +109,7 @@ class Tests(dict):
 
     def addTest(self, test, coordinates):
        if len(coordinates) != len(self.dimensions):
-           raise KeyError("The number coordinates do not match the number of dimensions")
+           raise KeyError("The number coordinates do not match the number of dimensions: " + str(coordinates))
        self[tuple(coordinates)] = test
        for i in xrange(len(coordinates)):
            self.dimensions[i].addValue(coordinates[i])
@@ -196,6 +202,6 @@ th, td { border: 1px solid lightgray; padding: 4px;}
 
 if __name__ == "__main__":
     os.chdir(sys.argv[1])
-    tests = Tests("by-kern/", DimensionKern(), DimensionTest())
+    tests = Tests("./", DimensionKern(), DimensionTraffic(), DimensionTest())
     tests.generateHtml()
     sys.exit(0)