| # Copyright 2017 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # Mojo fuzzing tools |
| |
| import("//build/config/features.gni") |
| import("//mojo/public/tools/bindings/mojom.gni") |
| import("//testing/libfuzzer/fuzzer_test.gni") |
| import("//third_party/protobuf/proto_library.gni") |
| |
| # mojo/public BUILD depends on this target. Needed for package discovery |
| group("fuzzers") { |
| } |
| |
| mojom("fuzz_mojom") { |
| sources = [ |
| "fuzz.mojom", |
| ] |
| } |
| |
| fuzzer_test("mojo_parse_message_fuzzer") { |
| sources = [ |
| "fuzz_impl.cc", |
| "mojo_parse_message_fuzzer.cc", |
| ] |
| deps = [ |
| ":fuzz_mojom", |
| "//mojo/edk", |
| ] |
| seed_corpus = "//mojo/public/tools/fuzzers/message_corpus" |
| } |
| |
| # MessageDumper is not meant to work on Windows. |
| if (!is_win) { |
| executable("mojo_fuzzer_message_dump") { |
| sources = [ |
| "fuzz_impl.cc", |
| "mojo_fuzzer_message_dump.cc", |
| ] |
| deps = [ |
| ":fuzz_mojom", |
| "//base", |
| "//mojo/edk", |
| ] |
| } |
| } |
| |
| fuzzer_test("mojo_parse_message_proto_fuzzer") { |
| sources = [ |
| "fuzz_impl.cc", |
| "mojo_parse_message_proto_fuzzer.cc", |
| ] |
| deps = [ |
| ":fuzz_mojom", |
| ":mojo_fuzzer_proto", |
| "//mojo/edk", |
| "//third_party/libprotobuf-mutator", |
| ] |
| seed_corpus = "//mojo/public/tools/fuzzers/mojo_parse_message_proto_corpus" |
| } |
| |
| proto_library("mojo_fuzzer_proto") { |
| sources = [ |
| "mojo_fuzzer.proto", |
| ] |
| } |