blob: ba1397892e9f7271108fd12289a7d2a60e312b7e [file] [log] [blame] [view]
Alex Eagleeabe5f72021-09-24 08:24:43 -07001<!-- Generated with Stardoc: http://skydoc.bazel.build -->
2
Alexandre Rostovtsev6e30a772021-10-27 09:13:59 -04003A test verifying other targets build as part of a `bazel test`
4
nickgooding31ab4c82022-08-30 19:57:34 +01005<a id="build_test"></a>
Alex Eagleeabe5f72021-09-24 08:24:43 -07006
c-parsons96308532019-02-28 17:43:57 -05007## build_test
8
9<pre>
10build_test(<a href="#build_test-name">name</a>, <a href="#build_test-targets">targets</a>, <a href="#build_test-kwargs">kwargs</a>)
11</pre>
12
13Test rule checking that other targets build.
14
15This works not by an instance of this test failing, but instead by
16the targets it depends on failing to build, and hence failing
17the attempt to run this test.
18
c-parsons96308532019-02-28 17:43:57 -050019Typical usage:
20
21```
22 load("@bazel_skylib//rules:build_test.bzl", "build_test")
23 build_test(
24 name = "my_build_test",
25 targets = [
26 "//some/package:rule",
27 ],
28 )
29```
30
31
Alex Eagleeabe5f72021-09-24 08:24:43 -070032**PARAMETERS**
c-parsons96308532019-02-28 17:43:57 -050033
c-parsons96308532019-02-28 17:43:57 -050034
Alex Eagleeabe5f72021-09-24 08:24:43 -070035| Name | Description | Default Value |
Alexandre Rostovtsev6e30a772021-10-27 09:13:59 -040036| :------------- | :------------- | :------------- |
37| <a id="build_test-name"></a>name | The name of the test rule. | none |
38| <a id="build_test-targets"></a>targets | A list of targets to ensure build. | none |
Alexandre Rostovtsevbc112d42022-10-03 05:13:46 -040039| <a id="build_test-kwargs"></a>kwargs | The [common attributes for tests](https://bazel.build/reference/be/common-definitions#common-attributes-tests). | none |
c-parsons96308532019-02-28 17:43:57 -050040
Samuel Freilich506c1722021-10-04 12:03:48 -040041