1# Copyright 2023 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15import("//build_overrides/pigweed.gni") 16import("$dir_pw_unit_test/test.gni") 17 18dir_public_hci = "../../public/pw_bluetooth_sapphire/internal/host/hci" 19 20pw_source_set("hci") { 21 public = [ 22 "$dir_public_hci/acl_connection.h", 23 "$dir_public_hci/advertising_report_parser.h", 24 "$dir_public_hci/android_extended_low_energy_advertiser.h", 25 "$dir_public_hci/bredr_connection.h", 26 "$dir_public_hci/bredr_connection_request.h", 27 "$dir_public_hci/command_handler.h", 28 "$dir_public_hci/connection.h", 29 "$dir_public_hci/extended_low_energy_advertiser.h", 30 "$dir_public_hci/legacy_low_energy_advertiser.h", 31 "$dir_public_hci/legacy_low_energy_scanner.h", 32 "$dir_public_hci/local_address_delegate.h", 33 "$dir_public_hci/low_energy_advertiser.h", 34 "$dir_public_hci/low_energy_connection.h", 35 "$dir_public_hci/low_energy_connector.h", 36 "$dir_public_hci/low_energy_scanner.h", 37 "$dir_public_hci/sco_connection.h", 38 "$dir_public_hci/sequential_command_runner.h", 39 "$dir_public_hci/util.h", 40 ] 41 42 sources = [ 43 "acl_connection.cc", 44 "advertising_handle_map.cc", 45 "advertising_report_parser.cc", 46 "android_extended_low_energy_advertiser.cc", 47 "bredr_connection.cc", 48 "bredr_connection_request.cc", 49 "connection.cc", 50 "extended_low_energy_advertiser.cc", 51 "legacy_low_energy_advertiser.cc", 52 "legacy_low_energy_scanner.cc", 53 "low_energy_advertiser.cc", 54 "low_energy_connection.cc", 55 "low_energy_connector.cc", 56 "low_energy_scanner.cc", 57 "sco_connection.cc", 58 "sequential_command_runner.cc", 59 "util.cc", 60 ] 61 62 public_deps = [ 63 "$dir_pw_async:heap_dispatcher", 64 "$dir_pw_bluetooth:emboss_hci_group", 65 "$dir_pw_bluetooth_sapphire/host/transport", 66 "$dir_pw_third_party/fuchsia:fit", 67 ] 68 69 public_configs = [ "$dir_pw_bluetooth_sapphire:public_include_path" ] 70} 71 72pw_source_set("testing") { 73 public = [ 74 "$dir_public_hci/fake_bredr_connection.h", 75 "$dir_public_hci/fake_local_address_delegate.h", 76 "$dir_public_hci/fake_low_energy_connection.h", 77 "$dir_public_hci/fake_sco_connection.h", 78 ] 79 80 sources = [ 81 "fake_bredr_connection.cc", 82 "fake_local_address_delegate.cc", 83 "fake_low_energy_connection.cc", 84 "fake_sco_connection.cc", 85 ] 86 87 deps = [ "$dir_pw_async:heap_dispatcher" ] 88 89 public_deps = [ ":hci" ] 90} 91 92pw_test("tests") { 93 sources = [ 94 "advertising_handle_map_test.cc", 95 "advertising_report_parser_test.cc", 96 "command_handler_test.cc", 97 "connection_test.cc", 98 "extended_low_energy_advertiser_test.cc", 99 "legacy_low_energy_advertiser_test.cc", 100 "low_energy_advertiser_test.cc", 101 "low_energy_connector_test.cc", 102 "low_energy_multiple_advertising_test.cc", 103 "low_energy_scanner_test.cc", 104 "sequential_command_runner_test.cc", 105 "util_test.cc", 106 ] 107 108 deps = [ 109 ":testing", 110 "$dir_pw_bluetooth:emboss_hci_test", 111 "$dir_pw_bluetooth_sapphire/host/testing", 112 ] 113 114 test_main = "$dir_pw_bluetooth_sapphire/host/testing:gtest_main" 115} 116