| # 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("lib") { |
| edition = "2021" |
| name = "mock_piconet_client" |
| testonly = true |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.component.test:fuchsia.component.test_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/cm_rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//src/sys/lib/cm_types", |
| "//third_party/rust_crates:assert_matches", |
| ] |
| |
| sources = [ "src/lib.rs" ] |
| |
| source_root = "src/lib.rs" |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_unittest_package("mock-piconet-client-tests") { |
| manifest = "meta/mock-piconet-client-tests.cml" |
| deps = [ |
| ":component", |
| ":lib_test", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| edition = "2021" |
| output_name = "mock_piconet_server" |
| with_unit_tests = true |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth_rust", |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//src/connectivity/bluetooth/lib/bt-rfcomm", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/lib/async-utils", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-sync", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:slab", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ "//third_party/rust_crates:assert_matches" ] |
| |
| sources = [ |
| "src/main.rs", |
| "src/peer/mod.rs", |
| "src/peer/search.rs", |
| "src/peer/service.rs", |
| "src/profile.rs", |
| "src/types.rs", |
| ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_component("component") { |
| component_name = "mock-piconet-server" |
| manifest = "meta/mock-piconet-server.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("mock-piconet-server") { |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_unittest_package("mock-piconet-server-tests") { |
| deps = [ ":bin_test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":mock-piconet-client-tests", |
| ":mock-piconet-server-tests", |
| |
| # Packages for components that are injected into the tests. |
| "//src/cobalt/bin/testing/mock_cobalt", |
| ] |
| } |