blob: 7a35ae4b2fdc51c28819b2817297f3fe3877828b [file] [log] [blame] [edit]
# Copyright 2024 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
import("//build_overrides/pigweed.gni")
import("$dir_pigweed/third_party/emboss/emboss.gni")
import("$dir_pw_bloat/bloat.gni")
import("$dir_pw_build/target_types.gni")
import("$dir_pw_chrono/backend.gni")
import("$dir_pw_unit_test/test.gni")
config("public_include_path") {
include_dirs = [ "public" ]
visibility = [ ":*" ]
}
pw_test_group("tests") {
tests = [ ":pw_bluetooth_proxy_test" ]
}
pw_source_set("pw_bluetooth_proxy") {
public_configs = [ ":public_include_path" ]
# LINT.IfChange
public = [
"public/pw_bluetooth_proxy/basic_l2cap_channel.h",
"public/pw_bluetooth_proxy/channel_proxy.h",
"public/pw_bluetooth_proxy/direction.h",
"public/pw_bluetooth_proxy/gatt_notify_channel.h",
"public/pw_bluetooth_proxy/h4_packet.h",
"public/pw_bluetooth_proxy/internal/acl_data_channel.h",
"public/pw_bluetooth_proxy/internal/gatt_notify_channel_internal.h",
"public/pw_bluetooth_proxy/internal/h4_storage.h",
"public/pw_bluetooth_proxy/internal/hci_transport.h",
"public/pw_bluetooth_proxy/internal/l2cap_aclu_signaling_channel.h",
"public/pw_bluetooth_proxy/internal/l2cap_channel.h",
"public/pw_bluetooth_proxy/internal/l2cap_channel_manager.h",
"public/pw_bluetooth_proxy/internal/l2cap_coc_internal.h",
"public/pw_bluetooth_proxy/internal/l2cap_leu_signaling_channel.h",
"public/pw_bluetooth_proxy/internal/l2cap_signaling_channel.h",
"public/pw_bluetooth_proxy/internal/l2cap_status_tracker.h",
"public/pw_bluetooth_proxy/internal/locked_l2cap_channel.h",
"public/pw_bluetooth_proxy/internal/logical_transport.h",
"public/pw_bluetooth_proxy/internal/recombiner.h",
"public/pw_bluetooth_proxy/internal/rfcomm_fcs.h",
"public/pw_bluetooth_proxy/l2cap_channel_common.h",
"public/pw_bluetooth_proxy/l2cap_coc.h",
"public/pw_bluetooth_proxy/l2cap_status_delegate.h",
"public/pw_bluetooth_proxy/proxy_host.h",
"public/pw_bluetooth_proxy/rfcomm_channel.h",
"public/pw_bluetooth_proxy/single_channel_proxy.h",
]
# LINT.ThenChange(BUILD.bazel, CMakeLists.txt)
# LINT.IfChange
public_deps = [
"$dir_pw_allocator:best_fit",
"$dir_pw_allocator:synchronized_allocator",
"$dir_pw_bluetooth:emboss_att",
"$dir_pw_bluetooth:emboss_hci_commands",
"$dir_pw_bluetooth:emboss_hci_common",
"$dir_pw_bluetooth:emboss_hci_data",
"$dir_pw_bluetooth:emboss_hci_events",
"$dir_pw_bluetooth:emboss_hci_h4",
"$dir_pw_bluetooth:emboss_l2cap_frames",
"$dir_pw_bluetooth:emboss_rfcomm_frames",
"$dir_pw_bluetooth:emboss_util",
"$dir_pw_multibuf",
"$dir_pw_multibuf:simple_allocator",
"$dir_pw_span:cast",
"$dir_pw_sync:lock_annotations",
"$dir_pw_sync:mutex",
dir_pw_containers,
dir_pw_function,
dir_pw_log,
dir_pw_result,
dir_pw_span,
dir_pw_status,
]
deps = [ dir_pw_log ]
sources = [
"acl_data_channel.cc",
"basic_l2cap_channel.cc",
"channel_proxy.cc",
"gatt_notify_channel.cc",
"h4_storage.cc",
"l2cap_aclu_signaling_channel.cc",
"l2cap_channel.cc",
"l2cap_channel_manager.cc",
"l2cap_coc.cc",
"l2cap_leu_signaling_channel.cc",
"l2cap_signaling_channel.cc",
"l2cap_status_tracker.cc",
"proxy_host.cc",
"recombiner.cc",
"rfcomm_channel.cc",
"rfcomm_fcs.cc",
"single_channel_proxy.cc",
]
# LINT.ThenChange(Android.bp, BUILD.bazel, CMakeLists.txt)
}
pw_source_set("test_utils") {
# TODO: b/303282642 - Remove this testonly
testonly = pw_unit_test_TESTONLY
# LINT.IfChange
public = [ "pw_bluetooth_proxy_private/test_utils.h" ]
public_deps = [
":pw_bluetooth_proxy",
"$dir_pw_bluetooth:emboss_hci_commands",
"$dir_pw_bluetooth:emboss_hci_common",
"$dir_pw_bluetooth:emboss_hci_events",
"$dir_pw_bluetooth:emboss_hci_h4",
"$dir_pw_bluetooth:emboss_util",
"$dir_pw_multibuf:testing",
"$dir_pw_unit_test",
"$pw_external_fuchsia:stdcompat",
]
sources = [ "test_utils.cc" ]
# LINT.ThenChange(BUILD.bazel, CMakeLists.txt)
visibility = [ ":*" ]
}
pw_test("pw_bluetooth_proxy_test") {
enable_if =
dir_pw_third_party_emboss != "" && pw_chrono_SYSTEM_CLOCK_BACKEND != ""
include_dirs = [ "." ]
# LINT.IfChange
deps = [
":pw_bluetooth_proxy",
":test_utils",
"$dir_pw_bluetooth:emboss_att",
"$dir_pw_bluetooth:emboss_hci_commands",
"$dir_pw_bluetooth:emboss_hci_common",
"$dir_pw_bluetooth:emboss_hci_events",
"$dir_pw_bluetooth:emboss_hci_h4",
"$dir_pw_bluetooth:emboss_util",
"$dir_pw_multibuf",
"$pw_external_fuchsia:stdcompat",
]
sources = [
"channel_proxy_test.cc",
"gatt_notify_test.cc",
"h4_packet_test.cc",
"l2cap_coc_test.cc",
"proxy_host_test.cc",
"recombiner_test.cc",
"rfcomm_fcs_test.cc",
"rfcomm_test.cc",
"utils_test.cc",
]
# LINT.ThenChange(BUILD.bazel, CMakeLists.txt)
}