blob: e6b7e412189636e095778b6ecd59ebcb92519cd3 [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/fuzz.gni")
import("//build_overrides/pigweed.gni")
import("//src/connectivity/bluetooth/core/bt-host/build/bt_gtest_package.gni")
static_library("fidl") {
sources = [
"gatt2_client_server.cc",
"gatt2_client_server.h",
"gatt2_remote_service_server.cc",
"gatt2_remote_service_server.h",
"gatt2_server_ids.h",
"gatt2_server_server.cc",
"gatt2_server_server.h",
"gatt_client_server.cc",
"gatt_client_server.h",
"gatt_remote_service_server.cc",
"gatt_remote_service_server.h",
"gatt_server_server.cc",
"gatt_server_server.h",
"host_server.cc",
"host_server.h",
"low_energy_central_server.cc",
"low_energy_central_server.h",
"low_energy_connection_server.cc",
"low_energy_connection_server.h",
"low_energy_peripheral_server.cc",
"low_energy_peripheral_server.h",
"profile_server.cc",
"profile_server.h",
"server_base.h",
]
deps = [
"measure_tape:peer_hlcpp",
"measure_tape:read_by_type_result_hlcpp",
]
public_deps = [
":helpers",
"$dir_pw_intrusive_ptr",
"//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth_hlcpp",
"//sdk/fidl/fuchsia.bluetooth.gatt:fuchsia.bluetooth.gatt_hlcpp",
"//sdk/fidl/fuchsia.bluetooth.gatt2:fuchsia.bluetooth.gatt2_hlcpp",
"//sdk/fidl/fuchsia.bluetooth.host:fuchsia.bluetooth.host_hlcpp",
"//sdk/fidl/fuchsia.bluetooth.le:fuchsia.bluetooth.le_hlcpp",
"//sdk/lib/fit-promise",
"//src/connectivity/bluetooth/core/bt-host:stack",
"//src/connectivity/bluetooth/lib/fidl",
"//zircon/system/ulib/zx",
]
}
# Conversions between host FIDL and internal library types.
source_set("helpers") {
sources = [
"helpers.cc",
"helpers.h",
]
public_deps = [
"//sdk/fidl/fuchsia.bluetooth:fuchsia.bluetooth_hlcpp",
"//sdk/fidl/fuchsia.bluetooth.bredr:fuchsia.bluetooth.bredr_cpp",
"//sdk/fidl/fuchsia.bluetooth.gatt:fuchsia.bluetooth.gatt_hlcpp",
"//sdk/fidl/fuchsia.bluetooth.gatt2:fuchsia.bluetooth.gatt2_hlcpp",
"//sdk/fidl/fuchsia.bluetooth.host:fuchsia.bluetooth.host_hlcpp",
"//src/connectivity/bluetooth/core/bt-host/common",
"//src/connectivity/bluetooth/core/bt-host/gap",
"//src/connectivity/bluetooth/core/bt-host/gatt",
"//src/connectivity/bluetooth/core/bt-host/sdp",
]
}
source_set("adapter_test_fixture") {
testonly = true
sources = [
"adapter_test_fixture.cc",
"adapter_test_fixture.h",
]
public_deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_hlcpp",
"//src/connectivity/bluetooth/core/bt-host/gap",
"//src/connectivity/bluetooth/core/bt-host/gatt:testing",
"//src/connectivity/bluetooth/core/bt-host/l2cap:testing",
"//src/connectivity/bluetooth/core/bt-host/testing",
"//src/connectivity/bluetooth/core/bt-host/testing:fake_controller",
"//src/connectivity/bluetooth/core/bt-host/testing:loop_fixture",
"//third_party/pigweed/backends/pw_async_fuchsia:dispatcher",
]
}
source_set("fake_adapter_test_fixture") {
testonly = true
sources = [ "fake_adapter_test_fixture.h" ]
public_deps = [
"//src/connectivity/bluetooth/core/bt-host/gap",
"//src/connectivity/bluetooth/core/bt-host/gap:testing",
"//src/connectivity/bluetooth/core/bt-host/testing:loop_fixture",
"//third_party/googletest:gtest",
"//third_party/pigweed/backends/pw_async_fuchsia:dispatcher",
]
}
source_set("fake_gatt_test_fixture") {
testonly = true
sources = [
"fake_gatt_fixture.cc",
"fake_gatt_fixture.h",
]
public_deps = [
"//src/connectivity/bluetooth/core/bt-host/common",
"//src/connectivity/bluetooth/core/bt-host/gatt",
"//src/connectivity/bluetooth/core/bt-host/gatt:testing",
"//src/connectivity/bluetooth/core/bt-host/testing:loop_fixture",
"//third_party/pigweed/backends/pw_async_fuchsia:dispatcher",
]
}
source_set("fake_hci_test_fixture") {
testonly = true
sources = [ "fake_hci_server.h" ]
deps = [
"//src/connectivity/bluetooth/core/bt-host/iso",
"//src/connectivity/bluetooth/core/bt-host/transport:transport",
]
}
source_set("tests") {
testonly = true
sources = [
"gatt2_client_server_test.cc",
"gatt2_remote_service_server_test.cc",
"gatt2_server_server_test.cc",
"gatt_client_server_test.cc",
"gatt_remote_service_server_test.cc",
"helpers_test.cc",
"host_server_test.cc",
"low_energy_central_server_test.cc",
"low_energy_connection_server_test.cc",
"low_energy_peripheral_server_test.cc",
"profile_server_test.cc",
]
deps = [
":adapter_test_fixture",
":fake_adapter_test_fixture",
":fake_gatt_test_fixture",
":fidl",
"measure_tape:peer_hlcpp",
"//src/connectivity/bluetooth/core/bt-host/gap:testing",
"//src/connectivity/bluetooth/core/bt-host/gatt:testing",
"//src/connectivity/bluetooth/core/bt-host/testing",
"//src/connectivity/bluetooth/core/bt-host/testing:fake_controller",
"//src/connectivity/bluetooth/core/bt-host/testing:loop_fixture",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
bt_gtest_package("bt-host-fidl-tests") {
deps = [ ":tests" ]
with_death_tests = true
}
fuchsia_library_fuzzer("host_server_watch_peers_fuzzer") {
sources = [ "host_server_watch_peers_fuzztest.cc" ]
deps = [
":adapter_test_fixture",
"$dir_pw_random:fuzzer_generator",
"//src/connectivity/bluetooth/core/bt-host:sources",
"//src/connectivity/bluetooth/core/bt-host/testing:fuzzing",
"//src/connectivity/bluetooth/core/bt-host/testing:fuzztest_driver",
]
}