blob: 6ee7c172995161417510cdab90f9207fbd43c625 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/fuzzing/fuzzer.gni")
group("fuzzer") {
testonly = true
deps = [ ":tests" ]
}
group("tests") {
testonly = true
deps = [ ":fuzzing-examples" ]
}
fuzzers_package("fuzzing-examples") {
# Packages can have non-default names.
package_name = "example-fuzzers"
# Variables set in the outer scope apply to all fuzzers.
fuzz_host = true
# `fuzzers` (without a language prefix) are folded into `cpp_fuzzers` below.
fuzzers = [ ":corpus_fuzzer" ]
# Fuzzers are defined for each supported language
cpp_fuzzers = [
# Each list of fuzzers can contain simple labels...
":overflow_fuzzer",
":trap_fuzzer",
":baz_fuzzer",
":fuzzed_data_provider_fuzzer",
{
# ... or scopes with additional fields, like a non-default output name.
label = ":oom_fuzzer"
output_name = "out_of_memory_fuzzer"
},
{
# Variables set here override those in the outer scope.
label = "//garnet/examples/fidl/echo_server_cpp/fuzzer:echo-fuzzer"
fuzz_host = false
},
]
# A fuzzers package can have fuzzers for multiple languages.
rust_fuzzers = [
"rust:toy_example_arbitrary",
"rust:toy_example_raw_bytes",
"rust:toy_example_with_main",
]
# TODO(44551): Building Go fuzzers exhibits linker errors on macOS. Unlink from build until fixed.
if (host_os != "mac") {
go_fuzzers = [ "go:basic_fuzzer" ]
}
}
fuzzer("oom_fuzzer") {
output_name = "out_of_memory_fuzzer"
sources = [ "oom.cc" ]
}
fuzzer("overflow_fuzzer") {
sources = [ "overflow.cc" ]
}
fuzzer("trap_fuzzer") {
sources = [ "trap.cc" ]
}
fuzzer("fuzzed_data_provider_fuzzer") {
sources = [ "fuzzed-data-provider.cc" ]
}
fuzzer("corpus_fuzzer") {
sources = [ "corpus.cc" ]
}
fuzzer("baz_fuzzer") {
sources = [ "target.cc" ]
deps = [ ":baz" ]
}
source_set("baz") {
sources = [ "baz.cc" ]
deps = [ "//src/lib/fxl" ]
}