summaryrefslogtreecommitdiff
path: root/piglit-summary-html.py
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2012-02-23 11:20:49 -0800
committerKenneth Graunke <kenneth@whitecape.org>2013-05-08 11:35:04 -0700
commit38c7621b02e77a4e5470b34b58d4b92b035e5951 (patch)
tree8abed18ca15417a7159844d1986ecf4b4093059b /piglit-summary-html.py
parentba885e6efb359963820d9ee21ac05796cd873120 (diff)
html: Use CSS3 for zebra-striping the tables.
Most browsers support the :nth-child selector by now, which allows us to zebra-stripe the tables in CSS rather than making the python code annotate every row with an 'a' or 'b' class. While we're at it, stripe the pass/fail/crash results too. Based on some CSS fragments, this was the intent all along, but didn't work. This also changes the striping slightly: it now stripes purely based on whether the row is even/odd, rather than striping on a per-group basis. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com>
Diffstat (limited to 'piglit-summary-html.py')
-rwxr-xr-xpiglit-summary-html.py17
1 files changed, 2 insertions, 15 deletions
diff --git a/piglit-summary-html.py b/piglit-summary-html.py
index 1f5592839..263a4f0cf 100755
--- a/piglit-summary-html.py
+++ b/piglit-summary-html.py
@@ -110,15 +110,9 @@ def buildDetails(testResult):
details.sort(lambda a, b: len(a[1])-len(b[1]))
text = ''
- alternate = 'a'
for name, value in details:
text += ResultDetail % locals()
- if alternate == 'a':
- alternate = 'b'
- else:
- alternate = 'a'
-
return text
@@ -156,11 +150,10 @@ def hrefFromParts(codename, path):
outStr = outStr[1:]
return outStr
-def buildTestSummary(indent, alternate, testsummary):
+def buildTestSummary(indent, testsummary):
path = testsummary.path
name = testsummary.name
testruns = "".join([IndexTestTestrun % {
- 'alternate': alternate,
'status': result.status,
'link': hrefFromParts(result.testrun.codename, path)
} for result in testsummary.results])
@@ -193,7 +186,6 @@ def buildGroupSummaryTestrun(groupresult):
def buildGroupSummary(indent, groupsummary, showcurrent):
indent_inc = 1.75 # em
items = ''
- alternate = 'a'
path = groupsummary.path
name = groupsummary.name
names = groupsummary.children.keys()
@@ -217,12 +209,7 @@ def buildGroupSummary(indent, groupsummary, showcurrent):
'group': buildGroupSummary(indent + indent_inc, child, showcurrent)
}
else:
- items = items + buildTestSummary(indent + indent_inc, alternate, child)
-
- if alternate == 'a':
- alternate = 'b'
- else:
- alternate = 'a'
+ items = items + buildTestSummary(indent + indent_inc, child)
testruns = "".join([buildGroupSummaryTestrun(result)
for result in groupsummary.results])