| # Copyright 2024 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. |
| |
| load( |
| "@fuchsia_sdk//fuchsia:defs.bzl", |
| "fuchsia_cc_test", |
| "fuchsia_unittest_package", |
| ) |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| cc_library( |
| name = "definitions", |
| deps = [ |
| "//src/connectivity/bluetooth/core/bt-host:public", |
| "//src/connectivity/bluetooth/core/bt-host/hci-spec", |
| "//src/connectivity/bluetooth/core/bt-host/sm:definitions", |
| ], |
| ) |
| |
| cc_library( |
| name = "l2cap", |
| srcs = [ |
| "a2dp_offload_manager.cc", |
| "basic_mode_rx_engine.cc", |
| "basic_mode_tx_engine.cc", |
| "bredr_command_handler.cc", |
| "bredr_dynamic_channel.cc", |
| "bredr_signaling_channel.cc", |
| "channel.cc", |
| "channel_configuration.cc", |
| "channel_manager.cc", |
| "command_handler.cc", |
| "credit_based_flow_control_rx_engine.cc", |
| "dynamic_channel.cc", |
| "dynamic_channel_registry.cc", |
| "enhanced_retransmission_mode_engines.cc", |
| "enhanced_retransmission_mode_rx_engine.cc", |
| "enhanced_retransmission_mode_tx_engine.cc", |
| "fcs.cc", |
| "fragmenter.cc", |
| "le_signaling_channel.cc", |
| "logical_link.cc", |
| "low_energy_command_handler.cc", |
| "pdu.cc", |
| "recombiner.cc", |
| "scoped_channel.cc", |
| "signaling_channel.cc", |
| "types.cc", |
| ], |
| deps = [ |
| ":definitions", |
| "//src/connectivity/bluetooth/core/bt-host:public", |
| "//src/connectivity/bluetooth/core/bt-host/hci", |
| "//src/connectivity/bluetooth/core/bt-host/transport", |
| "@pigweed//pw_bluetooth:emboss_l2cap_frames", |
| "@pigweed//pw_string", |
| "@pigweed//third_party/fuchsia:fit", |
| ], |
| ) |
| |
| cc_library( |
| name = "channel_manager_mock_controller_test_fixture", |
| testonly = True, |
| # Header is in bt-host:public |
| deps = [ |
| ":l2cap", |
| ":testing", |
| "//src/connectivity/bluetooth/core/bt-host:public", |
| "//src/connectivity/bluetooth/core/bt-host/hci", |
| "//src/connectivity/bluetooth/core/bt-host/testing", |
| ], |
| ) |
| |
| cc_library( |
| name = "testing", |
| testonly = True, |
| srcs = [ |
| "fake_channel.cc", |
| "fake_channel_test.cc", |
| "fake_l2cap.cc", |
| "fake_signaling_channel.cc", |
| "mock_channel_test.cc", |
| "test_packets.cc", |
| ], |
| deps = [ |
| ":l2cap", |
| "//src/connectivity/bluetooth/core/bt-host:public", |
| "//src/connectivity/bluetooth/core/bt-host/common", |
| "//src/connectivity/bluetooth/core/bt-host/hci", |
| "//src/connectivity/bluetooth/core/bt-host/testing:test_helpers", |
| "@pigweed//pw_async:fake_dispatcher_fixture", |
| "@pigweed//pw_async:heap_dispatcher", |
| "@pigweed//pw_bluetooth", |
| "@pigweed//pw_unit_test", |
| ], |
| ) |
| |
| fuchsia_cc_test( |
| name = "l2cap_test", |
| testonly = True, |
| srcs = [ |
| "a2dp_offload_manager_test.cc", |
| "basic_mode_rx_engine_test.cc", |
| "basic_mode_tx_engine_test.cc", |
| "bredr_command_handler_test.cc", |
| "bredr_dynamic_channel_test.cc", |
| "bredr_signaling_channel_test.cc", |
| "channel_configuration_test.cc", |
| "channel_manager_test.cc", |
| "channel_test.cc", |
| "command_handler_test.cc", |
| "credit_based_flow_control_rx_engine_test.cc", |
| "dynamic_channel_registry_test.cc", |
| "enhanced_retransmission_mode_engines_test.cc", |
| "enhanced_retransmission_mode_rx_engine_test.cc", |
| "enhanced_retransmission_mode_tx_engine_test.cc", |
| "fcs_test.cc", |
| "fragmenter_test.cc", |
| "frame_headers_test.cc", |
| "le_signaling_channel_test.cc", |
| "logical_link_test.cc", |
| "low_energy_command_handler_test.cc", |
| "pdu_test.cc", |
| "recombiner_test.cc", |
| "scoped_channel_test.cc", |
| "signaling_channel_test.cc", |
| "types_test.cc", |
| ], |
| death_unittest = True, |
| visibility = ["//visibility:public"], |
| deps = [ |
| ":channel_manager_mock_controller_test_fixture", |
| ":l2cap", |
| ":testing", |
| "//src/connectivity/bluetooth/core/bt-host/hci", |
| "//src/connectivity/bluetooth/core/bt-host/hci:testing", |
| "//src/connectivity/bluetooth/core/bt-host/testing", |
| "//src/connectivity/bluetooth/core/bt-host/testing:gtest_main", |
| "//src/connectivity/bluetooth/core/bt-host/transport:testing", |
| "@pigweed//pw_async:fake_dispatcher_fixture", |
| ], |
| ) |
| |
| fuchsia_unittest_package( |
| name = "test_pkg", |
| package_name = "l2cap_tests", |
| testonly = True, |
| fuchsia_api_level = "HEAD", |
| unit_tests = [ |
| ":l2cap_test", |
| ], |
| visibility = ["//visibility:public"], |
| ) |