aboutsummaryrefslogtreecommitdiff
path: root/fuzzers/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'fuzzers/BUILD.gn')
-rw-r--r--fuzzers/BUILD.gn54
1 files changed, 54 insertions, 0 deletions
diff --git a/fuzzers/BUILD.gn b/fuzzers/BUILD.gn
index 2e489fd..66c3d18 100644
--- a/fuzzers/BUILD.gn
+++ b/fuzzers/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//testing/libfuzzer/fuzzer_test.gni")
+import("//third_party/protobuf/proto_library.gni")
# To download the corpus for local fuzzing use:
# gsutil -m rsync \
@@ -28,3 +29,56 @@ fuzzer_test("zucchini_patch_fuzzer") {
]
seed_corpus = "testdata/patch_fuzzer"
}
+
+proto_library("zucchini_file_pair_proto") {
+ sources = [
+ "file_pair.proto",
+ ]
+}
+
+# Ensure protoc is available.
+if (current_toolchain == host_toolchain) {
+ action("zucchini_raw_apply_seed") {
+ script = "generate_fuzzer_data.py"
+
+ args = [
+ "--raw",
+ "old_eventlog_provider.dll", # <old_file>
+ "new_eventlog_provider.dll", # <new_file>
+ "eventlog_provider.patch", # <patch_file> (temporary)
+
+ # <output_dir>
+ rebase_path("$target_gen_dir/testdata/raw_apply_fuzzer", root_build_dir),
+ ]
+
+ # Files depended upon.
+ sources = [
+ "create_seed_file_pair.py",
+ "testdata/new_eventlog_provider.dll",
+ "testdata/old_eventlog_provider.dll",
+ ]
+
+ # Outputs: necessary for validation.
+ outputs = [
+ "$target_gen_dir/testdata/raw_apply_fuzzer/seed_proto.bin",
+ ]
+ deps = [
+ "//components/zucchini:zucchini",
+ "//third_party/protobuf:protoc",
+ ]
+ }
+
+ fuzzer_test("zucchini_raw_apply_fuzzer") {
+ sources = [
+ "raw_apply_fuzzer.cc",
+ ]
+ deps = [
+ ":zucchini_file_pair_proto",
+ "//base",
+ "//components/zucchini:zucchini_lib",
+ "//third_party/libprotobuf-mutator",
+ ]
+ seed_corpus = "$target_gen_dir/testdata/raw_apply_fuzzer"
+ seed_corpus_deps = [ ":zucchini_raw_apply_seed" ]
+ }
+}