summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2012-11-30 00:52:59 -0800
committerKenneth Graunke <kenneth@whitecape.org>2012-11-30 00:52:59 -0800
commit573f8bc8f56a5c89e13bfc5b8a5e0630bb3b0576 (patch)
treeafed528c6a07c90ffce7f7fcee1d9efcd1602e4a
parent0ff2ec602863b13b05a693dbf17bc1d53d2ebba7 (diff)
add problems/changes pages.
-rwxr-xr-xprograms/report.py28
1 files changed, 25 insertions, 3 deletions
diff --git a/programs/report.py b/programs/report.py
index 9c8c5f9..c48813c 100755
--- a/programs/report.py
+++ b/programs/report.py
@@ -179,7 +179,7 @@ def buildTable(run_names, results):
return (stack[0].name_html, stack[0].column_html)
-def writeSummaryHtml(run_names, results, reportDir):
+def writeSummaryHtml(run_names, results, filename):
names, columns = buildTable(run_names, results)
def makeColumn(name, contents):
@@ -187,7 +187,7 @@ def writeSummaryHtml(run_names, results, reportDir):
column_html = ''.join([makeColumn(name, contents) for name, contents in zip(run_names, columns)])
group = '<div class="nameColumn"><a class="title" href="%s/index.html">%(name)s</a>' + names + '</div>'
- writefile(path.join(reportDir, 'index.html'), templates['index'] % {
+ writefile(filename, templates['index'] % {
'page': 'Your face',
'showlinks': 'Navbar',
'group': group,
@@ -195,6 +195,18 @@ def writeSummaryHtml(run_names, results, reportDir):
})
#############################################################################
+##### Test filtering predicates
+#####
+##### These take a list of statuses (i.e. ['pass', 'fail'].
+#############################################################################
+
+def broken(rs):
+ return not all(r == 'pass' or r == 'skip' or r is None for r in rs)
+
+def changed(rs):
+ return any(rs[0] != r for r in rs)
+
+#############################################################################
##### Main program
#############################################################################
@@ -245,11 +257,21 @@ def main(argv, config):
results = getCombinedResults(db, run_names, args.intersect)
# XXX: write detail pages
+ def writeSummaryPage(page, filterFunc = None):
+ cut_results = {}
+ for t in results.keys():
+ if filterFunc is None or filterFunc(results[t]):
+ cut_results[t] = results[t]
+ writeSummaryHtml(run_names, cut_results, path.join(reportDir, page + '.html'))
os.link(path.join(templateDir, 'index.css'),
path.join(reportDir, 'index.css'))
- writeSummaryHtml(run_names, results, reportDir)
+ writeSummaryPage('index')
+ writeSummaryPage('problems', broken)
+ writeSummaryPage('changes', changed)
+ #writeSummaryPage('regressions', regressed)
+ #writeSummaryPage('fixes', fixed)
if __name__ == "__main__":
main()