| # Copyright 2018 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") { |
| name = "ping3" |
| edition = "2018" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.icmp:fuchsia.net.icmp-rustc", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/network/fidl_fuchsia_net_ext", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zerocopy", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:structopt", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.net.icmp:fuchsia.net.icmp-rustc", |
| "//sdk/fidl/fuchsia.net.stack:fuchsia.net.stack-rustc", |
| "//sdk/fidl/fuchsia.netstack:fuchsia.netstack-rustc", |
| "//src/connectivity/lib/fidl_fuchsia_net_stack_ext", |
| "//src/connectivity/network/testing/netemul/lib/fidl:environment-rustc", |
| "//src/connectivity/network/testing/netemul/rust-v1:lib", |
| ] |
| |
| sources = [ |
| "src/main.rs", |
| "src/opt.rs", |
| "src/stats.rs", |
| "src/store.rs", |
| "src/tests/integration_tests.rs", |
| "src/tests/mod.rs", |
| ] |
| |
| configs -= [ "//build/config/rust:allow_unused_results" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "ping3" |
| manifest = "meta/ping3.cmx" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("ping3") { |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_component("ping3_bin_test") { |
| testonly = true |
| deps = [ ":bin_test" ] |
| manifest = "meta/ping3_bin_test.cmx" |
| } |
| |
| fuchsia_test_package("ping3-tests") { |
| test_components = [ ":ping3_bin_test" ] |
| deps = [ |
| # The component under test. |
| ":component", |
| |
| # ping3-tests lauches netstack3. |
| "//src/connectivity/network/netstack3:component", |
| |
| # ping3-tests uses netemul to create hermetic test environment. |
| "//src/connectivity/network/testing/netemul/runner:netemul-sandbox-component", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":ping3-tests" ] |
| } |