summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2012-12-17 01:41:08 -0800
committerKenneth Graunke <kenneth@whitecape.org>2012-12-17 01:41:42 -0800
commitab3aae99f261febf04c6702f101cbd48c9b6f0d5 (patch)
tree9d29f618a5fbc5a63dae7137736d2780784f62dc
parent82000d37194315a0a28961db834f431bb1a5814d (diff)
drop the summary batching (hard and annoying); work up some new css
-rwxr-xr-xprograms/report.py40
-rw-r--r--programs/templates/detail.css32
-rw-r--r--programs/templates/index.css12
3 files changed, 48 insertions, 36 deletions
diff --git a/programs/report.py b/programs/report.py
index 801c179..6ff97b3 100755
--- a/programs/report.py
+++ b/programs/report.py
@@ -41,7 +41,6 @@ def writefile(filename, text):
templateDir = path.join(path.dirname(path.realpath(__file__)), 'templates')
templates = {
'index': readfile(path.join(templateDir, 'index.html')),
- 'result_test': readfile(path.join(templateDir, 'result_test.html')),
'result_detail': readfile(path.join(templateDir, 'result_detail.html')),
}
@@ -137,11 +136,11 @@ def build_navbox(current_page):
return ''.join([link(p[0], p[1]) for p in pages])
-def testResult(run_name, full_name, status, detail_filename):
+def testResult(run_name, full_name, status):
if interesting(status):
html = '<a class="%(status)s" href="%(link)s">%(status)s</a>' % {
'status': status if status else 'skip',
- 'link': path.join(escape(run_name), detail_filename) + '#' + escape(full_name)
+ 'link': path.join(escape(run_name), detailFile(full_name))
}
else:
html = '<span class="%(status)s">%(status)s</span>' % {
@@ -176,7 +175,7 @@ def buildGroupResultHeader(p):
return '<div class="head %(status)s">%(pass)d/%(total)d</div>' % {
'status': status, 'total': p.totalRun(), 'pass': p.passnr }
-def buildTable(run_names, results, detailFilenames):
+def buildTable(run_names, results):
# If the test list is empty, just return now.
if not results:
return ('', [''])
@@ -219,7 +218,7 @@ def buildTable(run_names, results, detailFilenames):
stack[-1].name_html += '<div>' + test + '</div>\n';
for i in range(num_runs):
passv = toPassVector(results[full_test][i]['result'])
- html = testResult(run_names[i], full_test, results[full_test][i]['result'], detailFilenames[full_test])
+ html = testResult(run_names[i], full_test, results[full_test][i]['result'])
stack[-1].results[i].add(passv)
stack[-1].column_html[i] += html
@@ -231,8 +230,8 @@ def buildTable(run_names, results, detailFilenames):
return (stack[0].name_html, stack[0].column_html)
-def writeSummaryHtml(run_names, results, resultsDir, page, filename, detailFilenames):
- names, columns = buildTable(run_names, results, detailFilenames)
+def writeSummaryHtml(run_names, results, resultsDir, page, filename):
+ names, columns = buildTable(run_names, results)
def makeColumn(name, contents):
return ''.join(['<div class="resultColumn"><a class="title" href="%s/index.html">%s</a>' % (escape(name), name), contents, '</div>'])
@@ -251,25 +250,20 @@ def writeSummaryHtml(run_names, results, resultsDir, page, filename, detailFilen
##### Detail page generation
#############################################################################
+def detailFile(test):
+ return 'detail_' + escape(test) + '.html'
+
def interesting(r):
return r and r != 'skip'
# Create result<N>.html pages containing the test result details for a
# single testrun.
-def writeDetailPages(dirname, run_name, results, filenames, col):
- pages = {}
+def writeDetailPages(dirname, run_name, results, col):
for test in results.keys():
r = results[test][col]
if r and interesting(r['result']):
- p = filenames[test]
- if p not in pages:
- pages[p] = []
-
- pages[p].append(templates['result_test'] % dict(r, esc_test=escape(test), test=test, run=run_name))
-
- for p in pages.keys():
- writefile(path.join(dirname, p),
- templates['result_detail'] % {'run': run_name, 'details': ''.join(pages[p])})
+ writefile(path.join(dirname, detailFile(test)),
+ templates['result_detail'] % dict(r, run=run_name, esc_test=escape(test), test=test))
#############################################################################
##### Main program
@@ -321,25 +315,23 @@ def main(argv, config):
results = getCombinedResults(db, run_names, args.intersect)
- detailFilenames = {}
- for i, test in enumerate(results.keys()):
- detailFilenames[test] = 'result%d.html' % (i % 100)
-
for col in range(len(run_names)):
dirname = path.join(reportDir, escape(run_names[col]))
os.mkdir(dirname)
# XXX: write system info
- writeDetailPages(dirname, run_names[col], results, detailFilenames, col)
+ writeDetailPages(dirname, run_names[col], results, col)
def writeSummaryPage(page, filename, filterFunc = None):
cut_results = {}
for t in results.keys():
if filterFunc is None or filterFunc([r['result'] for r in results[t]]):
cut_results[t] = results[t]
- writeSummaryHtml(run_names, cut_results, reportDir, page, filename, detailFilenames)
+ writeSummaryHtml(run_names, cut_results, reportDir, page, filename)
os.link(path.join(templateDir, 'index.css'),
path.join(reportDir, 'index.css'))
+ os.link(path.join(templateDir, 'detail.css'),
+ path.join(reportDir, 'detail.css'))
for p in pages:
writeSummaryPage(p[0], p[1], p[2])
diff --git a/programs/templates/detail.css b/programs/templates/detail.css
new file mode 100644
index 0000000..12b656b
--- /dev/null
+++ b/programs/templates/detail.css
@@ -0,0 +1,32 @@
+body {
+ margin: 0;
+ padding: 0;
+ background-color: #ffffc5;
+}
+
+
+h1, h2, h3 {
+ padding-left: 18pt;
+ padding-top: 0.3em;
+ padding-bottom: 0.3em;
+ margin: 0;
+}
+
+pre {
+ padding-left: 18pt;
+ margin: 0;
+}
+
+h3 {
+ margin-top: 1em;
+}
+
+h1 {
+ background-color: #ffff95;
+}
+
+.pass { background-color: #20ff20; }
+.skip { background-color: #b0b0b0; }
+.timeout { background-color: #ff9020; }
+.fail { background-color: #ff2020; }
+.crash { background-color: #111111; }
diff --git a/programs/templates/index.css b/programs/templates/index.css
index f989f80..fd754a7 100644
--- a/programs/templates/index.css
+++ b/programs/templates/index.css
@@ -144,15 +144,3 @@ div.group .fail:nth-child(even) { background-color: #e00505; }
div.group .crash:nth-child(odd) { background-color: #111111; }
div.group .crash:nth-child(even) { background-color: #000000; }
-
-/**
- * Detail pages:
- */
-
-div.result {
- display: none;
-}
-
-h1.pass {
- background-color: #20ff20;
-}