1- load ("@rules_cc//cc:defs.bzl" , "cc_binary" , "cc_library" )
1+ load ("@rules_cc//cc:defs.bzl" , "cc_binary" , "cc_library" , "cc_test" )
22load ("@rules_fuzzing//fuzzing:cc_defs.bzl" , "cc_fuzz_test" )
3- load ("@rules_fuzzing//fuzzing/private:binary.bzl" , "fuzzing_binary" ) # buildifier: disable=bzl-visibility
43
54cc_library (
65 name = "fuzz_support" ,
@@ -27,9 +26,9 @@ cc_library(
2726cc_fuzz_test (
2827 name = "bootstrap_fuzz_test" ,
2928 size = "small" ,
30- srcs = ["bootstrap_harness .cc" ],
29+ srcs = ["bootstrap_fuzz_test .cc" ],
3130 copts = ["-UNDEBUG" ],
32- corpus = ["//tools/toktok-fuzzer/corpus:bootstrap_fuzzer " ],
31+ corpus = ["//tools/toktok-fuzzer/corpus:bootstrap_fuzz_test " ],
3332 deps = [
3433 ":fuzz_support" ,
3534 ":fuzz_tox" ,
@@ -58,9 +57,9 @@ cc_fuzz_test(
5857cc_fuzz_test (
5958 name = "toxsave_fuzz_test" ,
6059 size = "small" ,
61- srcs = ["toxsave_harness .cc" ],
60+ srcs = ["toxsave_fuzz_test .cc" ],
6261 copts = ["-UNDEBUG" ],
63- corpus = ["//tools/toktok-fuzzer/corpus:toxsave_fuzzer " ],
62+ corpus = ["//tools/toktok-fuzzer/corpus:toxsave_fuzz_test " ],
6463 deps = [
6564 ":fuzz_support" ,
6665 "//c-toxcore/toxcore:tox" ,
@@ -80,12 +79,34 @@ cc_binary(
8079 ],
8180)
8281
83- fuzzing_binary (
84- name = "protodump_bin" ,
85- testonly = True ,
86- binary = ":protodump" ,
87- engine = "@rules_fuzzing//fuzzing:cc_engine" ,
82+ genrule (
83+ name = "e2e_fuzz_test_init" ,
84+ outs = [
85+ "e2e_fuzz_test_init.dat" ,
86+ "e2e_fuzz_test_bootstrap.dat" ,
87+ ],
88+ cmd = "$(location :protodump) $(location e2e_fuzz_test_init.dat) $(location e2e_fuzz_test_bootstrap.dat)" ,
89+ tags = ["manual" ],
90+ tools = [":protodump" ],
91+ )
92+
93+ # bazel test --config=asan-libfuzzer //c-toxcore/testing/fuzzing:protodump_reduce_test
94+ cc_test (
95+ name = "protodump_reduce_test" ,
96+ size = "small" ,
97+ srcs = ["protodump_reduce.cc" ],
98+ args = ["$(location :e2e_fuzz_test_init.dat)" ],
99+ copts = ["-UNDEBUG" ],
100+ data = [":e2e_fuzz_test_init.dat" ],
88101 tags = ["manual" ],
102+ deps = [
103+ ":fuzz_support" ,
104+ ":fuzz_tox" ,
105+ "//c-toxcore/toxcore:tox" ,
106+ "//c-toxcore/toxcore:tox_dispatch" ,
107+ "//c-toxcore/toxcore:tox_events" ,
108+ "@rules_fuzzing//fuzzing:cc_engine" ,
109+ ],
89110)
90111
91112cc_fuzz_test (
0 commit comments