1## build_test 2 3<pre> 4build_test(<a href="#build_test-name">name</a>, <a href="#build_test-targets">targets</a>, <a href="#build_test-kwargs">kwargs</a>) 5</pre> 6 7Test rule checking that other targets build. 8 9This works not by an instance of this test failing, but instead by 10the targets it depends on failing to build, and hence failing 11the attempt to run this test. 12 13NOTE: At the moment, this won't work on Windows; but someone adding 14support would be welcomed. 15 16Typical usage: 17 18``` 19 load("@bazel_skylib//rules:build_test.bzl", "build_test") 20 build_test( 21 name = "my_build_test", 22 targets = [ 23 "//some/package:rule", 24 ], 25 ) 26``` 27 28 29### Parameters 30 31<table class="params-table"> 32 <colgroup> 33 <col class="col-param" /> 34 <col class="col-description" /> 35 </colgroup> 36 <tbody> 37 <tr id="build_test-name"> 38 <td><code>name</code></td> 39 <td> 40 required. 41 <p> 42 The name of the test rule. 43 </p> 44 </td> 45 </tr> 46 <tr id="build_test-targets"> 47 <td><code>targets</code></td> 48 <td> 49 required. 50 <p> 51 A list of targets to ensure build. 52 </p> 53 </td> 54 </tr> 55 <tr id="build_test-kwargs"> 56 <td><code>kwargs</code></td> 57 <td> 58 optional. 59 <p> 60 The <a href="https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes-tests">common attributes for tests</a>. 61 </p> 62 </td> 63 </tr> 64 </tbody> 65</table> 66 67 68