Commit 865fffd1 authored by Abhishek Arya's avatar Abhishek Arya Committed by Commit Bot

Improve styles in code coverage report.

R=mmoroz@chromium.org,liaoyuke@chromium.org

Change-Id: Ief1e5de05febdf6c6ffd1d9fefb99c5b953b87b2
Reviewed-on: https://chromium-review.googlesource.com/1050747
Commit-Queue: Abhishek Arya <inferno@chromium.org>
Reviewed-by: default avatarMax Moroz <mmoroz@chromium.org>
Reviewed-by: default avatarYuke Liao <liaoyuke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556982}
parent df6f4f4d
......@@ -213,6 +213,8 @@ class _CoverageReportHtmlGenerator(object):
self._header_template = jinja_env.get_template('header.html')
self._table_template = jinja_env.get_template('table.html')
self._footer_template = jinja_env.get_template('footer.html')
self._style_overrides = open(
os.path.join(template_dir, 'style_overrides.css')).read()
def AddLinkToAnotherReport(self, html_report_path, name, summary):
"""Adds a link to another html report in this report.
......@@ -312,7 +314,8 @@ class _CoverageReportHtmlGenerator(object):
component_view_href=_GetRelativePathToDirectoryOfFile(
component_view_path, self._output_path),
file_view_href=_GetRelativePathToDirectoryOfFile(
file_view_path, self._output_path))
file_view_path, self._output_path),
style_overrides=self._style_overrides)
html_table = self._table_template.render(
entries=self._table_entries,
......
......@@ -4,13 +4,14 @@
<meta name='viewport' content='width=device-width,initial-scale=1'>
<meta charset='UTF-8'>
<link rel='stylesheet' type='text/css' href='{{ css_path }}'>
<!-- Custom style overrides -->
<style>
{{ style_overrides }}
</style>
</head>
<body>
<h2>Coverage Report</h2>
<p>
Click <a href='http://clang.llvm.org/docs/SourceBasedCodeCoverage.html#interpreting-reports'>here</a> for information about interpreting this report.
</p>
<p>
View results by: <a href='{{ directory_view_href }}'>Directories</a> | <a href='{{ component_view_href }}'>Components</a> | <a href='{{ file_view_href }}'>Files</a>
View results by: <a href='{{ component_view_href }}'>Components</a> | <a href='{{ directory_view_href }}'>Directories</a> | <a href='{{ file_view_href }}'>Files</a>
</p>
<div class='centered'>
\ No newline at end of file
/* Copyright 2018 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
th, td {
padding: 5px 16px;
}
tbody td {
font-size: 14px;
}
thead th, tfoot td {
background-color: #f5f5f5;
border-left: 1px solid #e4e4e4;
border-right: 1px solid #e4e4e4;
color: #484848;
font-size: 16px;
text-transform: uppercase;
}
tbody tr:hover td, tfoot tr:hover td {
background-color: #f5f5f5;
border-color: #e4e4e4 !important;
}
\ No newline at end of file
<table>
<thead>
<tr>
<td class="column-entry-bold">{{ table_entry_type }}</td>
<td class="column-entry-bold">Line Coverage</td>
<td class="column-entry-bold">Function Coverage</td>
<td class="column-entry-bold">Region Coverage</td>
<th class="column-entry-bold">{{ table_entry_type }}</th>
<th class="column-entry-bold" title=
"Line coverage is the percentage of code lines which have been executed at least once. Only executable lines within function bodies are considered to be code lines.">
Line Coverage</th>
<th class="column-entry-bold" title=
"Function coverage is the percentage of functions which have been executed at least once. A function is considered to be executed if any of its instantiations are executed.">
Function Coverage</th>
<th class="column-entry-bold" title=
"Region coverage is the percentage of code regions which have been executed at least once. A code region may span multiple lines (e.g in a large function body with no control flow). However, it's also possible for a single line to contain multiple code regions (e.g in 'return x || y &amp;&amp; z').">
Region Coverage</th>
</tr>
</thead>
<tbody>
{% for entry in entries %}
<tr class="light-row">
<td>
......@@ -21,6 +30,8 @@
{% endfor %}
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr class="light-row-bold">
<td>
<pre>Totals</pre>
......@@ -31,4 +42,5 @@
</td>
{% endfor %}
</tr>
</tfoot>
</table>
\ No newline at end of file
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