Example project for showcasing how to use Jazzer in a Bazel JUnit5 project.
The original JUnit example is taken from https://github.com/junit-team/junit-examples/tree/main/junit-jupiter-starter-bazel
To fuzz the functions annotated by @FuzzTest
, use bazel run
command.
bazel run
will presist all corpus entries that discover new edges in .cifuzz-corpus/<pkg>.<class>/<method >
and any findings in resources/<pkg path>/<class>/<method>
directory.
To select which fuzz test to run use --test_filter
flag.
This will fuzz the function fuzzAdd
:
JAZZER_FUZZ=1 bazel run :junit-jupiter-starter-bazel-tests --test_filter="fuzzAdd"
And this command will fuzz the function fuzzDivide
:
JAZZER_FUZZ=1 bazel run :junit-jupiter-starter-bazel-tests --test_filter="fuzzDivide"
Jazzer fuzz tests run by default in regression mode alongside JUnit tests. Just issue a bazel test
command:
bazel test :junit-jupiter-starter-bazel-tests