| # 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.gni") |
| |
| source_set("testing") { |
| visibility = [ "//src/sys/*" ] |
| testonly = true |
| sources = [ |
| "artifact.cc", |
| "artifact.h", |
| "async-test.h", |
| "component-context.cc", |
| "component-context.h", |
| "corpus-reader.cc", |
| "corpus-reader.h", |
| "module.cc", |
| "module.h", |
| "monitor.cc", |
| "monitor.h", |
| "registrar.cc", |
| "registrar.h", |
| "runner.cc", |
| "runner.h", |
| ] |
| |
| deps = [ |
| "//sdk/lib/async", |
| "//sdk/lib/syslog/cpp", |
| ] |
| public_deps = [ |
| "..:common", |
| "//sdk/testing/fidl:test_support", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/sync", |
| ] |
| } |
| |
| # Test executables which use this source_set (in place of a real sanitizer runtime) must include |
| # `exclude_toolchain_tags = [ "instrumented" ]`. |
| source_set("sanitizer") { |
| testonly = true |
| sources = [ |
| "sanitizer.cc", |
| "sanitizer.h", |
| ] |
| deps = [ |
| ":testing", |
| "..:common", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl", |
| ] |
| } |
| |
| # Simple echo executable. |
| executable("echo") { |
| output_name = "fuzzing_echo_for_test" |
| visibility = [ "//src/sys/fuzzing/*" ] |
| testonly = true |
| sources = [ "echo.cc" ] |
| } |
| |
| # A standalone fuzzer that uses a fake runner. |
| executable("fuzzer-bin") { |
| output_name = "fake_fuzzer_for_testing" |
| testonly = true |
| sources = [ "engine-main.cc" ] |
| deps = [ |
| ":testing", |
| "//src/lib/fxl", |
| "//src/sys/fuzzing/fidl:fuchsia.fuzzer_hlcpp", |
| ] |
| } |
| |
| fuchsia_test_component("fuzzer") { |
| manifest = "meta/fuzzer.cml" |
| deps = [ ":fuzzer-bin" ] |
| } |
| |
| # A standalone package containing a fake fuzzer. The normal fuzzing tools, e.g. `ffx fuzz`, should |
| # work with the package produced. |
| fuchsia_test_package("fuzzer-pkg") { |
| package_name = "fake-fuzzer" |
| test_components = [ ":fuzzer" ] |
| test_specs = { |
| build_rule = "fuchsia_fuzzer_package" |
| } |
| deps = [ "//src/sys/fuzzing" ] |
| } |