A test rule that invokes the Bash Automated Testing System.

For example, a bats_test target containing a single .bat and basic configuration:

bats_test(
    name = "my_test",
    size = "small",
    srcs = [
        "my_test.bats",
    ],
    data = [
        "data.bin",
    ],
    env = {
        "DATA_PATH": "$(location :data.bin)",
    },
    args = ["--timing"],
)

bats_test

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
srcsTest filesList of labelsoptional[]
dataRuntime dependencies of the test.List of labelsoptional[]
envEnvironment variables of the action.

Subject to $(location) and “Make variable” substitution.
Dictionary: String -> Stringoptional{}