2019-02-22 20:29:00 +00:00
|
|
|
## build_test
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
build_test(<a href="#build_test-name">name</a>, <a href="#build_test-targets">targets</a>, <a href="#build_test-kwargs">kwargs</a>)
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
Test rule checking that other targets build.
|
|
|
|
|
|
|
|
This works not by an instance of this test failing, but instead by
|
|
|
|
the targets it depends on failing to build, and hence failing
|
|
|
|
the attempt to run this test.
|
|
|
|
|
|
|
|
NOTE: At the moment, this won't work on Windows; but someone adding
|
|
|
|
support would be welcomed.
|
|
|
|
|
|
|
|
Typical usage:
|
|
|
|
|
2019-02-27 22:14:06 +00:00
|
|
|
```
|
2019-02-22 20:29:00 +00:00
|
|
|
load("@bazel_skylib//rules:build_test.bzl", "build_test")
|
|
|
|
build_test(
|
|
|
|
name = "my_build_test",
|
|
|
|
targets = [
|
|
|
|
"//some/package:rule",
|
|
|
|
],
|
|
|
|
)
|
2019-02-27 22:14:06 +00:00
|
|
|
```
|
2019-02-22 20:29:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
|
|
<table class="params-table">
|
|
|
|
<colgroup>
|
|
|
|
<col class="col-param" />
|
|
|
|
<col class="col-description" />
|
|
|
|
</colgroup>
|
|
|
|
<tbody>
|
2019-02-27 20:54:19 +00:00
|
|
|
<tr id="build_test-name">
|
2019-02-22 20:29:00 +00:00
|
|
|
<td><code>name</code></td>
|
|
|
|
<td>
|
|
|
|
required.
|
|
|
|
<p>
|
|
|
|
The name of the test rule.
|
|
|
|
</p>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2019-02-27 20:54:19 +00:00
|
|
|
<tr id="build_test-targets">
|
2019-02-22 20:29:00 +00:00
|
|
|
<td><code>targets</code></td>
|
|
|
|
<td>
|
|
|
|
required.
|
|
|
|
<p>
|
|
|
|
A list of targets to ensure build.
|
|
|
|
</p>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2019-02-27 20:54:19 +00:00
|
|
|
<tr id="build_test-kwargs">
|
2019-02-22 20:29:00 +00:00
|
|
|
<td><code>kwargs</code></td>
|
|
|
|
<td>
|
2019-02-27 20:54:19 +00:00
|
|
|
optional.
|
|
|
|
<p>
|
|
|
|
The <a href="https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes-tests">common attributes for tests</a>.
|
|
|
|
</p>
|
2019-02-22 20:29:00 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|