docs/versions/7.1.0/rules/lib/toplevel/coverage_common.mdx
{% dynamic setvar source_file "src/main/java/com/google/devtools/build/lib/starlarkbuildapi/test/CoverageCommonApi.java" %} {% dynamic setvar version "7.1.0" %} {% dynamic setvar original_path "/rules/lib/toplevel/coverage_common" %} {% include "_buttons.html" %}
<!-- {% raw %} -->Helper functions to access coverage-related infrastructure.
<h2>Members</h2> <ul> <li> <a href="#instrumented_files_info">instrumented_files_info</a> </li> </ul> <h2 id="instrumented_files_info">instrumented_files_info</h2>
<p><pre class="rule-signature"><a class="anchor" href="../providers/InstrumentedFilesInfo.html">InstrumentedFilesInfo</a> coverage_common.instrumented_files_info(ctx, *, source_attributes=[], dependency_attributes=[], extensions=None, metadata_files=[])</pre></p>
Creates a new <a class="anchor" href="../providers/InstrumentedFilesInfo.html">InstrumentedFilesInfo</a> instance. Use this provider to communicate coverage-related attributes of the current build rule.
<!-- hide-from-toc is a class used by DevSite for the public Bazel site
(https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
<h3 class="hide-from-toc">Parameters</h3>
<table class="table table-bordered table-condensed table-params">
<colgroup>
<col class="col-param">
<col class="param-description">
</colgroup>
<thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td id="instrumented_files_info.ctx">
<code>ctx</code>
</td>
<td>
required
The rule context.
</td>
</tr>
<tr>
<td id="instrumented_files_info.source_attributes">
<code>source_attributes</code>
</td>
<td>
default is <code>[]</code>
A list of attribute names which contain source files processed by this rule.
</td>
</tr>
<tr>
<td id="instrumented_files_info.dependency_attributes">
<code>dependency_attributes</code>
</td>
<td>
default is <code>[]</code>
A list of attribute names which might provide runtime dependencies (either code dependencies or runfiles).
</td>
</tr>
<tr>
<td id="instrumented_files_info.extensions">
<code>extensions</code>
</td>
<td>
<a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s; or <code>None</code>;
default is <code>None</code>
File extensions used to filter files from source_attributes. For example, 'js'. If not provided (or None), then all files from source_attributes will be added to instrumented files, if an empty list is provided, then no files from source attributes will be added.
</td>
</tr>
<tr>
<td id="instrumented_files_info.metadata_files">
<code>metadata_files</code>
</td>
<td>
<a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../builtins/File.html">File</a>s;
default is <code>[]</code>
Additional files required to generate coverage LCOV files after code execution. e.g. .gcno files for C++.
</td>
</tr>
</tbody>
</table>