# Copyright 2023 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_pw_fuzzer/fuzzer.gni") import("$dir_pw_unit_test/test.gni") dir_public_gap = "../../public/pw_bluetooth_sapphire/internal/host/gap" pw_source_set("definitions") { public = [ "$dir_public_gap/gap.h" ] sources = [ "gap.cc" ] deps = [ "$dir_pw_bluetooth_sapphire/host/common" ] } pw_source_set("gap") { public = [ "$dir_public_gap/adapter.h", "$dir_public_gap/adapter_state.h", "$dir_public_gap/android_vendor_capabilities.h", "$dir_public_gap/bonding_data.h", "$dir_public_gap/bredr_connection.h", "$dir_public_gap/bredr_connection_manager.h", "$dir_public_gap/bredr_connection_request.h", "$dir_public_gap/bredr_discovery_manager.h", "$dir_public_gap/bredr_interrogator.h", "$dir_public_gap/discovery_filter.h", "$dir_public_gap/event_masks.h", "$dir_public_gap/generic_access_client.h", "$dir_public_gap/identity_resolving_list.h", "$dir_public_gap/low_energy_address_manager.h", "$dir_public_gap/low_energy_advertising_manager.h", "$dir_public_gap/low_energy_connection.h", "$dir_public_gap/low_energy_connection_handle.h", "$dir_public_gap/low_energy_connection_manager.h", "$dir_public_gap/low_energy_connection_request.h", "$dir_public_gap/low_energy_connector.h", "$dir_public_gap/low_energy_discovery_manager.h", "$dir_public_gap/low_energy_interrogator.h", "$dir_public_gap/low_energy_state.h", "$dir_public_gap/pairing_delegate.h", "$dir_public_gap/pairing_state.h", "$dir_public_gap/peer.h", "$dir_public_gap/peer_cache.h", "$dir_public_gap/peer_metrics.h", "$dir_public_gap/types.h", ] sources = [ "adapter.cc", "android_vendor_capabilities.cc", "bredr_connection.cc", "bredr_connection_manager.cc", "bredr_connection_request.cc", "bredr_discovery_manager.cc", "bredr_interrogator.cc", "discovery_filter.cc", "generic_access_client.cc", "identity_resolving_list.cc", "low_energy_address_manager.cc", "low_energy_advertising_manager.cc", "low_energy_connection.cc", "low_energy_connection_handle.cc", "low_energy_connection_manager.cc", "low_energy_connection_request.cc", "low_energy_connector.cc", "low_energy_discovery_manager.cc", "low_energy_interrogator.cc", "pairing_state.cc", "peer.cc", "peer_cache.cc", "peer_metrics.cc", "types.cc", ] public_deps = [ ":definitions", "$dir_pw_async:heap_dispatcher", "$dir_pw_bluetooth", "$dir_pw_bluetooth_sapphire/host/common", "$dir_pw_bluetooth_sapphire/host/gatt", "$dir_pw_bluetooth_sapphire/host/hci", "$dir_pw_bluetooth_sapphire/host/l2cap", "$dir_pw_bluetooth_sapphire/host/sco", "$dir_pw_bluetooth_sapphire/host/sdp", "$dir_pw_bluetooth_sapphire/host/sm", "$dir_pw_third_party/fuchsia:fit", ] public_configs = [ "$dir_pw_bluetooth_sapphire:public_include_path" ] } pw_source_set("testing") { testonly = pw_unit_test_TESTONLY public = [ "$dir_public_gap/fake_adapter.h", "$dir_public_gap/fake_pairing_delegate.h", ] sources = [ "fake_adapter.cc", "fake_pairing_delegate.cc", ] public_deps = [ ":gap", "$dir_pw_bluetooth_sapphire/host/l2cap:testing", "$dir_pw_unit_test", ] } pw_test("gap_tests") { sources = [ "adapter_test.cc", "android_vendor_capabilities_test.cc", "bredr_connection_manager_test.cc", "bredr_connection_request_test.cc", "bredr_discovery_manager_test.cc", "bredr_interrogator_test.cc", "discovery_filter_test.cc", "fake_pairing_delegate_test.cc", "identity_resolving_list_test.cc", "low_energy_address_manager_test.cc", "low_energy_advertising_manager_test.cc", "low_energy_connection_manager_test.cc", "low_energy_discovery_manager_test.cc", "low_energy_interrogator_test.cc", "pairing_state_test.cc", "peer_cache_test.cc", "peer_test.cc", "types_test.cc", ] deps = [ ":gap", ":testing", "$dir_pw_bluetooth_sapphire/host/common", "$dir_pw_bluetooth_sapphire/host/gatt:testing", "$dir_pw_bluetooth_sapphire/host/hci:testing", "$dir_pw_bluetooth_sapphire/host/l2cap:testing", "$dir_pw_bluetooth_sapphire/host/sm:testing", "$dir_pw_bluetooth_sapphire/host/testing", ] test_main = "$dir_pw_bluetooth_sapphire/host/testing:gtest_main" } pw_fuzzer("peer_cache_fuzzer") { sources = [ "peer_cache_fuzztest.cc" ] deps = [ ":gap", "$dir_pw_async:fake_dispatcher", "$dir_pw_bluetooth_sapphire/host/testing:fuzzing", "$dir_pw_random:fuzzer_generator", ] } pw_test_group("tests") { tests = [ ":gap_tests", ":peer_cache_fuzzer_test", ] }