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_fuzzer/fuzzer.gni") 17import("$dir_pw_unit_test/test.gni") 18 19config("public_include_path") { 20 include_dirs = [ "public" ] 21} 22 23pw_source_set("common") { 24 sources = [ 25 "advertising_data.cc", 26 "bounded_inspect_list_node.cc", 27 "byte_buffer.cc", 28 "device_address.cc", 29 "device_class.cc", 30 "host_error.cc", 31 "identifier.cc", 32 "log.cc", 33 "manufacturer_names.cc", 34 "metrics.cc", 35 "random.cc", 36 "retire_log.cc", 37 "slab_allocator.cc", 38 "supplement_data.cc", 39 "uuid.cc", 40 ] 41 public = [ 42 "public/pw_bluetooth_sapphire/internal/host/common/advertising_data.h", 43 "public/pw_bluetooth_sapphire/internal/host/common/bounded_inspect_list_node.h", 44 "public/pw_bluetooth_sapphire/internal/host/common/byte_buffer.h", 45 "public/pw_bluetooth_sapphire/internal/host/common/device_address.h", 46 "public/pw_bluetooth_sapphire/internal/host/common/device_class.h", 47 "public/pw_bluetooth_sapphire/internal/host/common/error.h", 48 "public/pw_bluetooth_sapphire/internal/host/common/expiring_set.h", 49 "public/pw_bluetooth_sapphire/internal/host/common/fake_inspect.h", 50 "public/pw_bluetooth_sapphire/internal/host/common/host_error.h", 51 "public/pw_bluetooth_sapphire/internal/host/common/identifier.h", 52 "public/pw_bluetooth_sapphire/internal/host/common/inspect.h", 53 "public/pw_bluetooth_sapphire/internal/host/common/inspectable.h", 54 "public/pw_bluetooth_sapphire/internal/host/common/log.h", 55 "public/pw_bluetooth_sapphire/internal/host/common/macros.h", 56 "public/pw_bluetooth_sapphire/internal/host/common/manufacturer_names.h", 57 "public/pw_bluetooth_sapphire/internal/host/common/metrics.h", 58 "public/pw_bluetooth_sapphire/internal/host/common/packet_view.h", 59 "public/pw_bluetooth_sapphire/internal/host/common/pipeline_monitor.h", 60 "public/pw_bluetooth_sapphire/internal/host/common/random.h", 61 "public/pw_bluetooth_sapphire/internal/host/common/retire_log.h", 62 "public/pw_bluetooth_sapphire/internal/host/common/slab_allocator.h", 63 "public/pw_bluetooth_sapphire/internal/host/common/slab_buffer.h", 64 "public/pw_bluetooth_sapphire/internal/host/common/smart_task.h", 65 "public/pw_bluetooth_sapphire/internal/host/common/supplement_data.h", 66 "public/pw_bluetooth_sapphire/internal/host/common/to_string.h", 67 "public/pw_bluetooth_sapphire/internal/host/common/trace.h", 68 "public/pw_bluetooth_sapphire/internal/host/common/uint128.h", 69 "public/pw_bluetooth_sapphire/internal/host/common/uint256.h", 70 "public/pw_bluetooth_sapphire/internal/host/common/uuid.h", 71 "public/pw_bluetooth_sapphire/internal/host/common/weak_self.h", 72 "public/pw_bluetooth_sapphire/internal/host/common/windowed_inspect_numeric_property.h", 73 ] 74 public_configs = [ ":public_include_path" ] 75 public_deps = [ 76 "$dir_pw_async:dispatcher", 77 "$dir_pw_async:task", 78 "$dir_pw_bluetooth:emboss_hci_group", 79 "$dir_pw_bluetooth_sapphire:config", 80 "$dir_pw_bluetooth_sapphire/lib/cpp-string", 81 "$dir_pw_bluetooth_sapphire/lib/cpp-type", 82 "$dir_pw_chrono:system_clock", 83 "$dir_pw_third_party/fuchsia:fit", 84 dir_pw_assert, 85 dir_pw_intrusive_ptr, 86 dir_pw_log, 87 dir_pw_preprocessor, 88 dir_pw_random, 89 dir_pw_span, 90 ] 91 if (current_os == "fuchsia") { 92 public_deps += [ 93 "//sdk/lib/sys/inspect/cpp", 94 "//zircon/system/ulib/trace", 95 ] 96 } 97 deps = [ 98 "$dir_pw_string:utf_codecs", 99 dir_pw_preprocessor, 100 ] 101} 102 103pw_source_set("uuid_string_util") { 104 sources = [ "uuid_string_util.cc" ] 105 deps = [ ":common" ] 106} 107 108pw_test("common_test") { 109 enable_if = pw_unit_test_BACKEND == "$dir_pw_unit_test:googletest" 110 sources = [ 111 "advertising_data_test.cc", 112 "bounded_inspect_list_node_test.cc", 113 "byte_buffer_test.cc", 114 "device_address_test.cc", 115 "device_class_test.cc", 116 "error_test.cc", 117 "expiring_set_test.cc", 118 "identifier_test.cc", 119 "inspectable_test.cc", 120 "manufacturer_names_test.cc", 121 "metrics_test.cc", 122 "packet_view_test.cc", 123 "pipeline_monitor_test.cc", 124 "retire_log_test.cc", 125 "slab_allocator_test.cc", 126 "supplement_data_test.cc", 127 "uuid_test.cc", 128 "weak_self_test.cc", 129 "windowed_inspect_numeric_property_test.cc", 130 ] 131 test_main = "$dir_pw_bluetooth_sapphire/host/testing:gtest_main" 132 deps = [ 133 ":common", 134 ":uuid_string_util", 135 "$dir_pw_async:fake_dispatcher_fixture", 136 "$dir_pw_bluetooth_sapphire/host/testing", 137 "$dir_pw_bluetooth_sapphire/host/testing:gtest_helpers", 138 "$dir_pw_bluetooth_sapphire/host/testing:test_helpers", 139 ] 140} 141 142pw_fuzzer("advertising_data_fuzzer") { 143 sources = [ "advertising_data_fuzztest.cc" ] 144 deps = [ ":common" ] 145} 146 147pw_test_group("tests") { 148 tests = [ 149 ":common_test", 150 ":advertising_data_fuzzer_test", 151 ] 152} 153