blob: b688bd666e9c0a9848f3de48ea21c3b61aacb770 [file] [log] [blame]
# 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/fuzzing/fuzzer.gni")
import("//src/connectivity/bluetooth/core/bt-host/build/bt_gtest_package.gni")
static_library("transport") {
sources = [
"acl_data_channel.cc",
"acl_data_channel.h",
"acl_data_packet.cc",
"acl_data_packet.h",
"command_channel.cc",
"command_channel.h",
"control_packets.cc",
"control_packets.h",
"data_buffer_info.h",
"device_wrapper.cc",
"device_wrapper.h",
"error.cc",
"error.h",
"hci_defs.h",
"hci_wrapper.cc",
"hci_wrapper.h",
"link_type.cc",
"link_type.h",
"packet.h",
"sco_data_channel.cc",
"sco_data_channel.h",
"sco_data_packet.cc",
"sco_data_packet.h",
"slab_allocators.h",
"transport.cc",
"transport.h",
]
public_deps = [
"//sdk/banjo/fuchsia.hardware.bt.hci:fuchsia.hardware.bt.hci_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.bt.vendor:fuchsia.hardware.bt.vendor_banjo_cpp",
"//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_c",
"//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_c_client",
"//sdk/lib/fdio",
"//sdk/lib/fit",
"//src/connectivity/bluetooth/core/bt-host/common",
"//src/connectivity/bluetooth/core/bt-host/hci-spec",
"//src/lib/ddk",
"//src/lib/files",
"//src/lib/fxl",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/trace:trace-driver",
]
# TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
public_configs = [ "//build/c:fidl-deprecated-c-bindings" ]
}
source_set("testing") {
testonly = true
sources = [
"fake_sco_data_channel.cc",
"fake_sco_data_channel.h",
"mock_acl_data_channel.h",
"mock_hci_wrapper.h",
]
public_deps = [ ":transport" ]
}
source_set("tests") {
testonly = true
sources = [
"acl_data_channel_unittest.cc",
"command_channel_unittest.cc",
"device_wrapper_unittest.cc",
"hci_wrapper_unittest.cc",
"packet_unittest.cc",
"sco_data_channel_unittest.cc",
"sco_data_packet_unittest.cc",
"slab_allocators_unittest.cc",
"transport_unittest.cc",
]
deps = [
":transport",
"//sdk/lib/inspect/testing/cpp",
"//src/connectivity/bluetooth/core/bt-host/testing",
"//third_party/googletest:gtest",
]
# TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
bt_gtest_package("bt-host-transport-tests") {
with_death_tests = true
deps = [ ":tests" ]
}
fuzzer("hci_wrapper_rx_fuzzer") {
sources = [ "hci_wrapper_rx_fuzztest.cc" ]
deps = [
":transport",
"//src/connectivity/bluetooth/core/bt-host/testing:fuzztest_driver",
"//zircon/system/ulib/async-testing",
]
}