blob: 0c3288e0666a449e001923a1ae51216912261414 [file] [log] [blame]
<!DOCTYPE html>
<head>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<title>Coverage for {{project}}</title>
<meta charset="utf-8">
<link rel="stylesheet" href="/common.css">
<style>
.coverage-header {
padding: 5px 10px;
border-bottom: 1px solid #DBDBDB;
background-color: #EEE;
line-height: 24px;
text-align: center;
font-weight: bold;
font-size: 18px;
}
.intro-text {
box-sizing: border-box;
width: 100%;
padding: 0.5em 8px;
margin: 0.5em auto;
border: 1px solid #ccc;
background: #f8f8f8;
font-size: 14px;
}
</style>
<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="/ui/elements/cats-app.html">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="/ui/js/coverage.js"></script>
<script>
$(function() {
document.getElementById('app').userInfo = {{ (user_info or {}) | tojson | safe }};
document.getElementById('app').banner = {{ (banner or {}) | tojson | safe }};
});
</script>
</head>
<body>
<cats-app id="app" components="Tools>CodeCoverage" page-header="Code Coverage: summary by revisions (Chrome Browser for {{platform_ui_name}})">
<div>
<div class="intro-text">
<p>These reports give test code coverage for Chromium.</p>
<p>Currently showing the code coverage of C/C++ code on the master branch.</p>
</div>
<form id="platform_select_form" method="get">
Platform:
<select id="platform_select" name="platform" onchange="switchPlatform()">
{% for option in platform_select.options %}
<option value="{{option.value}}" {% if option.selected %}selected="selected" {% endif %}>{{option.ui_name}}</option>
{% endfor %}
<input type="hidden" name="list_reports" value="true"></input>
</select>
</form>
<table>
<thead>
<tr class="coverage-header">
{% if user_info and user_info.is_admin %}
<th colspan="8">{{project}}</th>
{% else %}
<th colspan="7">{{project}}</th>
{% endif %}
</tr>
<tr>
<th title="Commit position used to build targets and generate code coverage report.">Commit Position</th>
<th title="Time when the revision was commited into the source tree.">Commit Time (PST)</th>
<th title="Link to code coverage report for the particular commit position.">Report</th>
<th 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</th>
<th 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</th>
<th 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</th>
<th title="Link to the build that generated this report.">Data Source</th>
{% if user_info and user_info.is_admin %}
<th>Is Visible</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for datum in data %}
{% if user_info and user_info.is_admin or datum.visible %}
<tr>
<td>
<a href="https://crrev.com/{{datum.commit_position}}">{{datum.commit_position}}</a>
</td>
<td>
{{datum.commit_timestamp}}
</td>
<td>
<a href="/p/chromium/coverage/dir?host={{host}}&project={{project}}&ref={{ref}}&revision={{datum.gitiles_commit.revision}}&path=//&platform={{platform}}">Link</a>
</td>
{% for name in ('line', 'function', 'region') %}
{% set found = False %}
<td>
{% for metric in datum.summary_metrics %}
{% if not found and metric.name == name %}
{% set found = True %}
{% set percent = metric.covered*100.0/metric.total %}
{% if percent > 99.999999 %}
{{ '{0:.2f}%'.format(percent) }} ({{metric.covered}}/{{metric.total}})
{% elif percent > 9.999999 %}
&nbsp;{{ '{0:.2f}%'.format(percent) }} ({{metric.covered}}/{{metric.total}})
{% else %}
&nbsp;&nbsp;{{ '{0:.2f}%'.format(percent) }} ({{metric.covered}}/{{metric.total}})
{% endif %}
{% endif %}
{% endfor %}
</td>
{% endfor %}
<td>
<a href="https://ci.chromium.org/b/{{datum.build_id}}">Build</a>
</td>
{% if user_info and user_info.is_admin %}
<td>{{datum.visible}}</td>
{% endif %}
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</cats-app>
</body>