| # 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/components.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//build/testing/environments.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| CORE_DEPS = [ |
| "//sdk/fidl/fuchsia.overnet.protocol:fuchsia.overnet.protocol_rust", |
| "//src/connectivity/overnet/lib/circuit", |
| "//src/lib/async-utils", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-lock", |
| "//third_party/rust_crates:crc", |
| "//third_party/rust_crates:event-listener", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| "//third_party/rust_crates:rand", |
| ] |
| |
| if (is_fuchsia) { |
| CORE_DEPS += [ "//src/lib/zircon/rust:fuchsia-zircon" ] |
| } |
| |
| CORE_SOURCES = [ |
| "src/coding.rs", |
| "src/future_help.rs", |
| "src/handle_info.rs", |
| "src/labels.rs", |
| "src/lib.rs", |
| "src/peer/mod.rs", |
| "src/peer/framed_stream.rs", |
| "src/proxy/mod.rs", |
| "src/proxy/run/mod.rs", |
| "src/proxy/run/main.rs", |
| "src/proxy/run/spawn.rs", |
| "src/proxy/run/xfer.rs", |
| "src/proxy/stream.rs", |
| "src/proxy/handle/mod.rs", |
| "src/proxy/handle/channel.rs", |
| "src/proxy/handle/event_pair.rs", |
| "src/proxy/handle/signals.rs", |
| "src/proxy/handle/socket.rs", |
| "src/router/mod.rs", |
| "src/router/service_map.rs", |
| "src/test_util.rs", |
| ] |
| |
| rustc_library("core") { |
| name = "overnet_core" |
| edition = "2021" |
| deps = CORE_DEPS |
| sources = CORE_SOURCES |
| } |
| |
| rustc_test("core_test") { |
| name = "overnet_core_test" |
| edition = "2021" |
| |
| deps = CORE_DEPS + [ |
| ":test.coding_rust", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-sync", |
| ] |
| |
| if (is_host) { |
| args = [ "--test-threads=1" ] |
| } |
| sources = CORE_SOURCES |
| } |
| |
| fidl("test.coding") { |
| testonly = true |
| sources = [ "coding.test.fidl" ] |
| } |
| |
| fuchsia_unittest_package("overnet-core-tests") { |
| deps = [ ":core_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":core_test($host_toolchain)", |
| ":overnet-core-tests", |
| ] |
| } |