1# Copyright (c) 2022-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/LNN" 18dsoftbus_root_path = "../../../.." 19 20ohos_unittest("HeartBeatMediumTest") { 21 module_out_path = module_output_path 22 sources = [ 23 "$dsoftbus_root_path/core/authentication/src/auth_deviceprofile_virtual.cpp", 24 "$dsoftbus_root_path/core/authentication/src/auth_interface.c", 25 "$dsoftbus_root_path/core/authentication/src/auth_tcp_connection.c", 26 "$dsoftbus_root_path/core/authentication/src/virtual/auth_device_common_key_virtual.c", 27 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c", 28 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", 29 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_vap_info_virtual.c", 30 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_cipherkey_manager_virtual.c", 31 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c", 32 "$dsoftbus_root_path/core/bus_center/monitor/src/lnn_init_monitor.c", 33 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_connection_addr_utils.c", 34 "$dsoftbus_root_path/core/transmission/trans_channel/auth/src/trans_auth_manager.c", 35 "$dsoftbus_root_path/core/transmission/trans_channel/manager/src/trans_channel_manager.c", 36 "$dsoftbus_root_path/core/transmission/trans_channel/proxy/src/softbus_proxychannel_manager.c", 37 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 38 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", 39 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_medium_mgr_test.cpp", 40 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp", 41 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock/ble_mock.cpp", 42 ] 43 44 include_dirs = [ 45 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 46 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 47 "$dsoftbus_root_path/core/connection/p2p/common/include", 48 "$dsoftbus_root_path/core/connection/p2p/interface", 49 "$dsoftbus_root_path/core/bus_center/service/include", 50 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 51 "$dsoftbus_root_path/core/authentication/include", 52 "$dsoftbus_root_path/core/authentication/interface", 53 "$dsoftbus_root_path/core/discovery/interface", 54 "$dsoftbus_root_path/core/discovery/manager/include", 55 "$dsoftbus_root_path/core/core/discovery/manager/include", 56 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 57 "$dsoftbus_root_path/core/bus_center/interface", 58 "$dsoftbus_root_path/core/common/include", 59 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 60 "$dsoftbus_root_path/core/bus_center/utils/include", 61 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 62 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 63 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 64 "$dsoftbus_root_path/core/adapter/bus_center/include", 65 "$dsoftbus_root_path/adapter/common/include", 66 "$dsoftbus_root_path/core/common/include", 67 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 68 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src", 69 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 70 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 71 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 72 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 73 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 74 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 75 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 76 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 77 "$dsoftbus_root_path/interfaces/kits/bus_center", 78 "$dsoftbus_root_path/core/bus_center/monitor/include", 79 "$dsoftbus_root_path/interfaces/kits/discovery", 80 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock", 81 "$dsoftbus_root_path/core/discovery/ble/softbus_ble/include", 82 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 83 "$dsoftbus_root_path/core/broadcast/common/include", 84 "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include", 85 "$dsoftbus_root_path/core/transmission/trans_channel/manager/include", 86 "$dsoftbus_root_path/core/common/security/permission/include", 87 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_qos/include", 88 "$dsoftbus_root_path/core/transmission/trans_channel/qos/interface", 89 "$dsoftbus_root_path/core/transmission/trans_channel/common/include", 90 "$dsoftbus_root_path/core/transmission/trans_channel/auth/include", 91 "$dsoftbus_root_path/core/transmission/session/include", 92 "$dsoftbus_root_path/core/transmission/trans_channel/tcp_direct/include", 93 "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include", 94 "$dsoftbus_root_path/core/adapter/transmission/include", 95 ] 96 97 deps = [ 98 "$dsoftbus_dfx_path:softbus_dfx", 99 "$dsoftbus_root_path/adapter:softbus_adapter", 100 "$dsoftbus_root_path/core/common:softbus_utils", 101 ] 102 103 if (is_standard_system) { 104 external_deps = [ 105 "device_auth:deviceauth_sdk", 106 "googletest:gmock", 107 "googletest:gtest_main", 108 "hilog:libhilog", 109 ] 110 } else { 111 external_deps = [ 112 "googletest:gmock", 113 "googletest:gtest_main", 114 "hilog:libhilog", 115 "huks:libhukssdk", 116 ] 117 } 118 external_deps += [ 119 "c_utils:utils", 120 "ipc:ipc_single", 121 ] 122} 123 124ohos_unittest("HeartBeatMediumStaticTest") { 125 module_out_path = module_output_path 126 sources = [ 127 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", 128 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 129 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_medium_mgr_static_test.cpp", 130 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_medium_mgr_static_mock.cpp", 131 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp", 132 ] 133 134 include_dirs = [ 135 "$dsoftbus_root_path/adapter/common/include", 136 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 137 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 138 "$dsoftbus_root_path/adapter/common/net/wifi/include", 139 "$dsoftbus_root_path/core/authentication/include", 140 "$dsoftbus_root_path/core/authentication/interface", 141 "$dsoftbus_root_path/core/bus_center/interface", 142 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 143 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 144 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 145 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 146 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 147 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 148 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 149 "$dsoftbus_root_path/core/bus_center/service/include", 150 "$dsoftbus_root_path/core/bus_center/utils/include", 151 "$dsoftbus_root_path/core/common/dfx/interface/include/form", 152 "$dsoftbus_root_path/core/common/include", 153 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 154 "$dsoftbus_root_path/core/discovery/interface", 155 "$dsoftbus_root_path/core/discovery/manager/include", 156 "$dsoftbus_root_path/dfx/interface/include/form", 157 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 158 "$dsoftbus_root_path/interfaces/kits/bus_center", 159 "$dsoftbus_root_path/tests/adapter/common/include", 160 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 161 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 162 ] 163 164 deps = [ 165 "$dsoftbus_dfx_path:softbus_dfx", 166 "$dsoftbus_root_path/adapter:softbus_adapter", 167 "$dsoftbus_root_path/core/common:softbus_utils", 168 ] 169 170 if (is_standard_system) { 171 external_deps = [ "device_auth:deviceauth_sdk" ] 172 } else { 173 external_deps = [ "huks:libhukssdk" ] 174 } 175 external_deps += [ 176 "c_utils:utils", 177 "googletest:gmock", 178 "googletest:gtest_main", 179 "hilog:libhilog", 180 "ipc:ipc_single", 181 ] 182} 183 184ohos_unittest("HeartBeatFSMTest") { 185 module_out_path = module_output_path 186 sources = [ 187 "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_deviceinfo_to_profile_virtual.c", 188 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c", 189 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", 190 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c", 191 "$dsoftbus_root_path/core/bus_center/service/src/bus_center_manager.c", 192 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c", 193 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 194 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", 195 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp", 196 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_fsm_test.cpp", 197 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_mock.cpp", 198 ] 199 200 include_dirs = [ 201 "$dsoftbus_root_path/core/connection/interface", 202 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 203 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 204 "$dsoftbus_root_path/core/connection/p2p/common/include", 205 "$dsoftbus_root_path/core/connection/p2p/interface", 206 "$dsoftbus_root_path/core/bus_center/service/include", 207 "$dsoftbus_root_path/core/bus_center/interface", 208 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", 209 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 210 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/common/include", 211 "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include", 212 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 213 "$dsoftbus_root_path/core/bus_center/monitor/include", 214 "$dsoftbus_root_path/core/authentication/include", 215 "$dsoftbus_root_path/core/authentication/interface", 216 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 217 "$dsoftbus_root_path/core/discovery/interface", 218 "$dsoftbus_root_path/core/discovery/manager/include", 219 "$dsoftbus_root_path/core/core/discovery/manager/include", 220 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 221 "$dsoftbus_root_path/core/common/include", 222 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 223 "$dsoftbus_root_path/core/bus_center/utils/include", 224 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 225 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 226 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 227 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 228 "$dsoftbus_root_path/core/adapter/bus_center/include", 229 "$dsoftbus_root_path/adapter/common/include", 230 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 231 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 232 "$dsoftbus_root_path/dsoftbus_enhance/adapter/common/mlps/interface", 233 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 234 "$dsoftbus_root_path/interfaces/kits/bus_center", 235 "$dsoftbus_root_path/interfaces/kits/discovery", 236 ] 237 238 deps = [ 239 "$dsoftbus_dfx_path:softbus_dfx", 240 "$dsoftbus_root_path/adapter:softbus_adapter", 241 "$dsoftbus_root_path/core/common:softbus_utils", 242 ] 243 244 if (is_standard_system) { 245 external_deps = [ 246 "c_utils:utils", 247 "device_auth:deviceauth_sdk", 248 "googletest:gmock", 249 "googletest:gtest_main", 250 "hilog:libhilog", 251 "ipc:ipc_single", 252 ] 253 } else { 254 external_deps = [ 255 "c_utils:utils", 256 "googletest:gmock", 257 "googletest:gtest_main", 258 "hilog:libhilog", 259 "huks:libhukssdk", 260 "ipc:ipc_single", 261 ] 262 } 263} 264 265ohos_unittest("HeartBeatStrategyTest") { 266 module_out_path = module_output_path 267 if (dsoftbus_feature_lnn_ble) { 268 cflags = [ "-DENABLE_FEATURE_LNN_BLE" ] 269 } 270 sources = [ 271 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_strategy_test.cpp", 272 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_strategy_mock.cpp", 273 ] 274 275 include_dirs = [ 276 "$dsoftbus_root_path/adapter/common/include", 277 "$dsoftbus_root_path/core/adapter/bus_center/include", 278 "$dsoftbus_root_path/core/authentication/interface", 279 "$dsoftbus_root_path/core/common/include", 280 "$dsoftbus_root_path/core/bus_center/interface", 281 "$dsoftbus_root_path/core/bus_center/service/include", 282 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 283 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 284 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 285 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 286 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 287 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 288 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 289 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 290 "$dsoftbus_root_path/core/bus_center/utils/include", 291 "$dsoftbus_root_path/core/discovery/interface", 292 "$dsoftbus_root_path/core/discovery/manager/include", 293 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 294 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 295 "$dsoftbus_root_path/interfaces/kits/bus_center", 296 "$dsoftbus_root_path/interfaces/kits/discovery", 297 ] 298 299 deps = [ 300 "$dsoftbus_dfx_path:softbus_dfx", 301 "$dsoftbus_root_path/adapter:softbus_adapter", 302 "$dsoftbus_root_path/core/common:softbus_utils", 303 ] 304 305 if (is_standard_system) { 306 external_deps = [ 307 "device_auth:deviceauth_sdk", 308 "googletest:gmock", 309 "googletest:gtest_main", 310 "hilog:libhilog", 311 ] 312 } else { 313 external_deps = [ 314 "googletest:gmock", 315 "googletest:gtest_main", 316 "hilog:libhilog", 317 "huks:libhukssdk", 318 ] 319 } 320 external_deps += [ 321 "c_utils:utils", 322 "ipc:ipc_single", 323 ] 324} 325 326ohos_unittest("HeartBeatUtilsTest") { 327 module_out_path = module_output_path 328 sources = [ 329 "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_deviceinfo_to_profile_virtual.c", 330 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c", 331 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", 332 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c", 333 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c", 334 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 335 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", 336 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp", 337 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_utils_test.cpp", 338 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_heartbeat_utils_mock.cpp", 339 ] 340 341 include_dirs = [ 342 "$dsoftbus_root_path/core/connection/interface", 343 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 344 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 345 "$dsoftbus_root_path/core/connection/p2p/common/include", 346 "$dsoftbus_root_path/core/connection/p2p/interface", 347 "$dsoftbus_root_path/core/bus_center/service/include", 348 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 349 "$dsoftbus_root_path/core/authentication/include", 350 "$dsoftbus_root_path/core/authentication/interface", 351 "$dsoftbus_root_path/core/discovery/interface", 352 "$dsoftbus_root_path/core/discovery/manager/include", 353 "$dsoftbus_root_path/core/core/discovery/manager/include", 354 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 355 "$dsoftbus_root_path/core/bus_center/interface", 356 "$dsoftbus_root_path/core/common/include", 357 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 358 "$dsoftbus_root_path/core/bus_center/utils/include", 359 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 360 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 361 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 362 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 363 "$dsoftbus_root_path/core/adapter/bus_center/include", 364 "$dsoftbus_root_path/adapter/common/include", 365 "$dsoftbus_root_path/core/common/include", 366 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 367 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 368 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 369 "$dsoftbus_root_path/interfaces/kits/bus_center", 370 "$dsoftbus_root_path/interfaces/kits/discovery", 371 ] 372 373 deps = [ 374 "$dsoftbus_dfx_path:softbus_dfx", 375 "$dsoftbus_root_path/adapter:softbus_adapter", 376 "$dsoftbus_root_path/core/common:softbus_utils", 377 ] 378 379 if (is_standard_system) { 380 external_deps = [ 381 "c_utils:utils", 382 "device_auth:deviceauth_sdk", 383 "googletest:gmock", 384 "googletest:gtest_main", 385 "hilog:libhilog", 386 "ipc:ipc_single", 387 ] 388 } else { 389 external_deps = [ 390 "c_utils:utils", 391 "googletest:gmock", 392 "googletest:gtest_main", 393 "hilog:libhilog", 394 "huks:libhukssdk", 395 "ipc:ipc_single", 396 ] 397 } 398} 399 400ohos_unittest("HeartBeatCtrlTest") { 401 module_out_path = module_output_path 402 sources = [ 403 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/src/lnn_decision_center_virtual.c", 404 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_ctrl.c", 405 "$dsoftbus_root_path/core/bus_center/monitor/src/lnn_init_monitor.c", 406 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 407 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter/lnn_ip_network_impl_mock.cpp", 408 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", 409 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_ctrl_test.cpp", 410 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_ctrl_deps_mock.cpp", 411 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp", 412 ] 413 414 include_dirs = [ 415 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 416 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 417 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 418 "$dsoftbus_root_path/core/connection/p2p/common/include", 419 "$dsoftbus_root_path/core/connection/p2p/interface", 420 "$dsoftbus_root_path/core/bus_center/service/include", 421 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 422 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/mock", 423 "$dsoftbus_root_path/core/authentication/include", 424 "$dsoftbus_root_path/core/authentication/interface", 425 "$dsoftbus_root_path/core/discovery/interface", 426 "$dsoftbus_root_path/core/discovery/manager/include", 427 "$dsoftbus_root_path/core/core/discovery/manager/include", 428 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 429 "$dsoftbus_root_path/core/bus_center/interface", 430 "$dsoftbus_root_path/core/common/include", 431 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 432 "$dsoftbus_root_path/core/bus_center/utils/include", 433 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 434 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 435 "$dsoftbus_root_path/core/bus_center/monitor/include", 436 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 437 "$dsoftbus_root_path/core/adapter/bus_center/include", 438 "$dsoftbus_root_path/adapter/common/include", 439 "$dsoftbus_root_path/core/common/include", 440 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 441 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 442 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 443 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 444 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 445 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 446 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 447 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", 448 "$dsoftbus_root_path/core/bus_center/ipc/include", 449 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter", 450 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 451 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 452 "$dsoftbus_root_path/interfaces/kits/bus_center", 453 "$dsoftbus_root_path/interfaces/kits/discovery", 454 ] 455 456 deps = [ 457 "$dsoftbus_dfx_path:softbus_dfx", 458 "$dsoftbus_root_path/adapter:softbus_adapter", 459 "$dsoftbus_root_path/core/common:softbus_utils", 460 "$dsoftbus_root_path/core/frame:softbus_server", 461 ] 462 463 if (is_standard_system) { 464 external_deps = [ 465 "device_auth:deviceauth_sdk", 466 "googletest:gmock", 467 "googletest:gtest_main", 468 "hilog:libhilog", 469 ] 470 } else { 471 external_deps = [ 472 "googletest:gmock", 473 "googletest:gtest_main", 474 "hilog:libhilog", 475 "huks:libhukssdk", 476 ] 477 } 478 external_deps += [ 479 "c_utils:utils", 480 "ipc:ipc_single", 481 ] 482} 483 484ohos_unittest("ClientProxyTest") { 485 module_out_path = "dsoftbus/bus_center" 486 sources = [ 487 "$dsoftbus_root_path/tests/core/bus_center/test/ipc/client_proxy_test.cpp", 488 ] 489 490 include_dirs = [ 491 "$dsoftbus_root_path/adapter/common/include", 492 "$dsoftbus_root_path/core/bus_center/ipc/standard/include", 493 "$dsoftbus_root_path/sdk/frame/standard/include", 494 "$dsoftbus_root_path/interfaces/kits/discovery", 495 "$dsoftbus_root_path/interfaces/kits/transport", 496 "$dsoftbus_root_path/core/frame/standard/init/include", 497 "$dsoftbus_root_path/core/frame/standard/client_manager/include", 498 "$dsoftbus_root_path/core/common/include", 499 "$dsoftbus_root_path/core/frame/common/include", 500 ] 501 502 deps = [ 503 "$dsoftbus_dfx_path:softbus_dfx", 504 "$dsoftbus_root_path/adapter:softbus_adapter", 505 "$dsoftbus_root_path/core/common:softbus_utils", 506 "$dsoftbus_root_path/core/frame:softbus_server", 507 ] 508 509 if (is_standard_system) { 510 external_deps = [ 511 "c_utils:utils", 512 "device_auth:deviceauth_sdk", 513 "dsoftbus:softbus_client", 514 "googletest:gmock", 515 "googletest:gtest_main", 516 "hilog:libhilog", 517 "ipc:ipc_single", 518 "samgr:samgr_proxy", 519 ] 520 } else { 521 external_deps = [ 522 "c_utils:utils", 523 "dsoftbus:softbus_client", 524 "googletest:gmock", 525 "googletest:gtest_main", 526 "hilog:libhilog", 527 "huks:libhukssdk", 528 "ipc:ipc_single", 529 "samgr:samgr_proxy", 530 ] 531 } 532} 533 534ohos_unittest("BusCenterIpcTest") { 535 module_out_path = module_output_path 536 sources = [ 537 "$dsoftbus_root_path/core/frame/common/src/softbus_ddos.c", 538 "$dsoftbus_root_path/tests/core/bus_center/test/ipc/bus_center_ipc_test.cpp", 539 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/bus_center_ipc_mock.cpp", 540 ] 541 542 include_dirs = [ 543 "$dsoftbus_root_path/core/common/include", 544 "$dsoftbus_root_path/core/frame/common/include", 545 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 546 "$dsoftbus_root_path/core/bus_center/service/include", 547 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 548 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 549 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 550 "$dsoftbus_root_path/core/authentication/interface", 551 "$dsoftbus_root_path/core/discovery/manager/include", 552 "$dsoftbus_root_path/core/bus_center/ipc/include", 553 "$dsoftbus_root_path/core/bus_center/ipc/standard/include", 554 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 555 "$dsoftbus_root_path/core/discovery/interface", 556 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/time_sync/include", 557 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 558 "$dsoftbus_root_path/core/bus_center/interface", 559 "$dsoftbus_root_path/core/bus_center/ipc/standard/src", 560 "$dsoftbus_root_path/core/bus_center/utils/include", 561 "$dsoftbus_root_path/core/bus_center/ipc/standard/include", 562 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 563 "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include", 564 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 565 "$dsoftbus_root_path/interfaces/kits/bus_center", 566 "$dsoftbus_root_path/interfaces/kits/discovery", 567 ] 568 569 deps = [ 570 "$dsoftbus_dfx_path:softbus_dfx", 571 "$dsoftbus_root_path/adapter:softbus_adapter", 572 "$dsoftbus_root_path/core/common:softbus_utils", 573 ] 574 575 if (is_standard_system) { 576 external_deps = [ 577 "c_utils:utils", 578 "device_auth:deviceauth_sdk", 579 "googletest:gmock", 580 "googletest:gtest_main", 581 "hilog:libhilog", 582 "ipc:ipc_single", 583 ] 584 } else { 585 external_deps = [ 586 "c_utils:utils", 587 "googletest:gmock", 588 "googletest:gtest_main", 589 "hilog:libhilog", 590 "huks:libhukssdk", 591 "ipc:ipc_single", 592 ] 593 } 594} 595 596ohos_unittest("HeartBeatCtrlStaticTest") { 597 module_out_path = module_output_path 598 sources = [ 599 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder.c", 600 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_init.c", 601 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_process.c", 602 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 603 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_ctrl_static_test.cpp", 604 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_ctrl_static_mock.cpp", 605 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock/ble_mock.cpp", 606 ] 607 608 include_dirs = [ 609 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 610 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 611 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 612 "$dsoftbus_root_path/core/connection/p2p/common/include", 613 "$dsoftbus_root_path/core/connection/p2p/interface", 614 "$dsoftbus_root_path/core/bus_center/service/include", 615 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/mock", 616 "$dsoftbus_root_path/core/authentication/include", 617 "$dsoftbus_root_path/core/authentication/interface", 618 "$dsoftbus_root_path/core/discovery/interface", 619 "$dsoftbus_root_path/core/discovery/manager/include", 620 "$dsoftbus_root_path/core/core/discovery/manager/include", 621 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 622 "$dsoftbus_root_path/core/bus_center/interface", 623 "$dsoftbus_root_path/core/common/include", 624 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 625 "$dsoftbus_root_path/core/bus_center/monitor/include", 626 "$dsoftbus_root_path/core/bus_center/monitor/src", 627 "$dsoftbus_root_path/core/bus_center/utils/include", 628 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 629 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 630 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 631 "$dsoftbus_root_path/core/adapter/bus_center/include", 632 "$dsoftbus_root_path/adapter/common/include", 633 "$dsoftbus_root_path/core/common/include", 634 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 635 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 636 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 637 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 638 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 639 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 640 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 641 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", 642 "$dsoftbus_root_path/core/bus_center/ipc/include", 643 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter", 644 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 645 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 646 "$dsoftbus_root_path/interfaces/kits/bus_center", 647 "$dsoftbus_root_path/interfaces/kits/discovery", 648 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock", 649 "$dsoftbus_root_path/core/discovery/ble/softbus_ble/include", 650 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 651 "$dsoftbus_root_path/adapter/common/net/wifi/include", 652 "$dsoftbus_root_path/core/broadcast/common/include", 653 "$dsoftbus_root_path/core/bus_center/utils/include", 654 "$dsoftbus_root_path/core/transmission/trans_channel/manager/include", 655 "$dsoftbus_root_path/core/transmission/trans_channel/auth/include", 656 ] 657 658 deps = [ 659 "$dsoftbus_dfx_path:softbus_dfx", 660 "$dsoftbus_root_path/adapter:softbus_adapter", 661 "$dsoftbus_root_path/core/common:softbus_utils", 662 ] 663 664 if (is_standard_system) { 665 external_deps = [ 666 "device_auth:deviceauth_sdk", 667 "googletest:gmock", 668 "googletest:gtest_main", 669 "hilog:libhilog", 670 ] 671 } else { 672 external_deps = [ 673 "googletest:gmock", 674 "googletest:gtest_main", 675 "hilog:libhilog", 676 "huks:libhukssdk", 677 ] 678 } 679 external_deps += [ 680 "c_utils:utils", 681 "ipc:ipc_single", 682 ] 683} 684 685ohos_unittest("BusCenterDecisionCenterTest") { 686 module_out_path = module_output_path 687 sources = [ 688 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_init.c", 689 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_process.c", 690 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_node_info.c", 691 "$dsoftbus_root_path/core/bus_center/monitor/src/lnn_init_monitor.c", 692 "$dsoftbus_root_path/core/bus_center/service/src/bus_center_decision_center.c", 693 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_builder_mock.cpp", 694 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/bus_center_decision_center_mock.cpp", 695 "$dsoftbus_root_path/tests/core/bus_center/test/service/bus_center_decision_center_test.cpp", 696 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock/ble_mock.cpp", 697 ] 698 699 include_dirs = [ 700 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 701 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 702 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 703 "$dsoftbus_root_path/core/connection/p2p/common/include", 704 "$dsoftbus_root_path/core/connection/p2p/interface", 705 "$dsoftbus_root_path/core/bus_center/service/include", 706 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/mock", 707 "$dsoftbus_root_path/core/authentication/include", 708 "$dsoftbus_root_path/core/authentication/interface", 709 "$dsoftbus_root_path/core/discovery/interface", 710 "$dsoftbus_root_path/core/discovery/manager/include", 711 "$dsoftbus_root_path/core/core/discovery/manager/include", 712 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 713 "$dsoftbus_root_path/core/bus_center/interface", 714 "$dsoftbus_root_path/core/common/include", 715 "$dsoftbus_root_path/core/bus_center/monitor/include", 716 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 717 "$dsoftbus_root_path/core/bus_center/utils/include", 718 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 719 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 720 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 721 "$dsoftbus_root_path/core/adapter/bus_center/include", 722 "$dsoftbus_root_path/adapter/common/include", 723 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 724 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 725 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 726 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 727 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 728 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 729 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 730 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", 731 "$dsoftbus_root_path/core/bus_center/ipc/include", 732 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter", 733 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 734 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 735 "$dsoftbus_root_path/interfaces/kits/discovery", 736 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock", 737 "$dsoftbus_root_path/core/discovery/ble/softbus_ble/include", 738 "$dsoftbus_root_path/adapter/common/net/wifi/include", 739 "$dsoftbus_root_path/core/broadcast/common/include", 740 "$dsoftbus_root_path/interfaces/kits/bus_center", 741 "$dsoftbus_root_path/tests/core/connection/interface", 742 "$dsoftbus_root_path/core/transmission/trans_channel/manager/include", 743 ] 744 745 deps = [ 746 "$dsoftbus_dfx_path:softbus_dfx", 747 "$dsoftbus_root_path/adapter:softbus_adapter", 748 "$dsoftbus_root_path/core/common:softbus_utils", 749 ] 750 751 if (is_standard_system) { 752 external_deps = [ 753 "device_auth:deviceauth_sdk", 754 "googletest:gmock", 755 "googletest:gtest_main", 756 "hilog:libhilog", 757 ] 758 } else { 759 external_deps = [ 760 "googletest:gmock", 761 "googletest:gtest_main", 762 "hilog:libhilog", 763 "huks:libhukssdk", 764 ] 765 } 766 external_deps += [ 767 "c_utils:utils", 768 "ipc:ipc_single", 769 ] 770} 771 772group("unittest") { 773 testonly = true 774 deps = [ 775 ":BusCenterDecisionCenterTest", 776 ":BusCenterIpcTest", 777 ":ClientProxyTest", 778 ":HeartBeatMediumStaticTest", 779 ] 780 if (dsoftbus_feature_lnn_ble) { 781 deps += [ 782 ":HeartBeatCtrlStaticTest", 783 ":HeartBeatCtrlTest", 784 ":HeartBeatFSMTest", 785 ":HeartBeatMediumTest", 786 ":HeartBeatStrategyTest", 787 ":HeartBeatUtilsTest", 788 ] 789 } 790} 791