blob: 639c921e8f7025a5e78e051d2504aad73242fb38 [file] [log] [blame]
# Copyright 2023 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("fidl_fuchsia_posix_socket_ext") {
with_unit_tests = true
edition = "2021"
deps = [
"//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_rust",
"//sdk/fidl/fuchsia.posix.socket.packet:fuchsia.posix.socket.packet_rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:socket2",
]
test_deps = [
"//sdk/fidl/fuchsia.hardware.network:fuchsia.hardware.network_rust",
"//sdk/fidl/fuchsia.net:fuchsia.net_rust",
"//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_rust",
"//sdk/fidl/fuchsia.posix.socket.packet:fuchsia.posix.socket.packet_rust",
"//src/connectivity/lib/net-declare",
"//src/connectivity/lib/net-types",
"//src/connectivity/lib/packet-formats",
"//src/connectivity/network/lib/sockaddr",
"//src/connectivity/network/testing/netemul/network-context/fidl:network_rust",
"//src/connectivity/network/testing/netemul/rust:lib",
"//src/connectivity/network/tests/integration/common:netstack_testing_common",
"//src/connectivity/network/tests/integration/macros:netstack_testing_macros",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/network/fidl_fuchsia_net_ext",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:libc",
]
sources = [ "src/lib.rs" ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
configs += [ "//build/config/rust/lints:clippy_warn_all" ]
}
fuchsia_test_component("fidl-fuchsia-posix-socket-ext-test") {
manifest = "meta/fidl-fuchsia-posix-socket-ext-test.cml"
deps = [
":fidl_fuchsia_posix_socket_ext_test",
"//src/connectivity/network/netstack:component-debug",
"//src/connectivity/network/netstack3:component-debug",
"//src/connectivity/network/testing/netemul/service:netemul-sandbox",
]
if (current_cpu == "riscv64") {
# Netstack2 is not available on RISC-V, so it must be excluded for this
# test to build. The test cases only attempt to run against Netstack2
# when built for non-RISC-V architectures.
deps -= [ "//src/connectivity/network/netstack:component-debug" ]
}
}
fuchsia_test_package("fidl-fuchsia-posix-socket-ext-tests") {
test_components = [ ":fidl-fuchsia-posix-socket-ext-test" ]
}
group("tests") {
testonly = true
public_deps = [ ":fidl-fuchsia-posix-socket-ext-tests" ]
}