| # 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") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("ping") { |
| edition = "2021" |
| with_unit_tests = true |
| sources = [ |
| "src/fuchsia.rs", |
| "src/lib.rs", |
| ] |
| deps = [ |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:socket2", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:zerocopy", |
| ] |
| if (is_fuchsia) { |
| deps += [ |
| "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_rust", |
| "//src/lib/fuchsia-async", |
| ] |
| } |
| test_deps = [ "//src/connectivity/lib/net-declare" ] |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_unittest_package("ping-tests") { |
| deps = [ ":ping_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ping-tests", |
| ":ping_test($host_toolchain)", |
| ] |
| } |