| # Copyright 2020 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") |
| import("//build/fidl/fidl.gni") |
| import("//build/test.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":fidl-fuzzer-tests" ] |
| } |
| |
| fuchsia_component("fidl-fuzzer-core-tests") { |
| testonly = true |
| manifest = "meta/core-tests.cmx" |
| deps = [ ":fidl_fuzzer_core_unittests" ] |
| } |
| |
| fuchsia_test_package("fidl-fuzzer-tests") { |
| test_components = [ ":fidl-fuzzer-core-tests" ] |
| } |
| |
| ######################################## |
| # Common elements |
| |
| fidl("fuchsia.fuzzer") { |
| sources = [ "fuzzer.fidl" ] |
| public_deps = [ "//sdk/fidl/fuchsia.mem" ] |
| } |
| |
| source_set("core_lib") { |
| sources = [ |
| "shared-memory.cc", |
| "shared-memory.h", |
| "signal-coordinator.cc", |
| "signal-coordinator.h", |
| ] |
| public_deps = [ |
| ":fuchsia.fuzzer", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/sync", |
| ] |
| public_configs = [ ":config" ] |
| } |
| |
| test("fidl_fuzzer_core_unittests") { |
| sources = [ |
| "shared-memory-unittest.cc", |
| "signal-coordinator-unittest.cc", |
| ] |
| deps = [ |
| ":core_lib", |
| ":test_utils", |
| ] |
| } |
| |
| source_set("test_utils") { |
| testonly = true |
| sources = [ |
| "test-utils.cc", |
| "test-utils.h", |
| ] |
| deps = [ |
| ":core_lib", |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| public_deps = [ |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/sync", |
| ] |
| } |
| |
| config("config") { |
| include_dirs = [ |
| ".", |
| "//src", |
| ] |
| } |
| |
| ######################################## |
| # Fuzzing engine |
| # TODO(71013): Update and replace. |
| |
| source_set("proxy_lib") { |
| sources = [ |
| "data-provider.cc", |
| "engine.cc", |
| "proxy.cc", |
| ] |
| public_deps = [ |
| ":core_lib", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//zircon/public/lib/sync", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| ] |
| deps = [ "//zircon/system/ulib/async-loop:async-loop-default" ] |
| } |
| |
| ######################################## |
| # Instrumentation proxy for code under test |
| # TODO(71013): Update and replace. |
| |
| source_set("remote_lib") { |
| sources = [ "remote.cc" ] |
| public_deps = [ ":remote_lib_public_deps" ] |
| deps = [ |
| "//sdk/lib/sys/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| public_configs = [ ":config" ] |
| } |
| |
| group("remote_lib_public_deps") { |
| public_deps = [ |
| ":core_lib", |
| "//zircon/public/lib/sync", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| ] |
| } |