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_root_path/tests/core/connection/ble/mock",
23    "$dsoftbus_root_path/interfaces/kits/common",
24    "$dsoftbus_root_path/interfaces/kits/discovery",
25    "$dsoftbus_root_path/interfaces/kits/bus_center",
26    "$softbus_adapter_common/include",
27    "$softbus_adapter_common/net/bluetooth/include",
28    "$dsoftbus_root_path/core/common/include",
29    "$dsoftbus_root_path/core/common/dfx/interface/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    "//third_party/googletest/googletest/include",
45    "//third_party/googletest/googletest/src",
46    "//third_party/bounds_checking_function/include",
47    "$dsoftbus_root_path/core/bus_center/service/include",
48    "//foundation/communication/bluetooth/interfaces/inner_api/include",
49    "//foundation/communication/bluetooth/interfaces/inner_api/include/c_header",
50  ]
51}
52
53ohos_unittest("ConnectionBleTest") {
54  module_out_path = module_output_path
55
56  public_configs = [ ":softbus_connection_ble_test_config" ]
57  sources = [
58    "$dsoftbus_root_path/tests/core/connection/ble/mock/connection_ble_mock.cpp",
59    "connection_ble_test.cpp",
60  ]
61
62  deps = [
63    "$dsoftbus_root_path/adapter:softbus_adapter",
64    "$dsoftbus_root_path/core/common:softbus_utils",
65    "$dsoftbus_root_path/core/frame:softbus_server",
66    "//third_party/bounds_checking_function:libsec_shared",
67    "//third_party/googletest:gmock_main",
68    "//third_party/googletest:gtest_main",
69  ]
70
71  external_deps = [
72    "c_utils:utils",
73    "hilog:libhilog",
74  ]
75}
76
77ohos_unittest("ConnectionBleSwitchTest") {
78  module_out_path = module_output_path
79  public_configs = [ ":softbus_connection_ble_test_config" ]
80  sources = [ "connection_ble_switch_test.cpp" ]
81
82  deps = [
83    "$dsoftbus_root_path/adapter:softbus_adapter",
84    "$dsoftbus_root_path/core/common:softbus_utils",
85    "$dsoftbus_root_path/core/frame:softbus_server",
86    "//third_party/bounds_checking_function:libsec_shared",
87    "//third_party/googletest:gmock_main",
88    "//third_party/googletest:gtest_main",
89  ]
90
91  external_deps = [
92    "c_utils:utils",
93    "hilog:libhilog",
94  ]
95}
96
97ohos_unittest("BleConnectionServiceTest") {
98  module_out_path = module_output_path
99  public_configs = [ ":softbus_connection_ble_test_config" ]
100  sources = [
101    "$dsoftbus_root_path/tests/core/connection/ble/mock/connection_ble_mock.cpp",
102    "ble_service_connection_test.cpp",
103  ]
104
105  deps = [
106    "$dsoftbus_root_path/adapter:softbus_adapter",
107    "$dsoftbus_root_path/core/common:softbus_utils",
108    "$dsoftbus_root_path/core/frame:softbus_server",
109    "//third_party/bounds_checking_function:libsec_shared",
110    "//third_party/googletest:gmock_main",
111    "//third_party/googletest:gtest_main",
112  ]
113
114  external_deps = [
115    "c_utils:utils",
116    "hilog:libhilog",
117  ]
118}
119
120ohos_unittest("BleConnectionManagerTest") {
121  module_out_path = module_output_path
122  include_dirs = [
123    "$dsoftbus_root_path/core/connection/ble/include",
124    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
125    "//foundation/communication/bluetooth/interfaces/inner_api/include",
126    "//foundation/communication/bluetooth/interfaces/inner_api/include/c_header",
127  ]
128  public_configs = [ ":softbus_connection_ble_test_config" ]
129  sources = [
130    "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c",
131    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c",
132    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_manager.c",
133    "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c",
134    "$dsoftbus_root_path/core/connection/manager/softbus_conn_manager.c",
135    "$dsoftbus_root_path/tests/core/connection/ble/mock/connection_ble_manager_mock.cpp",
136    "connection_ble_manager_test.cpp",
137  ]
138
139  deps = [
140    "$dsoftbus_root_path/adapter:softbus_adapter",
141    "$dsoftbus_root_path/core/common:softbus_utils",
142    "//third_party/bounds_checking_function:libsec_shared",
143    "//third_party/googletest:gmock_main",
144    "//third_party/googletest:gtest_main",
145  ]
146
147  external_deps = [
148    "c_utils:utils",
149    "hilog:libhilog",
150  ]
151}
152
153ohos_unittest("BleTransTest") {
154  module_out_path = module_output_path
155  include_dirs = [
156    "$softbus_adapter_common/include",
157    "$dsoftbus_root_path/core/common/dfx/interface/include",
158    "$dsoftbus_root_path/core/connection/ble/include",
159    "$dsoftbus_root_path/core/connection/common/include",
160    "$dsoftbus_root_path/core/common/include",
161    "$dsoftbus_root_path/core/connection/manager",
162    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
163    "$dsoftbus_root_path/adapter/common/include",
164    "$dsoftbus_root_path/tests/core/connection/ble/mock",
165  ]
166  sources = [
167    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_send_queue.c",
168    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_trans.c",
169    "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c",
170    "$dsoftbus_root_path/tests/core/connection/ble/mock/connection_ble_trans_mock.cpp",
171    "connection_ble_trans_test.cpp",
172  ]
173
174  deps = [
175    "$dsoftbus_root_path/adapter:softbus_adapter",
176    "$dsoftbus_root_path/core/common:softbus_utils",
177    "//third_party/bounds_checking_function:libsec_shared",
178    "//third_party/googletest:gmock_main",
179    "//third_party/googletest:gtest_main",
180  ]
181
182  external_deps = [
183    "c_utils:utils",
184    "hilog:libhilog",
185  ]
186}
187
188ohos_unittest("BleClientTest") {
189  module_out_path = module_output_path
190  include_dirs = [
191    "$dsoftbus_root_path/core/common/dfx/interface/include",
192    "$dsoftbus_root_path/core/connection/ble/include",
193    "$dsoftbus_root_path/core/connection/common/include",
194    "$dsoftbus_root_path/core/common/include",
195    "$dsoftbus_root_path/core/common/net/bluetooth/include",
196    "$dsoftbus_root_path/core/connection/manager",
197    "$dsoftbus_root_path/core/discovery/manager/include",
198    "$dsoftbus_root_path/core/discovery/interface",
199    "$dsoftbus_root_path/core/bus_center/service/include",
200    "$dsoftbus_root_path/core/bus_center/interface",
201    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
202    "$dsoftbus_root_path/adapter/common/include",
203    "$dsoftbus_root_path/interfaces/inner_kits/lnn",
204    "$dsoftbus_root_path/interfaces/kits/discovery",
205    "$dsoftbus_root_path/adapter/common/net/bluetooth/include",
206    "$dsoftbus_root_path/tests/core/connection/ble/mock",
207  ]
208  sources = [
209    "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c",
210    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_client.c",
211    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c",
212    "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_manager.c",
213    "./mock/connection_ble_client_mock.cpp",
214    "connection_ble_client_test.cpp",
215  ]
216
217  deps = [
218    "$dsoftbus_root_path/adapter:softbus_adapter",
219    "$dsoftbus_root_path/core/common:softbus_utils",
220    "//third_party/bounds_checking_function:libsec_shared",
221    "//third_party/googletest:gmock_main",
222    "//third_party/googletest:gtest_main",
223  ]
224
225  external_deps = [
226    "c_utils:utils",
227    "hilog:libhilog",
228  ]
229}
230