# 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") config("public_include_path") { include_dirs = [ "public" ] } pw_source_set("common") { sources = [ "advertising_data.cc", "bounded_inspect_list_node.cc", "byte_buffer.cc", "device_address.cc", "device_class.cc", "host_error.cc", "identifier.cc", "log.cc", "manufacturer_names.cc", "metrics.cc", "random.cc", "retire_log.cc", "slab_allocator.cc", "supplement_data.cc", "uuid.cc", ] public = [ "public/pw_bluetooth_sapphire/internal/host/common/advertising_data.h", "public/pw_bluetooth_sapphire/internal/host/common/bounded_inspect_list_node.h", "public/pw_bluetooth_sapphire/internal/host/common/byte_buffer.h", "public/pw_bluetooth_sapphire/internal/host/common/device_address.h", "public/pw_bluetooth_sapphire/internal/host/common/device_class.h", "public/pw_bluetooth_sapphire/internal/host/common/error.h", "public/pw_bluetooth_sapphire/internal/host/common/expiring_set.h", "public/pw_bluetooth_sapphire/internal/host/common/fake_inspect.h", "public/pw_bluetooth_sapphire/internal/host/common/host_error.h", "public/pw_bluetooth_sapphire/internal/host/common/identifier.h", "public/pw_bluetooth_sapphire/internal/host/common/inspect.h", "public/pw_bluetooth_sapphire/internal/host/common/inspectable.h", "public/pw_bluetooth_sapphire/internal/host/common/log.h", "public/pw_bluetooth_sapphire/internal/host/common/macros.h", "public/pw_bluetooth_sapphire/internal/host/common/manufacturer_names.h", "public/pw_bluetooth_sapphire/internal/host/common/metrics.h", "public/pw_bluetooth_sapphire/internal/host/common/packet_view.h", "public/pw_bluetooth_sapphire/internal/host/common/pipeline_monitor.h", "public/pw_bluetooth_sapphire/internal/host/common/random.h", "public/pw_bluetooth_sapphire/internal/host/common/retire_log.h", "public/pw_bluetooth_sapphire/internal/host/common/slab_allocator.h", "public/pw_bluetooth_sapphire/internal/host/common/slab_buffer.h", "public/pw_bluetooth_sapphire/internal/host/common/smart_task.h", "public/pw_bluetooth_sapphire/internal/host/common/supplement_data.h", "public/pw_bluetooth_sapphire/internal/host/common/to_string.h", "public/pw_bluetooth_sapphire/internal/host/common/trace.h", "public/pw_bluetooth_sapphire/internal/host/common/uint128.h", "public/pw_bluetooth_sapphire/internal/host/common/uint256.h", "public/pw_bluetooth_sapphire/internal/host/common/uuid.h", "public/pw_bluetooth_sapphire/internal/host/common/weak_self.h", "public/pw_bluetooth_sapphire/internal/host/common/windowed_inspect_numeric_property.h", ] public_configs = [ ":public_include_path" ] public_deps = [ "$dir_pw_async:dispatcher", "$dir_pw_async:task", "$dir_pw_bluetooth:emboss_hci_group", "$dir_pw_bluetooth_sapphire:config", "$dir_pw_bluetooth_sapphire/lib/cpp-string", "$dir_pw_bluetooth_sapphire/lib/cpp-type", "$dir_pw_chrono:system_clock", "$dir_pw_third_party/fuchsia:fit", dir_pw_assert, dir_pw_intrusive_ptr, dir_pw_log, dir_pw_preprocessor, dir_pw_random, dir_pw_span, ] if (current_os == "fuchsia") { public_deps += [ "//sdk/lib/sys/inspect/cpp", "//zircon/system/ulib/trace", ] } deps = [ "$dir_pw_string:utf_codecs", dir_pw_preprocessor, ] } pw_source_set("uuid_string_util") { sources = [ "uuid_string_util.cc" ] deps = [ ":common" ] } pw_test("common_test") { enable_if = pw_unit_test_BACKEND == "$dir_pw_unit_test:googletest" sources = [ "advertising_data_test.cc", "bounded_inspect_list_node_test.cc", "byte_buffer_test.cc", "device_address_test.cc", "device_class_test.cc", "error_test.cc", "expiring_set_test.cc", "identifier_test.cc", "inspectable_test.cc", "manufacturer_names_test.cc", "metrics_test.cc", "packet_view_test.cc", "pipeline_monitor_test.cc", "retire_log_test.cc", "slab_allocator_test.cc", "supplement_data_test.cc", "uuid_test.cc", "weak_self_test.cc", "windowed_inspect_numeric_property_test.cc", ] test_main = "$dir_pw_bluetooth_sapphire/host/testing:gtest_main" deps = [ ":common", ":uuid_string_util", "$dir_pw_async:fake_dispatcher_fixture", "$dir_pw_bluetooth_sapphire/host/testing", "$dir_pw_bluetooth_sapphire/host/testing:gtest_helpers", "$dir_pw_bluetooth_sapphire/host/testing:test_helpers", ] } pw_fuzzer("advertising_data_fuzzer") { sources = [ "advertising_data_fuzztest.cc" ] deps = [ ":common" ] } pw_test_group("tests") { tests = [ ":common_test", ":advertising_data_fuzzer_test", ] }