• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/test.gni")
15import("../../../../dsoftbus.gni")
16
17module_output_path = "dsoftbus/connection"
18dsoftbus_root_path = "../../../.."
19
20config("softbus_connection_ble_test_config") {
21  include_dirs = [
22    "$dsoftbus_dfx_path/interface/include",
23    "$dsoftbus_root_path/tests/core/connection/ble/mock",
24    "$dsoftbus_root_path/interfaces/kits/common",
25    "$dsoftbus_root_path/interfaces/kits/discovery",
26    "$dsoftbus_root_path/interfaces/kits/bus_center",
27    "$softbus_adapter_common/include",
28    "$softbus_adapter_common/net/bluetooth/include",
29    "$dsoftbus_root_path/core/common/include",
30    "$dsoftbus_root_path/core/connection/interface",
31    "$dsoftbus_root_path/core/connection/manager",
32    "$dsoftbus_root_path/core/connection/tcp/include",
33    "$dsoftbus_root_path/core/connection/ble/include",
34    "$dsoftbus_root_path/core/connection/br/include",
35    "$dsoftbus_root_path/core/adapter/br/include",
36    "$dsoftbus_root_path/core/connection/ble/channel",
37    "$dsoftbus_root_path/core/connection/ble/src",
38    "$dsoftbus_root_path/core/bus_center/interface",
39    "$dsoftbus_root_path/core/bus_center/service/include",
40    "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
41    "$dsoftbus_root_path/core/discovery/interface",
42    "$dsoftbus_root_path/core/discovery/manager/include",
43    "$dsoftbus_root_path/adapter/common/bluetooth/include",
44    "$dsoftbus_root_path/core/bus_center/service/include",
45  ]
46}
47
48ohos_unittest("ConnectionBleTest") {
49  module_out_path = module_output_path
50
51  public_configs = [ ":softbus_connection_ble_test_config" ]
52  sources = [
53    "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_connection_mock.cpp",
54    "softbus_conn_ble_connection_test.cpp",
55  ]
56
57  deps = [
58    "$dsoftbus_root_path/adapter:softbus_adapter",
59    "$dsoftbus_root_path/core/common:softbus_utils",
60    "$dsoftbus_root_path/core/frame:softbus_server",
61  ]
62
63  external_deps = [
64    "bluetooth:btframework",
65    "bounds_checking_function:libsec_shared",
66    "c_utils:utils",
67    "googletest:gmock_main",
68    "hilog:libhilog",
69  ]
70}
71
72ohos_unittest("ConnectionBleSwitchTest") {
73  module_out_path = module_output_path
74  public_configs = [ ":softbus_connection_ble_test_config" ]
75  sources = [ "softbus_conn_ble_switch_test.cpp" ]
76
77  deps = [
78    "$dsoftbus_root_path/adapter:softbus_adapter",
79    "$dsoftbus_root_path/core/common:softbus_utils",
80    "$dsoftbus_root_path/core/frame:softbus_server",
81  ]
82
83  external_deps = [
84    "bluetooth:btframework",
85    "bounds_checking_function:libsec_shared",
86    "c_utils:utils",
87    "googletest:gmock_main",
88    "hilog:libhilog",
89  ]
90}
91
92ohos_unittest("BleConnectionServiceTest") {
93  module_out_path = module_output_path
94  public_configs = [ ":softbus_connection_ble_test_config" ]
95  sources = [
96    "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_connection_mock.cpp",
97    "softbus_conn_server_test.cpp",
98  ]
99
100  deps = [
101    "$dsoftbus_root_path/adapter:softbus_adapter",
102    "$dsoftbus_root_path/core/common:softbus_utils",
103    "$dsoftbus_root_path/core/frame:softbus_server",
104  ]
105
106  external_deps = [
107    "bluetooth:btframework",
108    "bounds_checking_function:libsec_shared",
109    "c_utils:utils",
110    "googletest:gmock_main",
111    "hilog:libhilog",
112  ]
113}
114
115ohos_unittest("BleConnectionManagerTest") {
116  module_out_path = module_output_path
117  include_dirs = [
118    "$dsoftbus_root_path/core/connection/ble/include",
119    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
120  ]
121  public_configs = [ ":softbus_connection_ble_test_config" ]
122  sources = [
123    "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c",
124    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c",
125    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_snapshot.c",
126    "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c",
127    "$dsoftbus_root_path/core/connection/manager/softbus_conn_manager.c",
128    "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_manager_mock.cpp",
129    "softbus_conn_ble_manager_test.cpp",
130  ]
131
132  deps = [
133    "$dsoftbus_root_path/adapter:softbus_adapter",
134    "$dsoftbus_root_path/core/common:softbus_utils",
135  ]
136
137  external_deps = [
138    "bluetooth:btframework",
139    "bounds_checking_function:libsec_shared",
140    "c_utils:utils",
141    "googletest:gmock_main",
142    "hilog:libhilog",
143  ]
144}
145
146ohos_unittest("BleTransTest") {
147  module_out_path = module_output_path
148  include_dirs = [
149    "$softbus_adapter_common/include",
150    "$dsoftbus_dfx_path/interface/include",
151    "$dsoftbus_root_path/core/connection/ble/include",
152    "$dsoftbus_root_path/core/connection/common/include",
153    "$dsoftbus_root_path/core/common/include",
154    "$dsoftbus_root_path/core/connection/manager",
155    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
156    "$dsoftbus_root_path/adapter/common/include",
157    "$dsoftbus_root_path/tests/core/connection/ble/mock",
158  ]
159  sources = [
160    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_send_queue.c",
161    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_trans.c",
162    "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c",
163    "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_trans_mock.cpp",
164    "softbus_conn_ble_trans_test.cpp",
165  ]
166
167  deps = [
168    "$dsoftbus_root_path/adapter:softbus_adapter",
169    "$dsoftbus_root_path/core/common:softbus_utils",
170  ]
171
172  external_deps = [
173    "bluetooth:btframework",
174    "bounds_checking_function:libsec_shared",
175    "c_utils:utils",
176    "googletest:gmock_main",
177    "hilog:libhilog",
178  ]
179}
180
181ohos_unittest("BleClientTest") {
182  module_out_path = module_output_path
183  include_dirs = [
184    "$dsoftbus_dfx_path/interface/include",
185    "$dsoftbus_root_path/core/connection/ble/include",
186    "$dsoftbus_root_path/core/connection/common/include",
187    "$dsoftbus_root_path/core/common/include",
188    "$dsoftbus_root_path/core/common/net/bluetooth/include",
189    "$dsoftbus_root_path/core/connection/manager",
190    "$dsoftbus_root_path/core/discovery/manager/include",
191    "$dsoftbus_root_path/core/discovery/interface",
192    "$dsoftbus_root_path/core/bus_center/service/include",
193    "$dsoftbus_root_path/core/bus_center/interface",
194    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
195    "$dsoftbus_root_path/adapter/common/include",
196    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
197    "$dsoftbus_root_path/interfaces/kits/bus_center",
198    "$dsoftbus_root_path/interfaces/kits/discovery",
199    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
200    "$dsoftbus_root_path/tests/core/connection/ble/mock",
201  ]
202  sources = [
203    "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c",
204    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_client.c",
205    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c",
206    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_manager.c",
207    "./mock/softbus_conn_ble_client_mock.cpp",
208    "softbus_conn_client_test.cpp",
209  ]
210
211  deps = [
212    "$dsoftbus_root_path/adapter:softbus_adapter",
213    "$dsoftbus_root_path/core/common:softbus_utils",
214  ]
215
216  external_deps = [
217    "bluetooth:btframework",
218    "bounds_checking_function:libsec_shared",
219    "c_utils:utils",
220    "googletest:gmock_main",
221    "hilog:libhilog",
222  ]
223}
224
225ohos_unittest("BleHidumperTest") {
226  module_out_path = module_output_path
227  include_dirs = [
228    "$dsoftbus_dfx_path/interface/include",
229    "$dsoftbus_root_path/core/connection/ble/include",
230    "$dsoftbus_root_path/core/connection/common/include",
231    "$dsoftbus_root_path/core/common/include",
232    "$dsoftbus_root_path/core/common/net/bluetooth/include",
233    "$dsoftbus_root_path/core/connection/manager",
234    "$dsoftbus_root_path/core/discovery/manager/include",
235    "$dsoftbus_root_path/core/discovery/interface",
236    "$dsoftbus_root_path/core/bus_center/service/include",
237    "$dsoftbus_root_path/core/bus_center/interface",
238    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
239    "$dsoftbus_root_path/adapter/common/include",
240    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
241    "$dsoftbus_root_path/interfaces/kits/bus_center",
242    "$dsoftbus_root_path/interfaces/kits/discovery",
243    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
244    "$dsoftbus_root_path/tests/core/connection/ble/mock",
245  ]
246
247  public_configs = [ ":softbus_connection_ble_test_config" ]
248
249  sources = [
250    "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c",
251    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c",
252    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_manager.c",
253    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_snapshot.c",
254    "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c",
255    "$dsoftbus_root_path/core/connection/manager/softbus_conn_manager.c",
256    "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_manager_mock.cpp",
257    "connection_ble_hidumper_test.cpp",
258  ]
259
260  deps = [
261    "$dsoftbus_dfx_path:softbus_dfx",
262    "$dsoftbus_dfx_path/dumper/legacy:softbus_dfx_dump",
263    "$dsoftbus_root_path/adapter:softbus_adapter",
264    "$dsoftbus_root_path/core/common:softbus_utils",
265  ]
266
267  external_deps = [
268    "bluetooth:btframework",
269    "bounds_checking_function:libsec_shared",
270    "cJSON:cjson",
271    "c_utils:utils",
272    "c_utils:utils",
273    "googletest:gmock_main",
274    "hilog:libhilog",
275  ]
276}
277