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/soft_bus/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 "$dsoftbus_root_path/interfaces/kits/lnn", 28 "$dsoftbus_root_path/interfaces/kits/connect", 29 "$dsoftbus_root_path/interfaces/kits/disc", 30 "$softbus_adapter_common/include", 31 "$softbus_adapter_common/net/bluetooth/include", 32 "$dsoftbus_root_path/core/common/include", 33 "$dsoftbus_root_path/core/connection/interface", 34 "$dsoftbus_root_path/core/connection/manager", 35 "$dsoftbus_root_path/core/connection/tcp/include", 36 "$dsoftbus_root_path/core/connection/ble/include", 37 "$dsoftbus_root_path/core/connection/br/include", 38 "$dsoftbus_root_path/core/adapter/br/include", 39 "$dsoftbus_root_path/core/connection/ble/channel", 40 "$dsoftbus_root_path/core/connection/ble/src", 41 "$dsoftbus_root_path/core/bus_center/interface", 42 "$dsoftbus_root_path/core/bus_center/service/include", 43 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 44 "$dsoftbus_root_path/core/discovery/interface", 45 "$dsoftbus_root_path/core/discovery/manager/include", 46 "$dsoftbus_root_path/adapter/common/bluetooth/include", 47 "$dsoftbus_root_path/core/bus_center/service/include", 48 "$dsoftbus_root_path/core/connection/sle/include", 49 ] 50} 51 52ohos_unittest("ConnectionBleTest") { 53 module_out_path = module_output_path 54 55 public_configs = [ ":softbus_connection_ble_test_config" ] 56 sources = [ 57 "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_connection_mock.cpp", 58 "softbus_conn_ble_connection_test.cpp", 59 ] 60 61 deps = [ 62 "$dsoftbus_root_path/adapter:softbus_adapter", 63 "$dsoftbus_root_path/core/common:softbus_utils", 64 "$dsoftbus_root_path/core/frame:softbus_server", 65 ] 66 67 external_deps = [ 68 "bluetooth:btframework", 69 "bounds_checking_function:libsec_shared", 70 "c_utils:utils", 71 "googletest:gmock_main", 72 "hilog:libhilog", 73 ] 74} 75 76ohos_unittest("ConnectionBleSwitchTest") { 77 module_out_path = module_output_path 78 public_configs = [ ":softbus_connection_ble_test_config" ] 79 sources = [ "softbus_conn_ble_switch_test.cpp" ] 80 81 deps = [ 82 "$dsoftbus_root_path/adapter:softbus_adapter", 83 "$dsoftbus_root_path/core/common:softbus_utils", 84 "$dsoftbus_root_path/core/frame:softbus_server", 85 ] 86 87 external_deps = [ 88 "bluetooth:btframework", 89 "bounds_checking_function:libsec_shared", 90 "c_utils:utils", 91 "googletest:gmock_main", 92 "hilog:libhilog", 93 ] 94} 95 96ohos_unittest("BleConnectionServiceTest") { 97 module_out_path = module_output_path 98 public_configs = [ ":softbus_connection_ble_test_config" ] 99 sources = [ 100 "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_connection_mock.cpp", 101 "softbus_conn_server_test.cpp", 102 ] 103 104 deps = [ 105 "$dsoftbus_root_path/adapter:softbus_adapter", 106 "$dsoftbus_root_path/core/common:softbus_utils", 107 "$dsoftbus_root_path/core/frame:softbus_server", 108 ] 109 110 external_deps = [ 111 "bluetooth:btframework", 112 "bounds_checking_function:libsec_shared", 113 "c_utils:utils", 114 "googletest:gmock_main", 115 "hilog:libhilog", 116 ] 117} 118 119ohos_unittest("BleConnectionManagerTest") { 120 module_out_path = module_output_path 121 include_dirs = [ 122 "$dsoftbus_root_path/core/connection/ble/include", 123 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 124 "$dsoftbus_root_path/core/connection/sle/include", 125 "$dsoftbus_root_path/interfaces/kits/connect", 126 "$dsoftbus_root_path/core/frame/init/include", 127 "$dsoftbus_root_path/adapter/default_config/spec_config", 128 "$dsoftbus_root_path/core/frame/common/include", 129 "$dsoftbus_root_path/core/connection/proxy", 130 ] 131 public_configs = [ ":softbus_connection_ble_test_config" ] 132 sources = [ 133 "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c", 134 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c", 135 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_snapshot.c", 136 "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c", 137 "$dsoftbus_root_path/core/connection/manager/softbus_conn_manager.c", 138 "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_manager_mock.cpp", 139 "$dsoftbus_root_path/core/frame/init/src/g_enhance_conn_func.c", 140 "$dsoftbus_root_path/core/frame/common/src/softbus_init_common.c", 141 "$dsoftbus_root_path/core/frame/init/src/g_enhance_conn_func_pack.c", 142 "softbus_conn_ble_manager_test.cpp", 143 ] 144 145 deps = [ 146 "$dsoftbus_root_path/adapter:softbus_adapter", 147 "$dsoftbus_root_path/core/common:softbus_utils", 148 "$dsoftbus_root_path/dfx:softbus_dfx", 149 "$dsoftbus_root_path/core/frame:softbus_server", 150 ] 151 152 external_deps = [ 153 "bluetooth:btframework", 154 "bounds_checking_function:libsec_shared", 155 "c_utils:utils", 156 "googletest:gmock_main", 157 "hilog:libhilog", 158 ] 159} 160 161ohos_unittest("BleTransTest") { 162 module_out_path = module_output_path 163 include_dirs = [ 164 "$softbus_adapter_common/include", 165 "$dsoftbus_dfx_path/interface/include", 166 "$dsoftbus_root_path/interfaces/kits/connect", 167 "$dsoftbus_root_path/core/connection/ble/include", 168 "$dsoftbus_root_path/core/connection/common/include", 169 "$dsoftbus_root_path/core/common/include", 170 "$dsoftbus_root_path/core/connection/manager", 171 "$dsoftbus_root_path/interfaces/kits/adapter", 172 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 173 "$dsoftbus_root_path/adapter/common/include", 174 "$dsoftbus_root_path/tests/core/connection/ble/mock", 175 ] 176 sources = [ 177 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_send_queue.c", 178 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_trans.c", 179 "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c", 180 "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_trans_mock.cpp", 181 "softbus_conn_ble_trans_test.cpp", 182 ] 183 184 deps = [ 185 "$dsoftbus_root_path/adapter:softbus_adapter", 186 "$dsoftbus_root_path/core/common:softbus_utils", 187 ] 188 189 external_deps = [ 190 "bluetooth:btframework", 191 "bounds_checking_function:libsec_shared", 192 "c_utils:utils", 193 "googletest:gmock_main", 194 "hilog:libhilog", 195 ] 196} 197 198ohos_unittest("BleClientTest") { 199 module_out_path = module_output_path 200 include_dirs = [ 201 "$dsoftbus_dfx_path/interface/include", 202 "$dsoftbus_root_path/core/connection/ble/include", 203 "$dsoftbus_root_path/core/connection/common/include", 204 "$dsoftbus_root_path/core/common/include", 205 "$dsoftbus_root_path/core/common/net/bluetooth/include", 206 "$dsoftbus_root_path/core/connection/manager", 207 "$dsoftbus_root_path/core/discovery/manager/include", 208 "$dsoftbus_root_path/core/discovery/interface", 209 "$dsoftbus_root_path/core/bus_center/service/include", 210 "$dsoftbus_root_path/core/bus_center/interface", 211 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 212 "$dsoftbus_root_path/adapter/common/include", 213 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 214 "$dsoftbus_root_path/interfaces/kits/bus_center", 215 "$dsoftbus_root_path/interfaces/kits/discovery", 216 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 217 "$dsoftbus_root_path/tests/core/connection/ble/mock", 218 "$dsoftbus_root_path/core/connection/sle/include", 219 "$dsoftbus_root_path/core/frame/init/include", 220 "$dsoftbus_root_path/core/frame/common/include", 221 "$dsoftbus_root_path/interfaces/kits/connect", 222 "$dsoftbus_root_path/interfaces/kits/disc", 223 "$dsoftbus_root_path/interfaces/kits/adapter", 224 ] 225 sources = [ 226 "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c", 227 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_client.c", 228 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c", 229 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_manager.c", 230 "$dsoftbus_root_path/core/frame/init/src/g_enhance_conn_func.c", 231 "$dsoftbus_root_path/core/frame/common/src/softbus_init_common.c", 232 "./mock/softbus_conn_ble_client_mock.cpp", 233 "softbus_conn_client_test.cpp", 234 "$dsoftbus_root_path/core/frame/init/src/g_enhance_conn_func_pack.c", 235 ] 236 237 deps = [ 238 "$dsoftbus_root_path/adapter:softbus_adapter", 239 "$dsoftbus_root_path/core/common:softbus_utils", 240 "$dsoftbus_root_path/dfx:softbus_dfx", 241 ] 242 243 external_deps = [ 244 "bluetooth:btframework", 245 "bounds_checking_function:libsec_shared", 246 "c_utils:utils", 247 "googletest:gmock_main", 248 "hilog:libhilog", 249 ] 250} 251 252ohos_unittest("BleHidumperTest") { 253 module_out_path = module_output_path 254 include_dirs = [ 255 "$dsoftbus_dfx_path/interface/include", 256 "$dsoftbus_root_path/core/connection/ble/include", 257 "$dsoftbus_root_path/core/connection/common/include", 258 "$dsoftbus_root_path/core/common/include", 259 "$dsoftbus_root_path/core/common/net/bluetooth/include", 260 "$dsoftbus_root_path/core/connection/manager", 261 "$dsoftbus_root_path/core/discovery/manager/include", 262 "$dsoftbus_root_path/core/discovery/interface", 263 "$dsoftbus_root_path/core/bus_center/service/include", 264 "$dsoftbus_root_path/core/bus_center/interface", 265 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 266 "$dsoftbus_root_path/adapter/common/include", 267 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 268 "$dsoftbus_root_path/interfaces/kits/bus_center", 269 "$dsoftbus_root_path/interfaces/kits/discovery", 270 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 271 "$dsoftbus_root_path/tests/core/connection/ble/mock", 272 "$dsoftbus_root_path/core/connection/sle/include", 273 "$dsoftbus_root_path/core/frame/init/include", 274 "$dsoftbus_root_path/core/frame/common/include", 275 "$dsoftbus_root_path/core/connection/proxy", 276 ] 277 278 public_configs = [ ":softbus_connection_ble_test_config" ] 279 280 sources = [ 281 "$dsoftbus_root_path/core/connection/ble/src/ble_protocol_interface_factory.c", 282 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_connection.c", 283 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_manager.c", 284 "$dsoftbus_root_path/core/connection/ble/src/softbus_conn_ble_snapshot.c", 285 "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c", 286 "$dsoftbus_root_path/core/connection/manager/softbus_conn_manager.c", 287 "$dsoftbus_root_path/tests/core/connection/ble/mock/softbus_conn_ble_manager_mock.cpp", 288 "$dsoftbus_root_path/core/frame/init/src/g_enhance_conn_func.c", 289 "$dsoftbus_root_path/core/frame/common/src/softbus_init_common.c", 290 "connection_ble_hidumper_test.cpp", 291 "$dsoftbus_root_path/core/frame/init/src/g_enhance_conn_func_pack.c", 292 ] 293 294 deps = [ 295 "$dsoftbus_dfx_path:softbus_dfx", 296 "$dsoftbus_dfx_path/dumper/legacy:softbus_dfx_dump", 297 "$dsoftbus_root_path/adapter:softbus_adapter", 298 "$dsoftbus_root_path/core/common:softbus_utils", 299 "$dsoftbus_root_path/core/frame:softbus_server", 300 ] 301 302 external_deps = [ 303 "bluetooth:btframework", 304 "bounds_checking_function:libsec_shared", 305 "cJSON:cjson", 306 "c_utils:utils", 307 "c_utils:utils", 308 "googletest:gmock_main", 309 "hilog:libhilog", 310 ] 311} 312