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/virtual/auth_device_common_key_virtual.c", 26 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c", 27 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", 28 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_vap_info_virtual.c", 29 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_cipherkey_manager_virtual.c", 30 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c", 31 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_connection_addr_utils.c", 32 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 33 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", 34 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_medium_mgr_test.cpp", 35 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp", 36 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock/ble_mock.cpp", 37 ] 38 39 include_dirs = [ 40 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 41 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 42 "$dsoftbus_root_path/core/connection/p2p/common/include", 43 "$dsoftbus_root_path/core/connection/p2p/interface", 44 "$dsoftbus_root_path/core/bus_center/service/include", 45 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 46 "$dsoftbus_root_path/core/authentication/include", 47 "$dsoftbus_root_path/core/authentication/interface", 48 "$dsoftbus_root_path/core/discovery/interface", 49 "$dsoftbus_root_path/core/discovery/manager/include", 50 "$dsoftbus_root_path/core/core/discovery/manager/include", 51 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 52 "$dsoftbus_root_path/core/bus_center/interface", 53 "$dsoftbus_root_path/core/common/include", 54 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 55 "$dsoftbus_root_path/core/bus_center/utils/include", 56 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 57 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 58 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 59 "$dsoftbus_root_path/core/adapter/bus_center/include", 60 "$dsoftbus_root_path/adapter/common/include", 61 "$dsoftbus_root_path/core/common/include", 62 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 63 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src", 64 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 65 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 66 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 67 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 68 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 69 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 70 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 71 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 72 "$dsoftbus_root_path/interfaces/kits/discovery", 73 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock", 74 "$dsoftbus_root_path/core/discovery/ble/softbus_ble/include", 75 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 76 "$dsoftbus_root_path/core/broadcast/common/include", 77 "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include", 78 ] 79 80 deps = [ 81 "$dsoftbus_root_path/adapter:softbus_adapter", 82 "$dsoftbus_root_path/core/common:softbus_utils", 83 "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", 84 ] 85 86 if (is_standard_system) { 87 external_deps = [ 88 "device_auth:deviceauth_sdk", 89 "googletest:gmock", 90 "googletest:gtest_main", 91 "hilog:libhilog", 92 ] 93 } else { 94 external_deps = [ 95 "googletest:gmock", 96 "googletest:gtest_main", 97 "hilog:libhilog", 98 "huks:libhukssdk", 99 ] 100 } 101 external_deps += [ 102 "c_utils:utils", 103 "ipc:ipc_core", 104 ] 105} 106 107ohos_unittest("HeartBeatFSMTest") { 108 module_out_path = module_output_path 109 sources = [ 110 "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_deviceinfo_to_profile_virtual.c", 111 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c", 112 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", 113 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c", 114 "$dsoftbus_root_path/core/bus_center/service/src/bus_center_manager.c", 115 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c", 116 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 117 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", 118 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp", 119 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_fsm_test.cpp", 120 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_mock.cpp", 121 ] 122 123 include_dirs = [ 124 "$dsoftbus_root_path/core/connection/interface", 125 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 126 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 127 "$dsoftbus_root_path/core/connection/p2p/common/include", 128 "$dsoftbus_root_path/core/connection/p2p/interface", 129 "$dsoftbus_root_path/core/bus_center/service/include", 130 "$dsoftbus_root_path/core/bus_center/interface", 131 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", 132 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 133 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/common/include", 134 "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include", 135 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 136 "$dsoftbus_root_path/core/bus_center/monitor/include", 137 "$dsoftbus_root_path/core/authentication/include", 138 "$dsoftbus_root_path/core/authentication/interface", 139 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 140 "$dsoftbus_root_path/core/discovery/interface", 141 "$dsoftbus_root_path/core/discovery/manager/include", 142 "$dsoftbus_root_path/core/core/discovery/manager/include", 143 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 144 "$dsoftbus_root_path/core/common/include", 145 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 146 "$dsoftbus_root_path/core/bus_center/utils/include", 147 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 148 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 149 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 150 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 151 "$dsoftbus_root_path/core/adapter/bus_center/include", 152 "$dsoftbus_root_path/adapter/common/include", 153 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 154 "$dsoftbus_root_path/dsoftbus_enhance/adapter/common/mlps/interface", 155 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 156 "$dsoftbus_root_path/interfaces/kits/discovery", 157 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 158 "$dsoftbus_root_path/dsoftbus_enhance/adapter/common/mlps/include", 159 ] 160 161 deps = [ 162 "$dsoftbus_root_path/adapter:softbus_adapter", 163 "$dsoftbus_root_path/core/common:softbus_utils", 164 "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", 165 ] 166 167 if (is_standard_system) { 168 external_deps = [ 169 "c_utils:utils", 170 "device_auth:deviceauth_sdk", 171 "googletest:gmock", 172 "googletest:gtest_main", 173 "hilog:libhilog", 174 "ipc:ipc_core", 175 ] 176 } else { 177 external_deps = [ 178 "c_utils:utils", 179 "googletest:gmock", 180 "googletest:gtest_main", 181 "hilog:libhilog", 182 "huks:libhukssdk", 183 "ipc:ipc_core", 184 ] 185 } 186} 187 188ohos_unittest("HeartBeatStrategyTest") { 189 module_out_path = module_output_path 190 sources = [ 191 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_strategy_test.cpp", 192 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_strategy_mock.cpp", 193 ] 194 195 include_dirs = [ 196 "$dsoftbus_root_path/adapter/common/include", 197 "$dsoftbus_root_path/core/adapter/bus_center/include", 198 "$dsoftbus_root_path/core/authentication/interface", 199 "$dsoftbus_root_path/core/common/include", 200 "$dsoftbus_root_path/core/bus_center/interface", 201 "$dsoftbus_root_path/core/bus_center/service/include", 202 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 203 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 204 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 205 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 206 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 207 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 208 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 209 "$dsoftbus_root_path/core/bus_center/utils/include", 210 "$dsoftbus_root_path/core/discovery/interface", 211 "$dsoftbus_root_path/core/discovery/manager/include", 212 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 213 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 214 "$dsoftbus_root_path/interfaces/kits/discovery", 215 ] 216 217 deps = [ 218 "$dsoftbus_root_path/adapter:softbus_adapter", 219 "$dsoftbus_root_path/core/common:softbus_utils", 220 "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", 221 ] 222 223 if (is_standard_system) { 224 external_deps = [ 225 "device_auth:deviceauth_sdk", 226 "googletest:gmock", 227 "googletest:gtest_main", 228 "hilog:libhilog", 229 ] 230 } else { 231 external_deps = [ 232 "googletest:gmock", 233 "googletest:gtest_main", 234 "hilog:libhilog", 235 "huks:libhukssdk", 236 ] 237 } 238 external_deps += [ 239 "c_utils:utils", 240 "ipc:ipc_core", 241 ] 242} 243 244ohos_unittest("HeartBeatUtilsTest") { 245 module_out_path = module_output_path 246 sources = [ 247 "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_deviceinfo_to_profile_virtual.c", 248 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c", 249 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", 250 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c", 251 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c", 252 "$dsoftbus_root_path/core/connection/wifi_direct_cpp/wifi_direct_manager_virtual.c", 253 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 254 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", 255 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp", 256 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_utils_test.cpp", 257 ] 258 259 include_dirs = [ 260 "$dsoftbus_root_path/core/connection/interface", 261 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 262 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 263 "$dsoftbus_root_path/core/connection/p2p/common/include", 264 "$dsoftbus_root_path/core/connection/p2p/interface", 265 "$dsoftbus_root_path/core/bus_center/service/include", 266 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 267 "$dsoftbus_root_path/core/authentication/include", 268 "$dsoftbus_root_path/core/authentication/interface", 269 "$dsoftbus_root_path/core/discovery/interface", 270 "$dsoftbus_root_path/core/discovery/manager/include", 271 "$dsoftbus_root_path/core/core/discovery/manager/include", 272 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 273 "$dsoftbus_root_path/core/bus_center/interface", 274 "$dsoftbus_root_path/core/common/include", 275 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 276 "$dsoftbus_root_path/core/bus_center/utils/include", 277 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 278 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 279 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 280 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 281 "$dsoftbus_root_path/core/adapter/bus_center/include", 282 "$dsoftbus_root_path/adapter/common/include", 283 "$dsoftbus_root_path/core/common/include", 284 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 285 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 286 "$dsoftbus_root_path/interfaces/kits/discovery", 287 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 288 ] 289 290 deps = [ 291 "$dsoftbus_root_path/adapter:softbus_adapter", 292 "$dsoftbus_root_path/core/common:softbus_utils", 293 "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", 294 ] 295 296 if (is_standard_system) { 297 external_deps = [ 298 "c_utils:utils", 299 "device_auth:deviceauth_sdk", 300 "googletest:gmock", 301 "googletest:gtest_main", 302 "hilog:libhilog", 303 "ipc:ipc_core", 304 ] 305 } else { 306 external_deps = [ 307 "c_utils:utils", 308 "googletest:gmock", 309 "googletest:gtest_main", 310 "hilog:libhilog", 311 "huks:libhukssdk", 312 "ipc:ipc_core", 313 ] 314 } 315} 316 317ohos_unittest("HeartBeatCtrlTest") { 318 module_out_path = module_output_path 319 sources = [ 320 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/src/lnn_decision_center_virtual.c", 321 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_ctrl.c", 322 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 323 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter/lnn_ip_network_impl_mock.cpp", 324 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", 325 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_ctrl_test.cpp", 326 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_ctrl_deps_mock.cpp", 327 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp", 328 ] 329 330 include_dirs = [ 331 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 332 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 333 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 334 "$dsoftbus_root_path/core/connection/p2p/common/include", 335 "$dsoftbus_root_path/core/connection/p2p/interface", 336 "$dsoftbus_root_path/core/bus_center/service/include", 337 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 338 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/mock", 339 "$dsoftbus_root_path/core/authentication/include", 340 "$dsoftbus_root_path/core/authentication/interface", 341 "$dsoftbus_root_path/core/discovery/interface", 342 "$dsoftbus_root_path/core/discovery/manager/include", 343 "$dsoftbus_root_path/core/core/discovery/manager/include", 344 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 345 "$dsoftbus_root_path/core/bus_center/interface", 346 "$dsoftbus_root_path/core/common/include", 347 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 348 "$dsoftbus_root_path/core/bus_center/utils/include", 349 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 350 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 351 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 352 "$dsoftbus_root_path/core/adapter/bus_center/include", 353 "$dsoftbus_root_path/adapter/common/include", 354 "$dsoftbus_root_path/core/common/include", 355 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 356 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 357 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 358 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 359 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 360 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 361 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 362 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", 363 "$dsoftbus_root_path/core/bus_center/ipc/include", 364 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter", 365 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 366 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 367 "$dsoftbus_root_path/interfaces/kits/discovery", 368 ] 369 370 deps = [ 371 "$dsoftbus_root_path/adapter:softbus_adapter", 372 "$dsoftbus_root_path/core/common:softbus_utils", 373 "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", 374 "$dsoftbus_root_path/core/frame:softbus_server", 375 ] 376 377 if (is_standard_system) { 378 external_deps = [ 379 "device_auth:deviceauth_sdk", 380 "googletest:gmock", 381 "googletest:gtest_main", 382 "hilog:libhilog", 383 ] 384 } else { 385 external_deps = [ 386 "googletest:gmock", 387 "googletest:gtest_main", 388 "hilog:libhilog", 389 "huks:libhukssdk", 390 ] 391 } 392 external_deps += [ 393 "c_utils:utils", 394 "ipc:ipc_core", 395 ] 396} 397 398ohos_unittest("ClientProxyTest") { 399 module_out_path = "dsoftbus/bus_center" 400 sources = [ 401 "$dsoftbus_root_path/tests/core/bus_center/test/ipc/client_proxy_test.cpp", 402 ] 403 404 include_dirs = [ 405 "$dsoftbus_root_path/adapter/common/include", 406 "$dsoftbus_root_path/core/bus_center/ipc/standard/include", 407 "$dsoftbus_root_path/sdk/frame/standard/include", 408 "$dsoftbus_root_path/interfaces/kits/discovery", 409 "$dsoftbus_root_path/interfaces/kits/transport", 410 "$dsoftbus_root_path/core/frame/standard/init/include", 411 "$dsoftbus_root_path/core/frame/standard/client_manager/include", 412 "$dsoftbus_root_path/core/common/include", 413 "$dsoftbus_root_path/core/frame/common/include", 414 ] 415 416 deps = [ 417 "$dsoftbus_root_path/adapter:softbus_adapter", 418 "$dsoftbus_root_path/core/common:softbus_utils", 419 "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", 420 "$dsoftbus_root_path/core/frame:softbus_server", 421 ] 422 423 if (is_standard_system) { 424 external_deps = [ 425 "c_utils:utils", 426 "device_auth:deviceauth_sdk", 427 "googletest:gmock", 428 "googletest:gtest_main", 429 "hilog:libhilog", 430 "ipc:ipc_core", 431 "samgr:samgr_proxy", 432 ] 433 } else { 434 external_deps = [ 435 "c_utils:utils", 436 "googletest:gmock", 437 "googletest:gtest_main", 438 "hilog:libhilog", 439 "huks:libhukssdk", 440 "ipc:ipc_core", 441 "samgr:samgr_proxy", 442 ] 443 } 444} 445 446ohos_unittest("BusCenterIpcTest") { 447 module_out_path = module_output_path 448 sources = [ 449 "$dsoftbus_root_path/tests/core/bus_center/test/ipc/bus_center_ipc_test.cpp", 450 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/bus_center_ipc_mock.cpp", 451 ] 452 453 include_dirs = [ 454 "$dsoftbus_root_path/core/common/include", 455 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 456 "$dsoftbus_root_path/core/bus_center/service/include", 457 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 458 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 459 "$dsoftbus_root_path/core/authentication/interface", 460 "$dsoftbus_root_path/core/discovery/manager/include", 461 "$dsoftbus_root_path/core/bus_center/ipc/include", 462 "$dsoftbus_root_path/core/bus_center/ipc/standard/include", 463 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 464 "$dsoftbus_root_path/core/discovery/interface", 465 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/time_sync/include", 466 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 467 "$dsoftbus_root_path/core/bus_center/interface", 468 "$dsoftbus_root_path/core/bus_center/ipc/standard/src", 469 "$dsoftbus_root_path/core/bus_center/utils/include", 470 "$dsoftbus_root_path/core/bus_center/ipc/standard/include", 471 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 472 "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include", 473 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 474 "$dsoftbus_root_path/interfaces/kits/discovery", 475 ] 476 477 deps = [ 478 "$dsoftbus_root_path/adapter:softbus_adapter", 479 "$dsoftbus_root_path/core/common:softbus_utils", 480 "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", 481 ] 482 483 if (is_standard_system) { 484 external_deps = [ 485 "c_utils:utils", 486 "device_auth:deviceauth_sdk", 487 "googletest:gmock", 488 "googletest:gtest_main", 489 "hilog:libhilog", 490 "ipc:ipc_core", 491 ] 492 } else { 493 external_deps = [ 494 "c_utils:utils", 495 "googletest:gmock", 496 "googletest:gtest_main", 497 "hilog:libhilog", 498 "huks:libhukssdk", 499 "ipc:ipc_core", 500 ] 501 } 502} 503 504ohos_unittest("HeartBeatCtrlStaticTest") { 505 module_out_path = module_output_path 506 sources = [ 507 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder.c", 508 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_init.c", 509 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder_process.c", 510 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", 511 "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_ctrl_static_test.cpp", 512 "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_ctrl_static_mock.cpp", 513 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock/ble_mock.cpp", 514 ] 515 516 include_dirs = [ 517 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 518 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 519 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 520 "$dsoftbus_root_path/core/connection/p2p/common/include", 521 "$dsoftbus_root_path/core/connection/p2p/interface", 522 "$dsoftbus_root_path/core/bus_center/service/include", 523 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 524 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/mock", 525 "$dsoftbus_root_path/core/authentication/include", 526 "$dsoftbus_root_path/core/authentication/interface", 527 "$dsoftbus_root_path/core/discovery/interface", 528 "$dsoftbus_root_path/core/discovery/manager/include", 529 "$dsoftbus_root_path/core/core/discovery/manager/include", 530 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", 531 "$dsoftbus_root_path/core/bus_center/interface", 532 "$dsoftbus_root_path/core/common/include", 533 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 534 "$dsoftbus_root_path/core/bus_center/utils/include", 535 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 536 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 537 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 538 "$dsoftbus_root_path/core/adapter/bus_center/include", 539 "$dsoftbus_root_path/adapter/common/include", 540 "$dsoftbus_root_path/core/common/include", 541 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 542 "$dsoftbus_root_path/core/connection/wifi_direct_cpp", 543 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 544 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 545 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 546 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 547 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 548 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", 549 "$dsoftbus_root_path/core/bus_center/ipc/include", 550 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter", 551 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 552 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 553 "$dsoftbus_root_path/interfaces/kits/discovery", 554 "$dsoftbus_root_path/tests/core/discovery/ble/softbus_ble_mock", 555 "$dsoftbus_root_path/core/discovery/ble/softbus_ble/include", 556 "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", 557 "$dsoftbus_root_path/adapter/common/net/wifi/include", 558 "$dsoftbus_root_path/core/broadcast/common/include", 559 "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", 560 "$dsoftbus_root_path/core/bus_center/utils/include", 561 "$dsoftbus_root_path/core/transmission/trans_channel/manager/include", 562 ] 563 564 deps = [ 565 "$dsoftbus_root_path/adapter:softbus_adapter", 566 "$dsoftbus_root_path/core/common:softbus_utils", 567 "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", 568 ] 569 570 if (is_standard_system) { 571 external_deps = [ 572 "device_auth:deviceauth_sdk", 573 "googletest:gmock", 574 "googletest:gtest_main", 575 "hilog:libhilog", 576 ] 577 } else { 578 external_deps = [ 579 "googletest:gmock", 580 "googletest:gtest_main", 581 "hilog:libhilog", 582 "huks:libhukssdk", 583 ] 584 } 585 external_deps += [ 586 "c_utils:utils", 587 "ipc:ipc_core", 588 ] 589} 590 591group("unittest") { 592 testonly = true 593 deps = [ 594 ":BusCenterIpcTest", 595 ":ClientProxyTest", 596 ":HeartBeatCtrlStaticTest", 597 ":HeartBeatCtrlTest", 598 ":HeartBeatFSMTest", 599 ":HeartBeatMediumTest", 600 ":HeartBeatStrategyTest", 601 ":HeartBeatUtilsTest", 602 ] 603} 604