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_att = "../../public/pw_bluetooth_sapphire/internal/host/att" 19 20# Basic target with protocol definitions and no logic, suitable for test 21# emulation. 22pw_source_set("definitions") { 23 public = [ 24 "$dir_public_att/att.h", 25 "$dir_public_att/packet.h", 26 ] 27 28 sources = [ "packet.cc" ] 29 30 public_deps = [ 31 "$dir_pw_bluetooth_sapphire/host/common", 32 "$dir_pw_bluetooth_sapphire/host/hci-spec", 33 "$dir_pw_bluetooth_sapphire/host/l2cap:definitions", 34 ] 35} 36 37pw_source_set("att") { 38 public = [ 39 "$dir_public_att/attribute.h", 40 "$dir_public_att/bearer.h", 41 "$dir_public_att/database.h", 42 "$dir_public_att/error.h", 43 "$dir_public_att/permissions.h", 44 "$dir_public_att/write_queue.h", 45 ] 46 47 sources = [ 48 "attribute.cc", 49 "bearer.cc", 50 "database.cc", 51 "error.cc", 52 "permissions.cc", 53 "write_queue.cc", 54 ] 55 56 public_deps = [ 57 ":definitions", 58 "$dir_pw_bluetooth_sapphire/host/l2cap", 59 "$dir_pw_bluetooth_sapphire/host/sm:definitions", 60 "$dir_pw_third_party/fuchsia:fit", 61 ] 62 63 deps = [ 64 "$dir_pw_preprocessor", 65 "$dir_pw_string", 66 ] 67 68 public_configs = [ "$dir_pw_bluetooth_sapphire:public_include_path" ] 69} 70 71pw_test("tests") { 72 sources = [ 73 "attribute_test.cc", 74 "bearer_test.cc", 75 "database_test.cc", 76 "error_test.cc", 77 "permissions_test.cc", 78 ] 79 80 deps = [ 81 ":att", 82 "$dir_pw_bluetooth_sapphire/host/l2cap:testing", 83 ] 84 85 test_main = "$dir_pw_bluetooth_sapphire/host/testing:gtest_main" 86} 87