blob: 4eba0085dba4b4d3b723975d5b81c2fcc10134ee [file] [log] [blame]
# Copyright 2020 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")
import("//build/rust/rustc_library.gni")
rustc_library("tcp-stream-ext") {
name = "tcp_stream_ext"
edition = "2021"
version = "0.1.0"
with_unit_tests = true
deps = [
"//third_party/rust_crates:libc",
"//third_party/rust_crates:thiserror",
]
test_deps = [
"//third_party/rust_crates:proptest",
"//third_party/rust_crates:socket2",
]
sources = [ "src/lib.rs" ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
rustc_test("stub-netstack-test") {
name = "stub_netstack_test"
source_root = "src/stub_netstack_test.rs"
edition = "2021"
deps = [
":tcp-stream-ext",
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket_rust",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:futures",
]
sources = [ "src/stub_netstack_test.rs" ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_unittest_component("stub-netstack-test-component") {
component_name = "stub-netstack-test"
deps = [ ":stub-netstack-test" ]
}
fuchsia_unittest_component("tcp-stream-ext_test-component") {
component_name = "tcp-stream-ext_test"
deps = [
":tcp-stream-ext_test",
"//src/connectivity/network/netstack:component-debug",
]
manifest = "meta/tcp_stream_ext_lib_test.cml"
}
fuchsia_test_package("tcp-stream-ext-tests") {
test_components = [
":stub-netstack-test-component",
":tcp-stream-ext_test-component",
]
}
group("tests") {
testonly = true
deps = [ ":tcp-stream-ext-tests" ]
}