mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
27c27b7c8c
Declutters the fuzz system code a bit, hiding the cast behind a `!` operator.
52 lines
1.2 KiB
Python
52 lines
1.2 KiB
Python
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
|
|
|
|
package(features = ["layering_check"])
|
|
|
|
cc_library(
|
|
name = "fuzz_support",
|
|
srcs = [
|
|
"func_conversion.h",
|
|
"fuzz_support.cc",
|
|
],
|
|
hdrs = ["fuzz_support.h"],
|
|
visibility = ["//c-toxcore:__subpackages__"],
|
|
deps = [
|
|
"//c-toxcore/toxcore:crypto_core",
|
|
"//c-toxcore/toxcore:network",
|
|
"//c-toxcore/toxcore:tox",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "fuzz_tox",
|
|
hdrs = ["fuzz_tox.h"],
|
|
visibility = ["//c-toxcore:__subpackages__"],
|
|
deps = [":fuzz_support"],
|
|
)
|
|
|
|
cc_fuzz_test(
|
|
name = "bootstrap_fuzz_test",
|
|
srcs = ["bootstrap_harness.cc"],
|
|
copts = ["-UNDEBUG"],
|
|
corpus = ["//tools/toktok-fuzzer/corpus:bootstrap_fuzzer"],
|
|
deps = [
|
|
":fuzz_support",
|
|
"//c-toxcore/toxcore:tox",
|
|
"//c-toxcore/toxcore:tox_dispatch",
|
|
"//c-toxcore/toxcore:tox_events",
|
|
"//c-toxcore/toxcore:util",
|
|
],
|
|
)
|
|
|
|
cc_fuzz_test(
|
|
name = "toxsave_fuzz_test",
|
|
srcs = ["toxsave_harness.cc"],
|
|
copts = ["-UNDEBUG"],
|
|
corpus = ["//tools/toktok-fuzzer/corpus:toxsave_fuzzer"],
|
|
deps = [
|
|
":fuzz_support",
|
|
"//c-toxcore/toxcore:tox",
|
|
],
|
|
)
|