diff options
-rwxr-xr-x | programs/report.py | 55 | ||||
-rw-r--r-- | programs/templates/index.css | 33 | ||||
-rw-r--r-- | programs/templates/index.html | 5 |
3 files changed, 52 insertions, 41 deletions
diff --git a/programs/report.py b/programs/report.py index 9b5ab41..87ef155 100755 --- a/programs/report.py +++ b/programs/report.py @@ -87,16 +87,34 @@ def escape(s): return filename_char_re.sub('', s.replace('/', '__')) ############################################################################# +##### 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) + +############################################################################# ##### Summary page generation ############################################################################# +pages = [ + ('All', 'index.html', None), + ('Changes', 'changes.html', changed), + ('Problems', 'problems.html', broken) +] + def build_navbox(current_page): - def link(to): + def link(to, filename): if to == current_page: - return '<span>%s</span>' % to.title() - return '<a href="%s.html">%s</a>' % (to, to.title()) + return '<span>%s</span>' % to + return '<a href="%s">%s</a>' % (filename, to) - return ''.join([link(p) for p in ['index', 'changes', 'problems']]) + return ''.join([link(p[0], p[1]) for p in pages]) def testResult(run_name, full_name, status): html = '<a class="%(status)s" href="%(link)s">%(status)s</a>' % { @@ -187,7 +205,7 @@ def buildTable(run_names, results): return (stack[0].name_html, stack[0].column_html) -def writeSummaryHtml(run_names, results, resultsDir, page): +def writeSummaryHtml(run_names, results, resultsDir, page, filename): names, columns = buildTable(run_names, results) def makeColumn(name, contents): @@ -195,27 +213,15 @@ def writeSummaryHtml(run_names, results, resultsDir, page): 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>' - filename = path.join(resultsDir, page + '.html') + filename = path.join(resultsDir, filename) writefile(filename, templates['index'] % { - 'page': filename, + 'page': page.title(), 'showlinks': build_navbox(page), 'group': group, 'columns': column_html }) ############################################################################# -##### 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 ############################################################################# @@ -266,21 +272,18 @@ def main(argv, config): results = getCombinedResults(db, run_names, args.intersect) # XXX: write detail pages - def writeSummaryPage(page, filterFunc = None): + def writeSummaryPage(page, filename, 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, reportDir, page) + writeSummaryHtml(run_names, cut_results, reportDir, page, filename) os.link(path.join(templateDir, 'index.css'), path.join(reportDir, 'index.css')) - writeSummaryPage('index') - writeSummaryPage('problems', broken) - writeSummaryPage('changes', changed) - #writeSummaryPage('regressions', regressed) - #writeSummaryPage('fixes', fixed) + for p in pages: + writeSummaryPage(p[0], p[1], p[2]) if __name__ == "__main__": main() diff --git a/programs/templates/index.css b/programs/templates/index.css index a2d9dbf..f0d8e7f 100644 --- a/programs/templates/index.css +++ b/programs/templates/index.css @@ -1,24 +1,30 @@ body { - margin: 0; + margin-left: 0; + margin-right: 0; + margin-top: 1em; +} + +h1 { + margin-left: 1em; + margin-right: 1em; } #navbox { font-weight: bold; text-decoration: none; text-align: center; - background-color: #67a7c3; - color: white; - border-top: 1px solid #5689a0; - border-bottom: 1px solid #5689a0; + border-top: 1px solid #bbbbbb; + border-bottom: 1px solid #bbbbbb; vertical-align: middle; padding-top: 0.2em; padding-bottom: 0.2em; } #navbox * { - color: white; - border-left: 1px solid #67a7c3; - border-right: 1px solid #67a7c3; + border-left: 1px dotted #cccccc; + border-right: 1px dotted #cccccc; + margin-left: 1.0em; + margin-right: 1.0em; padding-left: 0.75em; padding-right: 0.75em; padding-top: 0.2em; @@ -26,10 +32,15 @@ body { text-decoration: none; } +#navbox span { + color: white; + background-color: black; + border-left: 1px solid white; + border-right: 1px solid white; +} + #navbox a:hover { - background-color: #77bede; - border-left: 1px solid #ffffff; - border-right: 1px solid #ffffff; + background-color: #efefef; } div#table { diff --git a/programs/templates/index.html b/programs/templates/index.html index 0c95f08..953799d 100644 --- a/programs/templates/index.html +++ b/programs/templates/index.html @@ -8,10 +8,7 @@ <link rel="stylesheet" href="index.css"/> </head> <body> - <h1>Result summary</h1> - <p> - Currently showing: %(page)s - </p> + <h1>Results / %(page)s</h1> <div id="navbox"> %(showlinks)s </div> |