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