| # Copyright 2022 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_binary.gni") |
| |
| rustc_binary("bin") { |
| edition = "2021" |
| testonly = true |
| name = "netemul_runner" |
| with_unit_tests = true |
| deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.component.runner:fuchsia.component.runner_rust", |
| "//sdk/fidl/fuchsia.data:fuchsia.data_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.net.interfaces:fuchsia.net.interfaces_rust", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", |
| "//sdk/fidl/fuchsia.test:fuchsia.test_rust", |
| "//src/connectivity/network/testing/netemul/fidl:fuchsia.netemul_rust", |
| "//src/connectivity/network/testing/netemul/network-context/fidl:network_rust", |
| "//src/connectivity/network/testing/netemul/rust:lib", |
| "//src/lib/async-utils", |
| "//src/lib/diagnostics/log/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/component-events", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:thiserror", |
| ] |
| test_deps = [ |
| "//sdk/fidl/fuchsia.net:fuchsia.net_rust", |
| "//src/connectivity/lib/net-declare", |
| "//src/sys/lib/cm_rust", |
| "//src/sys/lib/cm_rust/testing", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:test-case", |
| ] |
| sources = [ |
| "src/config.rs", |
| "src/main.rs", |
| ] |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_component("component") { |
| testonly = true |
| component_name = "netemul-test-runner" |
| manifest = "meta/netemul-test-runner.cml" |
| deps = [ |
| ":bin", |
| "//src/connectivity/network/testing/netemul/service:netemul-sandbox", |
| ] |
| } |
| |
| fuchsia_package("package") { |
| testonly = true |
| package_name = "netemul-test-runner" |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_unittest_package("netemul-runner-unit-tests") { |
| deps = [ |
| ":bin_test", |
| "//src/connectivity/network/testing/netemul/service:netemul-sandbox", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":netemul-runner-unit-tests", |
| "tests", |
| ] |
| } |