• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!-- Generated with Stardoc: http://skydoc.bazel.build -->
2
3A test verifying other targets can be successfully analyzed as part of a `bazel test`
4
5<a id="#analysis_test"></a>
6
7## analysis_test
8
9<pre>
10analysis_test(<a href="#analysis_test-name">name</a>, <a href="#analysis_test-targets">targets</a>)
11</pre>
12
13Test rule checking that other targets can be successfully analyzed.
14
15    This rule essentially verifies that all targets under `targets` would
16    generate no errors when analyzed with `bazel build [targets] --nobuild`.
17    Action success/failure for the targets and their transitive dependencies
18    are not verified. An analysis test simply ensures that each target in the transitive
19    dependencies propagate providers appropriately and register actions for their outputs
20    appropriately.
21
22    NOTE: If the targets fail to analyze, instead of the analysis_test failing, the analysis_test
23    will fail to build. Ideally, it would instead result in a test failure. This is a current
24    infrastructure limitation that may be fixed in the future.
25
26    Typical usage:
27
28      load("@bazel_skylib//rules:analysis_test.bzl", "analysis_test")
29      analysis_test(
30          name = "my_analysis_test",
31          targets = [
32              "//some/package:rule",
33          ],
34      )
35
36    Args:
37      name: The name of the test rule.
38      targets: A list of targets to ensure build.
39
40**ATTRIBUTES**
41
42
43| Name  | Description | Type | Mandatory | Default |
44| :------------- | :------------- | :------------- | :------------- | :------------- |
45| <a id="analysis_test-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required |  |
46| <a id="analysis_test-targets"></a>targets |  -   | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | required |  |
47
48
49