| # 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_test_component.gni") |
| |
| # This source set contains various fakes used in framework unit tests. |
| source_set("testing") { |
| visibility = [ "../*" ] |
| testonly = true |
| sources = [ |
| "adapter.cc", |
| "adapter.h", |
| "module.cc", |
| "module.h", |
| "process-proxy.cc", |
| "process-proxy.h", |
| "process.cc", |
| "process.h", |
| "target.cc", |
| "target.h", |
| ] |
| public_deps = [ |
| "../engine:engine-lib", |
| "../target:no_hooks", |
| "//src/sys/fuzzing/common", |
| "//src/sys/fuzzing/common/testing", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zx", |
| ] |
| deps = [ "//sdk/lib/fdio" ] |
| } |
| |
| # This executable is used for unit tests that manipulate processes. |
| executable("test-target") { |
| output_name = "component_fuzzing_framework_test_target" |
| visibility = [ "//src/sys/fuzzing/*" ] |
| testonly = true |
| sources = [ "target-main.cc" ] |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/sys/fuzzing/common", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| # The test engine is used to drive the target adapter with fixed inputs from the seed corpus. This |
| # is used to create fuzzer tests that can be run as part of CQ. |
| executable("engine-bin") { |
| output_name = "component_fuzzing_test_engine" |
| testonly = true |
| sources = [ "engine.cc" ] |
| deps = [ |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/sys/fuzzing/common", |
| "//src/sys/fuzzing/common/testing", |
| "//src/sys/fuzzing/framework/engine:adapter-client", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_test_component("engine") { |
| manifest = "meta/engine.cml" |
| deps = [ ":engine-bin" ] |
| } |