-
Notifications
You must be signed in to change notification settings - Fork 735
tests: Google FuzzTest support and chunked container PBT #30165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,6 +330,34 @@ def redpanda_cc_fuzz_test( | |
| custom_args = args, | ||
| ) | ||
|
|
||
| def redpanda_cc_fuzztest( | ||
| name, | ||
| timeout, | ||
| srcs = [], | ||
| defines = [], | ||
| deps = [], | ||
| args = [], | ||
| env = {}, | ||
| cpu = None, | ||
| memory = None, | ||
| data = [], | ||
| tags = []): | ||
| _redpanda_cc_unit_test( | ||
|
Comment on lines
+333
to
+345
|
||
| dash_dash_protocol = False, | ||
| name = name, | ||
| timeout = timeout, | ||
| srcs = srcs, | ||
| defines = defines, | ||
| cpu = cpu, | ||
| memory = memory, | ||
| deps = deps, | ||
| custom_args = args, | ||
| env = env, | ||
| data = data, | ||
| local_defines = ["IS_GTEST"], | ||
| tags = tags, | ||
| ) | ||
|
|
||
| def redpanda_cc_btest_no_seastar( | ||
| name, | ||
| timeout, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| ### DO NOT EDIT. Generated file. | ||
| # | ||
| # To regenerate, run the following from your project's workspace: | ||
| # | ||
| # bazel run @com_google_fuzztest//bazel:setup_configs > fuzztest.bazelrc | ||
| # | ||
| # And don't forget to add the following to your project's .bazelrc: | ||
| # | ||
| # try-import %workspace%/fuzztest.bazelrc | ||
|
|
||
| ### Common options. | ||
| # | ||
| # Do not use directly. | ||
|
|
||
| # Standard define for \"ifdef-ing\" any fuzz test specific code. | ||
| build:fuzztest-common --copt=-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION | ||
|
|
||
| # In fuzz tests, we want to catch assertion violations even in optimized builds. | ||
| build:fuzztest-common --copt=-UNDEBUG | ||
|
|
||
| # Enable libc++ assertions. | ||
| # See https://libcxx.llvm.org/UsingLibcxx.html#enabling-the-safe-libc-mode | ||
| build:fuzztest-common --copt=-D_LIBCPP_ENABLE_ASSERTIONS=1 | ||
|
|
||
| ### ASan (Address Sanitizer) build configuration. | ||
| # | ||
| # Use with: --config=asan | ||
|
|
||
| build:asan --linkopt=-fsanitize=address | ||
| build:asan --copt=-fsanitize=address | ||
|
|
||
| # We rely on the following flag instead of the compiler provided | ||
| # __has_feature(address_sanitizer) to know that we have an ASAN build even in | ||
| # the uninstrumented runtime. | ||
| build:asan --copt=-DADDRESS_SANITIZER | ||
|
|
||
| ### FuzzTest build configuration. | ||
| # | ||
| # Use with: --config=fuzztest | ||
| # | ||
| # Note that this configuration includes the ASan configuration. | ||
|
|
||
| build:fuzztest --config=asan | ||
| build:fuzztest --config=fuzztest-common | ||
|
|
||
| # Link statically. | ||
| build:fuzztest --dynamic_mode=off | ||
|
|
||
| # We apply coverage tracking instrumentation to everything but Centipede and the | ||
| # FuzzTest framework itself (including GoogleTest and GoogleMock). | ||
| build:fuzztest --copt=-fsanitize-coverage=inline-8bit-counters,trace-cmp,pc-table | ||
| build:fuzztest --per_file_copt=common/.*,fuzztest/.*,centipede/.*,-centipede/.*fuzz_target,googletest/.*,googlemock/.*@-fsanitize-coverage=0 | ||
|
|
||
| ### Experimental FuzzTest build configuration. | ||
| # | ||
| # Use with: --config=fuzztest-experimental | ||
| # | ||
| # Use this instead of --config=fuzztest when building test binaries to run with | ||
| # Centipede. Eventually, this will be consolidated with --config=fuzztest. | ||
| # Note that this configuration doesn't include the ASan configuration. If you | ||
| # want to use both, you can use --config=fuzztest-experimental --config=asan. | ||
|
|
||
| build:fuzztest-experimental --config=fuzztest-common | ||
| build:fuzztest-experimental --@com_google_fuzztest//fuzztest:centipede_integration | ||
|
|
||
| # Generate line tables for debugging. | ||
| build:fuzztest-experimental --copt=-gline-tables-only | ||
| build:fuzztest-experimental --strip=never | ||
|
|
||
| # Prevent memcmp & co from being inlined. | ||
| build:fuzztest-experimental --copt=-fno-builtin | ||
|
|
||
| # Disable heap checking. | ||
| build:fuzztest-experimental --copt=-DHEAPCHECK_DISABLE | ||
|
|
||
| # Link statically. | ||
| build:fuzztest-experimental --dynamic_mode=off | ||
|
|
||
| # We apply coverage tracking instrumentation to everything but Centipede and the | ||
| # FuzzTest framework itself (including GoogleTest and GoogleMock). | ||
| # TODO(b/374840534): Add -fsanitize-coverage=control-flow once we start building | ||
| # with clang 16+. | ||
| build:fuzztest-experimental --copt=-fsanitize-coverage=trace-pc-guard,pc-table,trace-loads,trace-cmp | ||
| build:fuzztest-experimental --per_file_copt=common/.*,fuzztest/.*,centipede/.*,-centipede/.*fuzz_target,googletest/.*,googlemock/.*@-fsanitize-coverage=0 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
build --per_file_coptwarning suppressions are applied globally (no:fuzztestconfig qualifier), and the.*_pbt\.ccregex is especially broad. This risks masking real warnings in non-fuzz builds and in any future file that happens to match the pattern. Prefer scoping these suppressions to a dedicated config (e.g.build:fuzztest) and/or narrowing the regex to the specific fuzz/PBT sources, or moving the suppressions into theredpanda_cc_fuzztestmacro/targets viacoptsso they only affect fuzztest binaries.