|  | # 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/rust/rustc_binary.gni") | 
|  | import("//build/rust/rustc_library.gni") | 
|  | import("//build/test/test_package.gni") | 
|  | import("//build/testing/environments.gni") | 
|  |  | 
|  | rustc_library("tcp-stream-ext") { | 
|  | name = "tcp_stream_ext" | 
|  | edition = "2018" | 
|  | 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:matches", | 
|  | "//third_party/rust_crates:proptest", | 
|  | "//third_party/rust_crates:socket2", | 
|  | ] | 
|  |  | 
|  | sources = [ "src/lib.rs" ] | 
|  | } | 
|  |  | 
|  | rustc_test("stub-netstack-test") { | 
|  | name = "stub_netstack_test" | 
|  | source_root = "src/stub_netstack_test.rs" | 
|  | edition = "2018" | 
|  | deps = [ | 
|  | ":tcp-stream-ext", | 
|  | "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", | 
|  | "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket-rustc", | 
|  | "//src/lib/fdio/rust:fdio", | 
|  | "//src/lib/fidl/rust/fidl", | 
|  | "//src/lib/fuchsia-async", | 
|  | "//src/lib/zircon/rust:fuchsia-zircon", | 
|  | "//third_party/rust_crates:futures", | 
|  | "//third_party/rust_crates:libc", | 
|  | "//third_party/rust_crates:matches", | 
|  | ] | 
|  |  | 
|  | sources = [ "src/stub_netstack_test.rs" ] | 
|  | } | 
|  |  | 
|  | test_package("tcp-stream-ext-tests") { | 
|  | deps = [ | 
|  | ":stub-netstack-test", | 
|  | ":tcp-stream-ext_test", | 
|  | ] | 
|  | tests = [ | 
|  | { | 
|  | name = "tcp_stream_ext_lib_test" | 
|  | environments = [ emu_env ] | 
|  | }, | 
|  | { | 
|  | name = "stub_netstack_test" | 
|  | environments = [ emu_env ] | 
|  | }, | 
|  | ] | 
|  | } | 
|  |  | 
|  | group("tests") { | 
|  | testonly = true | 
|  | deps = [ ":tcp-stream-ext-tests" ] | 
|  | } |