| # Copyright 2021 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/components/fuchsia_component.gni") |
| |
| # Both the "real" and "test" engines used in fuzzers and fuzzer tests, |
| # respectively, use the adapter-client code to connect to the fuzz target |
| # adapter component. |
| source_set("adapter-client") { |
| visibility = [ "../*" ] |
| testonly = true |
| sources = [ |
| "adapter-client.cc", |
| "adapter-client.h", |
| "corpus.cc", |
| "corpus.h", |
| ] |
| public_deps = [ |
| "//sdk/lib/fidl/cpp", |
| "//src/lib/fxl", |
| "//src/sys/fuzzing/common", |
| "//src/sys/fuzzing/fidl:fuchsia.fuzzer", |
| "//zircon/system/ulib/sync", |
| ] |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/files", |
| ] |
| } |
| |
| # This source set is the core of the "real" engine and includes the coverage |
| # processing and input mutation. |
| source_set("engine-lib") { |
| visibility = [ "../*" ] |
| testonly = true |
| sources = [ |
| "coverage-client.cc", |
| "coverage-client.h", |
| "dictionary.cc", |
| "dictionary.h", |
| "module-pool.cc", |
| "module-pool.h", |
| "module-proxy.cc", |
| "module-proxy.h", |
| "mutagen.cc", |
| "mutagen.h", |
| "process-proxy.cc", |
| "process-proxy.h", |
| "runner.cc", |
| "runner.h", |
| ] |
| public_deps = [ |
| ":adapter-client", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/fit", |
| "//src/lib/fxl", |
| "//src/sys/fuzzing/common", |
| "//src/sys/fuzzing/fidl:fuchsia.fuzzer", |
| "//src/sys/fuzzing/framework/target:no_hooks", |
| "//zircon/system/ulib/sync", |
| ] |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//third_party/re2", |
| "//zircon/system/ulib/inspector", |
| ] |
| } |
| |
| executable("engine-bin") { |
| output_name = "component_fuzzing_engine" |
| testonly = true |
| sources = [ "engine-main.cc" ] |
| deps = [ ":engine-lib" ] |
| } |
| |
| fuchsia_component("engine") { |
| testonly = true |
| manifest = "meta/engine.cml" |
| deps = [ ":engine-bin" ] |
| } |
| |
| # Tests and test support. |
| |
| source_set("testing") { |
| visibility = [ ":*" ] |
| testonly = true |
| sources = [ |
| "process-proxy-test.cc", |
| "process-proxy-test.h", |
| "runner-test.cc", |
| "runner-test.h", |
| ] |
| public_deps = [ |
| ":engine-lib", |
| "//src/sys/fuzzing/common:runner-unittests", |
| "//src/sys/fuzzing/common/testing", |
| "//src/sys/fuzzing/fidl:fuchsia.fuzzer", |
| "//src/sys/fuzzing/framework/coverage:coverage-lib", |
| "//src/sys/fuzzing/framework/target:no_hooks", |
| "//src/sys/fuzzing/framework/testing", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| source_set("unittests") { |
| visibility = [ "../*" ] |
| testonly = true |
| sources = [ |
| "adapter-client-unittest.cc", |
| "corpus-unittest.cc", |
| "coverage-client-unittest.cc", |
| "dictionary-unittest.cc", |
| "module-pool-unittest.cc", |
| "module-proxy-unittest.cc", |
| "mutagen-unittest.cc", |
| "process-proxy-unittest.cc", |
| "runner-unittest.cc", |
| ] |
| deps = [ |
| ":testing", |
| "//src/lib/files", |
| "//src/sys/fuzzing/common:runner-unittests", |
| "//src/sys/fuzzing/framework/testing:test-target", |
| ] |
| } |
| |
| # These unit tests emit fatal logs. |
| source_set("fatal-unittests") { |
| visibility = [ "../*" ] |
| testonly = true |
| sources = [ |
| "process-proxy-fatal-unittest.cc", |
| "runner-fatal-unittest.cc", |
| ] |
| deps = [ |
| ":testing", |
| "//src/sys/fuzzing/common:runner-fatal-unittests", |
| "//src/sys/fuzzing/framework/testing:test-target", |
| ] |
| } |