Public definitions for fuzzing rules.
Definitions outside this file are private unless otherwise noted, and may change without notice.
load("@rules_fuzzing//fuzzing:java_defs.bzl", "java_fuzzing_engine") java_fuzzing_engine(name, display_name, launcher, launcher_data, library)
Specifies a fuzzing engine that can be used to run Java fuzz targets.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
display_name | The name of the fuzzing engine, as it should be rendered in human-readable output. | String | required | |
launcher | A shell script that knows how to launch the fuzzing executable based on configuration specified in the environment. | Label | required | |
launcher_data | A dict mapping additional runtime dependencies needed by the fuzzing engine to environment variables that will be available inside the launcher, holding the runtime path to the dependency. | Dictionary: Label -> String | optional | {} |
library | A java_library target that is made available to all Java fuzz tests. | Label | optional | None |
load("@rules_fuzzing//fuzzing:java_defs.bzl", "FuzzingEngineInfo") FuzzingEngineInfo(display_name, launcher, launcher_runfiles, launcher_environment)
Provider for storing the language-independent part of the specification of a fuzzing engine.
FIELDS
load("@rules_fuzzing//fuzzing:java_defs.bzl", "fuzzing_decoration") fuzzing_decoration(name, raw_binary, engine, corpus, dicts, instrument_binary, define_regression_test, test_size, test_tags, test_timeout)
Generates the standard targets associated to a fuzz test.
This macro can be used to define custom fuzz test rules in case the default
cc_fuzz_test
macro is not adequate. Refer to the cc_fuzz_test
macro
documentation for the set of targets generated.
PARAMETERS
load("@rules_fuzzing//fuzzing:java_defs.bzl", "java_fuzz_test") java_fuzz_test(name, srcs, target_class, corpus, dicts, engine, size, tags, timeout, **binary_kwargs)
Defines a Java fuzz test and a few associated tools and metadata.
For each fuzz test <name>
, this macro defines a number of targets. The
most relevant ones are:
<name>
: A test that executes the fuzzer binary against the seed corpus (or on an empty input if no corpus is specified).<name>_bin
: The instrumented fuzz test executable. Use this target for debugging or for accessing the complete command line interface of the fuzzing engine. Most developers should only need to use this target rarely.<name>_run
: An executable target used to launch the fuzz test using a simpler, engine-agnostic command line interface.<name>_oss_fuzz
: Generates a<name>_oss_fuzz.tar
archive containing the fuzz target executable and its associated resources (corpus, dictionary, etc.) in a format suitable for unpacking in the $OUT/ directory of an OSS-Fuzz build. This target can be used inside thebuild.sh
script of an OSS-Fuzz project.
PARAMETERS
Name | Description | Default Value |
---|---|---|
name | A unique name for this target. Required. | none |
srcs | A list of source files of the target. | None |
target_class | The class that contains the static fuzzerTestOneInput method. Defaults to the same class main_class would. | None |
corpus | A list containing corpus files. | None |
dicts | A list containing dictionaries. | None |
engine | A label pointing to the fuzzing engine to use. | Label("@rules_fuzzing//fuzzing:java_engine") |
size | The size of the regression test. This does not affect fuzzing itself. Takes the common size values. | None |
tags | Tags set on the regression test. | None |
timeout | The timeout for the regression test. This does not affect fuzzing itself. Takes the common timeout values. | None |
binary_kwargs | Keyword arguments directly forwarded to the fuzz test binary rule. | none |