Commit c8239501 authored by Dylan Baker's avatar Dylan Baker

summary.py: Do not generate comparison pages for single results

It is absolutely silly to generate pages for fixes, changes, and
regressions when there is only one test result is provided. This still
generates empty pages when two results are provided, because some
developers have expressed a work flow that uses these empty pages.
Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dylan Baker's avatarDylan Baker <baker.dylan.c@gmail.com>
parent f94f84b5
......@@ -757,7 +757,12 @@ class NewSummary:
module_directory=".makotmp")
# A list of pages to be generated
pages = ['changes', 'problems', 'skipped', 'fixes', 'regressions']
# If there is only one set of results, then there cannot be changes,
# regressions or fixes, so don't generate those pages
if len(self.results) > 1:
pages = ['changes', 'problems', 'skipped', 'fixes', 'regressions']
else:
pages = ['problems', 'skipped']
# Index.html is a bit of a special case since there is index, all, and
# alltests, where the other pages all use the same name. ie,
......@@ -765,6 +770,7 @@ class NewSummary:
file = open(path.join(destination, "index.html"), 'w')
file.write(index.render(results=HTMLIndex(self, self.tests['all']),
page='all',
pages=pages,
colnum=len(self.results),
exclude=exclude))
file.close()
......@@ -774,6 +780,7 @@ class NewSummary:
file = open(path.join(destination, page + '.html'), 'w')
file.write(index.render(results=HTMLIndex(self, self.tests[page]),
page=page,
pages=pages,
colnum=len(self.results),
exclude=exclude))
file.close()
......@@ -16,7 +16,7 @@
% else:
<a href="index.html">all</a>
% endif
% for i in ['changes', 'fixes', 'problems', 'regressions', 'skipped']:
% for i in pages:
% if i == page:
| ${i}
% else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment