native_binary

Wraps a pre-built binary or script with a binary rule.

You can “bazel run” this rule like any other binary rule, and use it as a tool in genrule.tools for example. You can also augment the binary with runfiles.

PARAMETERS

NameDescriptionDefault Value
nameThe name of the test rule.none
srclabel; path of the pre-built executablenone
outoutput; an output name for the copy of the binary. (Bazel requires that this rule make a copy of ‘src’.)none
datalist of labels; data dependenciesNone
kwargsThe <a href=“https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-binaries”>common attributes for binaries</a>.none

native_test

Wraps a pre-built binary or script with a test rule.

You can “bazel test” this rule like any other test rule. You can also augment the binary with runfiles.

PARAMETERS

NameDescriptionDefault Value
nameThe name of the test rule.none
srclabel; path of the pre-built executablenone
outoutput; an output name for the copy of the binary. (Bazel requires that this rule make a copy of ‘src’.)none
datalist of labels; data dependenciesNone
kwargsThe <a href=“https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-tests”>common attributes for tests</a>.none