| # Copyright 2021 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_test.gni") |
| |
| rustc_test("bt_rfcomm_smoke_test_bin") { |
| output_name = "bt_rfcomm_smoke_test" |
| edition = "2021" |
| source_root = "src/bt_rfcomm_smoke_test.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.bluetooth.rfcomm.test:fuchsia.bluetooth.rfcomm.test_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//src/connectivity/bluetooth/testing/realmbuilder-mock-helpers", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/bt_rfcomm_smoke_test.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_test_component("bt-rfcomm-smoke-test-component") { |
| manifest = "meta/bt-rfcomm-smoke-test.cml" |
| deps = [ ":bt_rfcomm_smoke_test_bin" ] |
| } |
| |
| fuchsia_test_package("bt-rfcomm-smoke-test") { |
| test_components = [ ":bt-rfcomm-smoke-test-component" ] |
| deps = [ "//src/connectivity/bluetooth/profiles/bt-rfcomm:component" ] |
| } |
| |
| rustc_test("bt_avrcp_smoke_test_bin") { |
| output_name = "bt_avrcp_smoke_test" |
| edition = "2021" |
| source_root = "src/bt_avrcp_smoke_test.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth.avrcp:fuchsia.bluetooth.avrcp_rust", |
| "//sdk/fidl/fuchsia.bluetooth.avrcp.test:fuchsia.bluetooth.avrcp.test_rust", |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//src/connectivity/bluetooth/testing/realmbuilder-mock-helpers", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component-test", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/bt_avrcp_smoke_test.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_test_component("bt-avrcp-smoke-test-component") { |
| manifest = "meta/bt-avrcp-smoke-test.cml" |
| deps = [ ":bt_avrcp_smoke_test_bin" ] |
| } |
| |
| fuchsia_test_package("bt-avrcp-smoke-test") { |
| test_components = [ ":bt-avrcp-smoke-test-component" ] |
| deps = [ "//src/connectivity/bluetooth/profiles/bt-avrcp:component" ] |
| } |
| |
| rustc_test("bt_avrcp_target_smoke_test_bin") { |
| output_name = "bt_avrcp_target_smoke_test" |
| edition = "2021" |
| source_root = "src/bt_avrcp_target_smoke_test.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth.avrcp:fuchsia.bluetooth.avrcp_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/fidl/fuchsia.media.sessions2:fuchsia.media.sessions2_rust", |
| "//sdk/fidl/fuchsia.power.battery:fuchsia.power.battery_rust", |
| "//src/connectivity/bluetooth/fidl:component_rust", |
| "//src/connectivity/bluetooth/testing/realmbuilder-mock-helpers", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/bt_avrcp_target_smoke_test.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_test_component("bt-avrcp-target-smoke-test-component") { |
| manifest = "meta/bt-avrcp-target-smoke-test.cml" |
| deps = [ ":bt_avrcp_target_smoke_test_bin" ] |
| } |
| |
| fuchsia_test_package("bt-avrcp-target-smoke-test") { |
| test_components = [ ":bt-avrcp-target-smoke-test-component" ] |
| deps = [ "//src/connectivity/bluetooth/profiles/bt-avrcp-target:component" ] |
| } |
| |
| rustc_test("bt_hfp_audio_gateway_smoke_test_bin") { |
| output_name = "bt_hfp_audio_gateway_smoke_test" |
| edition = "2021" |
| source_root = "src/bt_hfp_audio_gateway_smoke_test.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.bluetooth.hfp:fuchsia.bluetooth.hfp_rust", |
| "//sdk/fidl/fuchsia.bluetooth.hfp.test:fuchsia.bluetooth.hfp.test_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/fidl/fuchsia.media:fuchsia.media_rust", |
| "//sdk/fidl/fuchsia.power.battery:fuchsia.power.battery_rust", |
| "//src/connectivity/bluetooth/lib/fuchsia-audio-dai", |
| "//src/connectivity/bluetooth/testing/realmbuilder-mock-helpers", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/bt_hfp_audio_gateway_smoke_test.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_test_component("bt-hfp-audio-gateway-smoke-test-component") { |
| manifest = "meta/bt-hfp-audio-gateway-smoke-test.cml" |
| deps = [ ":bt_hfp_audio_gateway_smoke_test_bin" ] |
| } |
| |
| fuchsia_test_package("bt-hfp-audio-gateway-smoke-test") { |
| test_components = [ ":bt-hfp-audio-gateway-smoke-test-component" ] |
| deps = [ |
| "//src/connectivity/bluetooth/profiles/bt-hfp-audio-gateway:component", |
| "//src/connectivity/bluetooth/profiles/bt-hfp-audio-gateway:default_config_values", |
| ] |
| |
| # The max severity is set to ERROR due to the HFP component's ERROR log message |
| # when the Profile service is dropped. In some test runs, the Profile service |
| # goes away before the HFP component terminates, resulting in the log. This does not |
| # indicate a bug and is expected behavior. |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| rustc_binary("bt_a2dp_topology_fake_bin") { |
| edition = "2021" |
| output_name = "bt_a2dp_topology_fake" |
| with_unit_tests = true |
| source_root = "src/bt_a2dp_topology_fake.rs" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth.a2dp:fuchsia.bluetooth.a2dp_rust", |
| "//sdk/fidl/fuchsia.bluetooth.avdtp.test:fuchsia.bluetooth.avdtp.test_rust", |
| "//sdk/fidl/fuchsia.bluetooth.avrcp:fuchsia.bluetooth.avrcp_rust", |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.bluetooth.internal.a2dp:fuchsia.bluetooth.internal.a2dp_rust", |
| "//sdk/fidl/fuchsia.media:fuchsia.media_rust", |
| "//sdk/fidl/fuchsia.media.sessions2:fuchsia.media.sessions2_rust", |
| "//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec_rust", |
| "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust", |
| "//sdk/fidl/fuchsia.power.battery:fuchsia.power.battery_rust", |
| "//sdk/fidl/fuchsia.settings:fuchsia.settings_rust", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_rust", |
| "//sdk/fidl/fuchsia.tracing.provider:fuchsia.tracing.provider_rust", |
| "//src/connectivity/bluetooth/fidl:component_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/bt_a2dp_topology_fake.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_component("bt-a2dp-topology-fake") { |
| testonly = true |
| manifest = "meta/bt-a2dp-topology-fake.cml" |
| deps = [ ":bt_a2dp_topology_fake_bin" ] |
| } |
| |
| rustc_test("bt_a2dp_smoke_test_bin") { |
| output_name = "bt_a2dp_smoke_test" |
| edition = "2021" |
| source_root = "src/bt_a2dp_smoke_test.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth.a2dp:fuchsia.bluetooth.a2dp_rust", |
| "//sdk/fidl/fuchsia.bluetooth.avdtp.test:fuchsia.bluetooth.avdtp.test_rust", |
| "//sdk/fidl/fuchsia.bluetooth.avrcp:fuchsia.bluetooth.avrcp_rust", |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.bluetooth.internal.a2dp:fuchsia.bluetooth.internal.a2dp_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/fidl/fuchsia.media:fuchsia.media_rust", |
| "//sdk/fidl/fuchsia.media.sessions2:fuchsia.media.sessions2_rust", |
| "//sdk/fidl/fuchsia.mediacodec:fuchsia.mediacodec_rust", |
| "//sdk/fidl/fuchsia.metrics:fuchsia.metrics_rust", |
| "//sdk/fidl/fuchsia.power.battery:fuchsia.power.battery_rust", |
| "//sdk/fidl/fuchsia.settings:fuchsia.settings_rust", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_rust", |
| "//sdk/fidl/fuchsia.tracing.provider:fuchsia.tracing.provider_rust", |
| "//src/connectivity/bluetooth/testing/realmbuilder-mock-helpers", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/bt_a2dp_smoke_test.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_test_component("bt-a2dp-smoke-test-component") { |
| manifest = "meta/bt-a2dp-smoke-test.cml" |
| deps = [ ":bt_a2dp_smoke_test_bin" ] |
| } |
| |
| fuchsia_test_package("bt-a2dp-smoke-test") { |
| test_components = [ ":bt-a2dp-smoke-test-component" ] |
| deps = [ |
| ":bt-a2dp-topology-fake", |
| |
| # The AVRCP-Target component is used by A2DP to provide the `Lifecycle` service. |
| "//src/connectivity/bluetooth/profiles/bt-avrcp-target:component", |
| ] |
| } |
| |
| rustc_test("bt_init_smoke_test_bin") { |
| output_name = "bt_init_smoke_test" |
| edition = "2021" |
| source_root = "src/bt_init_smoke_test.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.bluetooth.gatt:fuchsia.bluetooth.gatt_rust", |
| "//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le_rust", |
| "//sdk/fidl/fuchsia.bluetooth.rfcomm.test:fuchsia.bluetooth.rfcomm.test_rust", |
| "//sdk/fidl/fuchsia.bluetooth.snoop:fuchsia.bluetooth.snoop_rust", |
| "//sdk/fidl/fuchsia.bluetooth.sys:fuchsia.bluetooth.sys_rust", |
| "//sdk/fidl/fuchsia.component.decl:fuchsia.component.decl_rust", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash_rust", |
| "//src/connectivity/bluetooth/core/bt-gap:test-stash-secure", |
| "//src/connectivity/bluetooth/fidl:host_rust", |
| "//src/connectivity/bluetooth/hci/virtual:driver", |
| "//src/connectivity/bluetooth/lib/fuchsia-bluetooth", |
| "//src/connectivity/bluetooth/testing/realmbuilder-mock-helpers", |
| "//src/devices/bus/drivers/platform", |
| "//src/devices/misc/drivers/test", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//src/storage/lib/vfs/rust:vfs", |
| "//src/sys/lib/cm_rust", |
| "//src/sys/lib/cm_types", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/bt_init_smoke_test.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_component_manifest("test_bt_init_manifest") { |
| component_name = "test-bt-init" |
| manifest = "meta/test-bt-init.cml" |
| } |
| |
| fuchsia_structured_config_values("test-bt-init-config") { |
| cm_label = ":test_bt_init_manifest" |
| values = { |
| autostart_snoop = true |
| } |
| } |
| |
| fuchsia_component("test-bt-init") { |
| cm_label = ":test_bt_init_manifest" |
| deps = [ |
| "//src/connectivity/bluetooth/core/bt-gap:component", |
| "//src/connectivity/bluetooth/core/bt-init:bin", |
| "//src/connectivity/bluetooth/profiles/bt-rfcomm:component", |
| ] |
| } |
| |
| fuchsia_test_component("bt-init-smoke-test-component") { |
| manifest = "meta/bt-init-smoke-test.cml" |
| deps = [ ":bt_init_smoke_test_bin" ] |
| } |
| |
| fuchsia_test_package("bt-init-smoke-test") { |
| test_components = [ ":bt-init-smoke-test-component" ] |
| deps = [ |
| ":test-bt-init", |
| ":test-bt-init-config", |
| "//src/sys/stash:stash_secure_v2", |
| ] |
| } |
| |
| rustc_test("bt_gap_smoke_test_bin") { |
| output_name = "bt_gap_smoke_test" |
| edition = "2021" |
| source_root = "src/bt_gap_smoke_test.rs" |
| deps = [ |
| "//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_rust", |
| "//sdk/fidl/fuchsia.bluetooth.gatt:fuchsia.bluetooth.gatt_rust", |
| "//sdk/fidl/fuchsia.bluetooth.gatt2:fuchsia.bluetooth.gatt2_rust", |
| "//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le_rust", |
| "//sdk/fidl/fuchsia.bluetooth.sys:fuchsia.bluetooth.sys_rust", |
| "//sdk/fidl/fuchsia.device:fuchsia.device_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash_rust", |
| "//src/connectivity/bluetooth/testing/realmbuilder-mock-helpers", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-component-test", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| sources = [ "src/bt_gap_smoke_test.rs" ] |
| |
| configs -= [ "//build/config/rust/lints:allow_unused_results" ] |
| } |
| |
| fuchsia_test_component("bt-gap-smoke-test-component") { |
| manifest = "meta/bt-gap-smoke-test.cml" |
| deps = [ ":bt_gap_smoke_test_bin" ] |
| } |
| |
| fuchsia_test_package("bt-gap-smoke-test") { |
| test_components = [ ":bt-gap-smoke-test-component" ] |
| deps = [ |
| "//src/connectivity/bluetooth/core/bt-gap:component", |
| "//src/sys/stash:stash_secure_v2", |
| ] |
| } |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":bt-a2dp-smoke-test", |
| ":bt-avrcp-smoke-test", |
| ":bt-avrcp-target-smoke-test", |
| ":bt-gap-smoke-test", |
| ":bt-hfp-audio-gateway-smoke-test", |
| ":bt-init-smoke-test", |
| ":bt-rfcomm-smoke-test", |
| ] |
| } |