ada_test
Rules
ada_test
load("@rules_ada//ada:ada_test.bzl", "ada_test")
ada_test(name, deps, srcs, data, compile_data, copts, env, env_inherit, linkopts, linkstatic, main,
subunits)
Compiles Ada source files, binds them, and links into a test executable. Run with bazel test.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Dependencies. Can be Ada targets (AdaInfo) or C/C++ targets (CcInfo). | List of labels | optional | [] |
| srcs | Ada source files (.ads specs and .adb bodies). | List of labels | optional | [] |
| data | Additional files needed at runtime. | List of labels | optional | [] |
| compile_data | Additional Ada source files needed during compilation but not compiled independently (e.g., subunit bodies referenced via 'separate'). | List of labels | optional | [] |
| copts | Additional compiler flags for Ada compilation (e.g., -gnatwa, -O2). | List of strings | optional | [] |
| env | Environment variables to set when running the test. | Dictionary: String -> String | optional | {} |
| env_inherit | Environment variables to inherit from the host environment. | List of strings | optional | [] |
| linkopts | Additional linker flags. | List of strings | optional | [] |
| linkstatic | Prefer static linking for dependencies. Like cc_binary, this also selects the static_linking_mode feature; False (or --dynamic_mode=fully) selects dynamic_linking_mode instead. | Boolean | optional | True |
| main | Main Ada source file containing the entry point procedure. It is compiled even if it is not listed in srcs. If not set, the first .adb file in srcs is used. | Label | optional | None |
| subunits | Body files that are separate subunits, listed explicitly to bypass the hyphen-stem heuristic. Files listed here MUST also appear in srcs. They flow as inputs to their parent unit's compile but get no standalone compile action. | List of labels | optional | [] |