1# Copyright 2024 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 15load( 16 "@fuchsia_sdk//fuchsia:defs.bzl", 17 "fuchsia_cc_library", 18 "fuchsia_cc_test", 19 "fuchsia_unittest_package", 20) 21load("//pw_bluetooth_sapphire/fuchsia:fuchsia_api_level.bzl", "FUCHSIA_API_LEVEL") 22 23package(default_visibility = ["//visibility:public"]) 24 25fuchsia_cc_library( 26 name = "public", 27 hdrs = [ 28 "public/pw_bluetooth_sapphire/fuchsia/host/socket/socket_channel_relay.h", 29 "public/pw_bluetooth_sapphire/fuchsia/host/socket/socket_factory.h", 30 ], 31 strip_include_prefix = "public", 32) 33 34fuchsia_cc_library( 35 name = "socket", 36 deps = [ 37 ":public", 38 "//pw_bluetooth_sapphire/host/common", 39 "@fuchsia_sdk//pkg/async-default", 40 "@fuchsia_sdk//pkg/fit", 41 "@fuchsia_sdk//pkg/trace", 42 "@fuchsia_sdk//pkg/zx", 43 ], 44) 45 46fuchsia_cc_test( 47 name = "socket_test", 48 testonly = True, 49 srcs = [ 50 "socket_channel_relay_test.cc", 51 "socket_factory_l2cap_integration_test.cc", 52 "socket_factory_test.cc", 53 ], 54 death_unittest = True, 55 visibility = ["//visibility:public"], 56 deps = [ 57 ":socket", 58 "//pw_async_fuchsia:dispatcher", 59 "//pw_bluetooth_sapphire/host/gap", 60 "//pw_bluetooth_sapphire/host/l2cap:channel_manager_mock_controller_test_fixture", 61 "//pw_bluetooth_sapphire/host/l2cap:testing", 62 "//pw_bluetooth_sapphire/host/testing", 63 "//pw_bluetooth_sapphire/host/testing:gtest_main", 64 "//pw_bluetooth_sapphire/host/testing:loop_fixture", 65 "//pw_bluetooth_sapphire/host/transport:testing", 66 "@fuchsia_sdk//pkg/async-loop-cpp", 67 ], 68) 69 70fuchsia_unittest_package( 71 name = "test_pkg", 72 package_name = "socket_tests", 73 testonly = True, 74 fuchsia_api_level = FUCHSIA_API_LEVEL, 75 unit_tests = [ 76 ":socket_test", 77 ], 78 visibility = ["//visibility:public"], 79) 80