| # Copyright 2017 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/bazel/bazel_fuchsia_test_package.gni") |
| import("//build/fuzz.gni") |
| 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 = [ "//src/connectivity/bluetooth/core/bt-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_third_party/fuchsia:fit", |
| "//src/connectivity/bluetooth/core/bt-host/common", |
| "//src/connectivity/bluetooth/core/bt-host/gatt", |
| "//src/connectivity/bluetooth/core/bt-host/hci", |
| "//src/connectivity/bluetooth/core/bt-host/iso", |
| "//src/connectivity/bluetooth/core/bt-host/l2cap", |
| "//src/connectivity/bluetooth/core/bt-host/sco", |
| "//src/connectivity/bluetooth/core/bt-host/sdp", |
| "//src/connectivity/bluetooth/core/bt-host/sm", |
| ] |
| } |
| |
| pw_source_set("testing") { |
| testonly = true |
| |
| 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_unit_test", |
| "//src/connectivity/bluetooth/core/bt-host/l2cap:testing", |
| ] |
| } |
| |
| pw_test("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", |
| "//src/connectivity/bluetooth/core/bt-host/common", |
| "//src/connectivity/bluetooth/core/bt-host/gatt:testing", |
| "//src/connectivity/bluetooth/core/bt-host/hci:testing", |
| "//src/connectivity/bluetooth/core/bt-host/l2cap:testing", |
| "//src/connectivity/bluetooth/core/bt-host/sm:testing", |
| "//src/connectivity/bluetooth/core/bt-host/testing", |
| ] |
| |
| test_main = "//src/connectivity/bluetooth/core/bt-host/testing:gtest_main" |
| } |
| |
| fuchsia_library_fuzzer("peer_cache_fuzzer") { |
| sources = [ "peer_cache_fuzztest.cc" ] |
| deps = [ |
| ":gap", |
| "$dir_pw_async:fake_dispatcher", |
| "$dir_pw_random:fuzzer_generator", |
| "//src/connectivity/bluetooth/core/bt-host/testing:fuzzing", |
| "//src/connectivity/bluetooth/core/bt-host/testing:fuzztest_driver", |
| ] |
| } |
| |
| pw_fuzzer("pw_peer_cache_fuzzer") { |
| sources = [ "peer_cache_fuzztest.cc" ] |
| deps = [ |
| ":gap", |
| "$dir_pw_async:fake_dispatcher", |
| "$dir_pw_random:fuzzer_generator", |
| "//src/connectivity/bluetooth/core/bt-host/testing:fuzzing", |
| ] |
| } |
| |
| pw_test_group("tests_and_fuzzers") { |
| tests = [ |
| ":tests", |
| ":pw_peer_cache_fuzzer_test", |
| ] |
| } |
| |
| bazel_fuchsia_test_package("test_pkg") { |
| test_package_name = "gap_tests" |
| test_component_names = [ "gap_test_autogen_cml" ] |
| } |