| # Copyright 2019 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("serial_link") { |
| with_unit_tests = true |
| edition = "2021" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.serial:fuchsia.hardware.serial-rustc", |
| "//sdk/fidl/fuchsia.overnet.protocol:fuchsia.overnet.protocol-rustc", |
| "//src/connectivity/overnet/lib/core", |
| "//src/connectivity/overnet/lib/stream_framer", |
| "//src/lib/fuchsia-async", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:base64", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:crc", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| if (is_fuchsia) { |
| deps += [] |
| } else { |
| deps += [ "//third_party/rust_crates:async-fs" ] |
| } |
| |
| sources = [ |
| "src/descriptor.rs", |
| "src/fragment_io.rs", |
| "src/lib.rs", |
| "src/lossy_text.rs", |
| "src/reassembler.rs", |
| "src/report_skipped.rs", |
| "src/run.rs", |
| "src/test_util.rs", |
| ] |
| inputs = [ |
| "//third_party/rust_crates/mirrors/quiche/quiche/examples/cert.crt", |
| "//third_party/rust_crates/mirrors/quiche/quiche/examples/cert.key", |
| "//third_party/rust_crates/mirrors/quiche/quiche/examples/rootca.crt", |
| "src/long_packet.bin", |
| ] |
| } |
| |
| fuchsia_unittest_package("overnet-serial-link-tests") { |
| manifest = "meta/serial_link_lib_test.cmx" |
| deps = [ |
| ":serial_link_test", |
| "//src/connectivity/overnet/overnetstack:certificates", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":overnet-serial-link-tests", |
| ":serial_link_test($host_toolchain)", |
| ] |
| } |