| # Copyright 2026 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("uart_fpl") { |
| edition = "2024" |
| with_unit_tests = true |
| |
| sources = [ |
| "src/error.rs", |
| "src/frame.rs", |
| "src/handshake.rs", |
| "src/lib.rs", |
| "src/parser.rs", |
| "src/resend_sp.rs", |
| "src/window.rs", |
| ] |
| deps = [ |
| "//third_party/rust_crates:crc32fast", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:zerocopy", |
| ] |
| test_deps = [ "//src/lib/fuchsia" ] |
| } |
| |
| fuchsia_unittest_package("uart-fpl-target-tests") { |
| deps = [ ":uart_fpl_test" ] |
| test_specs = { |
| # Unit tests validate panic conditions for invalid ResendSender arguments |
| # (zero window size, excessive window size, zero max attempts) via |
| # #[should_panic]. |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":uart_fpl_test($host_toolchain)" ] |
| if (is_fuchsia) { |
| deps += [ ":uart-fpl-target-tests" ] |
| } |
| } |