• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Bazel Rules Testing
2
3rules_testing is a collection of utilities, libraries, and frameworks to make
4testing Starlark and Bazel rules easy and pleasant.
5
6version |version|
7
8## Installation
9
10To use rules_testing, you need to modify `WORKSPACE` or `MODULE.bazel`
11to depend on rules_testing. We recommend using bzlmod because it's simpler.
12
13For bzlmod, add this to your `MODULE.bazel`:
14
15```
16bazel_dep(name = "rules_testing", version = "<VERSION>", dev_dependency=True)
17```
18
19See the [GitHub releases
20page](https://github.com/bazelbuild/rules_testing/releases) for available
21versions.
22
23For `WORKSPACE`, see the [GitHub releases
24page](https://github.com/bazelbuild/rules_testing/releases) for the necessary
25config to copy and paste.
26
27
28## Analysis tests
29
30Analysis testing means testing something during the analysis phase of Bazel
31execution -- this is when rule logic is run.
32
33See [Analysis tests](/analysis_tests.md) for how to write analysis tests.
34
35## Fluent asserts
36
37Included in rules_testing is a fluent, truth-style asserts library.
38
39See [Truth docs](/truth.md) for how to use it.
40
41
42```{toctree}
43:glob:
44:hidden:
45
46self
47*
48api/index
49```
50