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