1# Copyright (c) 2021-2022 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("//foundation/communication/dsoftbus/dsoftbus.gni") 16 17module_output_path = "dsoftbus/LNN" 18 19ohos_unittest("LNNTest") { 20 module_out_path = module_output_path 21 sources = [ 22 "ipc/bus_center_client_proxy_standard_test.cpp", 23 "ipc/lnn_bus_center_ipc_test.cpp", 24 "unittest/lane_test.cpp", 25 "unittest/ledger_lane_hub_test.cpp", 26 "unittest/lnn_huks_test.cpp", 27 "unittest/net_builder_test.cpp", 28 ] 29 30 include_dirs = [ 31 "$dsoftbus_root_path/core/bus_center/service/include", 32 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 33 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 34 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 35 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/sync_info/include", 36 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 37 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 38 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 39 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/src", 40 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 41 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 42 "$dsoftbus_root_path/core/bus_center/monitor/include", 43 "$dsoftbus_root_path/core/common/include", 44 "$dsoftbus_root_path/adapter/common/include", 45 "$dsoftbus_root_path/core/connection/interface", 46 "$dsoftbus_root_path/core/authentication/interface", 47 "$dsoftbus_root_path/core/bus_center/interface", 48 "$dsoftbus_root_path/core/bus_center/utils/include", 49 "$dsoftbus_root_path/core/bus_center/ipc/standard/include", 50 "$dsoftbus_root_path/core/bus_center/ipc/standard/src", 51 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/time_sync/include", 52 "$dsoftbus_root_path/core/bus_center/ipc/include", 53 "$dsoftbus_root_path/interfaces/kits/bus_center", 54 "$dsoftbus_root_path/interfaces/kits/common", 55 "$dsoftbus_root_path/core/adapter/bus_center/include", 56 "$dsoftbus_root_path/sdk/frame/standard/include", 57 "//commonlibrary/c_utils/base/include", 58 "//third_party/cJSON", 59 "unittest/common/", 60 "$dsoftbus_root_path/core/connection/manager", 61 "$dsoftbus_root_path/core/frame/standard/client_manager/include", 62 "$dsoftbus_root_path/adapter/common/bus_center/include/", 63 "$dsoftbus_root_path/core/discovery/manager/include", 64 "$dsoftbus_root_path/core/discovery/interface", 65 "$dsoftbus_root_path/interfaces/kits/discovery", 66 "//base/security/huks/interfaces/innerkits/huks_standard/main/include", 67 "$dsoftbus_root_path/sdk/bus_center/manager/include", 68 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src", 69 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 70 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 71 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 72 ] 73 74 deps = [ 75 "$dsoftbus_root_path/adapter:softbus_adapter", 76 "$dsoftbus_root_path/core/common:softbus_utils", 77 "$dsoftbus_root_path/core/frame:softbus_server", 78 "//base/security/device_auth/services:deviceauth_sdk", 79 "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", 80 "//third_party/googletest:gmock", 81 "//third_party/googletest:gtest_main", 82 ] 83 84 if (is_standard_system) { 85 external_deps = [ 86 "c_utils:utils", 87 "hiviewdfx_hilog_native:libhilog", 88 ] 89 } else { 90 external_deps = [ 91 "c_utils:utils", 92 "hilog:libhilog", 93 "huks:libhukssdk", 94 ] 95 } 96} 97 98ohos_unittest("LNNNetBuilderTest") { 99 module_out_path = module_output_path 100 sources = [ "net_builder/src/lnn_net_builder_test.cpp" ] 101 102 include_dirs = [ 103 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 104 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 105 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 106 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/sync_info/include", 107 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 108 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 109 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 110 "$dsoftbus_root_path/core/bus_center/monitor/include", 111 "$dsoftbus_root_path/core/common/include", 112 "$dsoftbus_root_path/adapter/common/include", 113 "$dsoftbus_root_path/core/connection/interface", 114 "$dsoftbus_root_path/core/authentication/interface", 115 "$dsoftbus_root_path/core/bus_center/interface", 116 "$dsoftbus_root_path/core/bus_center/utils/include", 117 "$dsoftbus_root_path/interfaces/kits/bus_center", 118 "$dsoftbus_root_path/interfaces/kits/common", 119 "$dsoftbus_root_path/core/adapter/bus_center/include", 120 "//commonlibrary/c_utils/base/include", 121 "//third_party/cJSON", 122 "unittest/common/", 123 "$dsoftbus_root_path/core/connection/manager", 124 "$dsoftbus_root_path/adapter/common/bus_center/include/", 125 "$dsoftbus_root_path/core/discovery/manager/include", 126 "$dsoftbus_root_path/core/discovery/interface", 127 "$dsoftbus_root_path/interfaces/kits/discovery", 128 "$dsoftbus_root_path/core/bus_center/service/include", 129 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 130 ] 131 132 deps = [ 133 "$dsoftbus_root_path/adapter:softbus_adapter", 134 "$dsoftbus_root_path/core/common:softbus_utils", 135 "$dsoftbus_root_path/core/frame:softbus_server", 136 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 137 "//base/security/device_auth/services:deviceauth_sdk", 138 "//third_party/googletest:gmock", 139 "//third_party/googletest:gtest_main", 140 ] 141 142 if (is_standard_system) { 143 external_deps = [ 144 "c_utils:utils", 145 "hiviewdfx_hilog_native:libhilog", 146 ] 147 } else { 148 external_deps = [ 149 "c_utils:utils", 150 "hilog:libhilog", 151 ] 152 } 153} 154 155ohos_unittest("LNNNetBuilderMockTest") { 156 module_out_path = module_output_path 157 sources = [ 158 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_trans_mock.cpp", 159 "net_builder/src/lnn_net_builder_deps_mock.cpp", 160 "net_builder/src/lnn_net_builder_mock_test.cpp", 161 ] 162 163 include_dirs = [ 164 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 165 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src", 166 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 167 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 168 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/sync_info/include", 169 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 170 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 171 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 172 "$dsoftbus_root_path/core/bus_center/monitor/include", 173 "$dsoftbus_root_path/core/common/include", 174 "$dsoftbus_root_path/adapter/common/include", 175 "$dsoftbus_root_path/core/connection/interface", 176 "$dsoftbus_root_path/core/authentication/interface", 177 "$dsoftbus_root_path/core/bus_center/interface", 178 "$dsoftbus_root_path/core/bus_center/utils/include", 179 "$dsoftbus_root_path/interfaces/kits/bus_center", 180 "$dsoftbus_root_path/interfaces/kits/common", 181 "$dsoftbus_root_path/core/adapter/bus_center/include", 182 "//commonlibrary/c_utils/base/include", 183 "//third_party/cJSON", 184 "unittest/common/", 185 "$dsoftbus_root_path/core/connection/manager", 186 "$dsoftbus_root_path/adapter/common/bus_center/include/", 187 "$dsoftbus_root_path/core/discovery/manager/include", 188 "$dsoftbus_root_path/core/discovery/interface", 189 "$dsoftbus_root_path/interfaces/kits/discovery", 190 "$dsoftbus_root_path/core/bus_center/service/include", 191 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 192 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 193 "$dsoftbus_root_path/core/transmission/interface", 194 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 195 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 196 "$dsoftbus_root_path/core/connection/p2p/interface", 197 "$dsoftbus_root_path/core/connection/p2p/common/include", 198 "$dsoftbus_root_path/core/connection/p2p/manager/include", 199 ] 200 201 deps = [ 202 "$dsoftbus_root_path/adapter:softbus_adapter", 203 "$dsoftbus_root_path/core/common:softbus_utils", 204 "$dsoftbus_root_path/core/frame:softbus_server", 205 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 206 "//base/security/device_auth/services:deviceauth_sdk", 207 "//third_party/googletest:gmock", 208 "//third_party/googletest:gtest_main", 209 ] 210 211 if (is_standard_system) { 212 external_deps = [ 213 "c_utils:utils", 214 "hiviewdfx_hilog_native:libhilog", 215 ] 216 } else { 217 external_deps = [ 218 "c_utils:utils", 219 "hilog:libhilog", 220 ] 221 } 222} 223 224ohos_unittest("LNNTestMock") { 225 module_out_path = module_output_path 226 sources = [ 227 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_connection_fsm.c", 228 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_devicename_info.c", 229 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_net_builder.c", 230 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_network_info.c", 231 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_node_weight.c", 232 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_p2p_info.c", 233 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_sync_info_manager.c", 234 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_topo_manager.c", 235 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_async_callback_utils.c", 236 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_connection_addr_utils.c", 237 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c", 238 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp", 239 "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_trans_mock.cpp", 240 "net_builder/src/lnn_auth_mock.cpp", 241 "net_builder/src/lnn_connection_fsm_test.cpp", 242 "net_builder/src/lnn_devicename_info_test.cpp", 243 "net_builder/src/lnn_net_builder_deps_mock.cpp", 244 "net_builder/src/lnn_net_ledger_mock.cpp", 245 "net_builder/src/lnn_network_info_test.cpp", 246 "net_builder/src/lnn_node_weight_test.cpp", 247 "net_builder/src/lnn_p2p_info_test.cpp", 248 "net_builder/src/lnn_service_mock.cpp", 249 "net_builder/src/lnn_sync_info_manager_test.cpp", 250 "net_builder/src/lnn_topo_manager_test.cpp", 251 ] 252 253 include_dirs = [ 254 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 255 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 256 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 257 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src", 258 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 259 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/sync_info/include", 260 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 261 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 262 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 263 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 264 "$dsoftbus_root_path/core/bus_center/monitor/include", 265 "$dsoftbus_root_path/core/common/include", 266 "$dsoftbus_root_path/adapter/common/include", 267 "$dsoftbus_root_path/core/connection/interface", 268 "$dsoftbus_root_path/core/connection/p2p/interface", 269 "$dsoftbus_root_path/core/connection/p2p/common/include", 270 "$dsoftbus_root_path/core/authentication/interface", 271 "$dsoftbus_root_path/core/bus_center/interface", 272 "$dsoftbus_root_path/core/bus_center/utils/include", 273 "$dsoftbus_root_path/interfaces/kits/bus_center", 274 "$dsoftbus_root_path/interfaces/kits/common", 275 "$dsoftbus_root_path/core/adapter/bus_center/include", 276 "//commonlibrary/c_utils/base/include", 277 "//third_party/cJSON", 278 "unittest/common/", 279 "$dsoftbus_root_path/core/connection/manager", 280 "$dsoftbus_root_path/adapter/common/bus_center/include/", 281 "$dsoftbus_root_path/core/discovery/manager/include", 282 "$dsoftbus_root_path/core/discovery/interface", 283 "$dsoftbus_root_path/interfaces/kits/discovery", 284 "$dsoftbus_root_path/core/bus_center/service/include", 285 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", 286 "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", 287 "$dsoftbus_root_path/core/transmission/interface", 288 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 289 "$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include", 290 "$dsoftbus_root_path/adapter/common/net/wifi/include", 291 "$dsoftbus_root_path/core/transmission/trans_channel/manager/include", 292 "$dsoftbus_root_path/core/bus_center/utils/include", 293 ] 294 295 deps = [ 296 "$dsoftbus_root_path/adapter:softbus_adapter", 297 "$dsoftbus_root_path/core/common:softbus_utils", 298 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 299 "//base/security/device_auth/services:deviceauth_sdk", 300 "//third_party/googletest:gmock", 301 "//third_party/googletest:gtest_main", 302 ] 303 304 if (is_standard_system) { 305 external_deps = [ 306 "c_utils:utils", 307 "hiviewdfx_hilog_native:libhilog", 308 ] 309 } else { 310 external_deps = [ 311 "c_utils:utils", 312 "hilog:libhilog", 313 ] 314 } 315} 316 317ohos_unittest("LNNLedgerTestMock") { 318 module_out_path = module_output_path 319 sources = [ 320 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_device_info.c", 321 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_net_ledger.c", 322 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_node_info.c", 323 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger.c", 324 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/src/lnn_local_net_ledger.c", 325 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_map.c", 326 "net_ledger/lnn_local_ledger_deps_mock.cpp", 327 "net_ledger/lnn_local_ledger_test.cpp", 328 ] 329 330 include_dirs = [ 331 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 332 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 333 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 334 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 335 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/sync_info/include", 336 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 337 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 338 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 339 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 340 "$dsoftbus_root_path/core/bus_center/monitor/include", 341 "$dsoftbus_root_path/core/common/include", 342 "$dsoftbus_root_path/adapter/common/include", 343 "$dsoftbus_root_path/core/connection/interface", 344 "$dsoftbus_root_path/core/connection/p2p/interface", 345 "$dsoftbus_root_path/core/connection/p2p/common/include", 346 "$dsoftbus_root_path/core/authentication/interface", 347 "$dsoftbus_root_path/core/bus_center/interface", 348 "$dsoftbus_root_path/core/bus_center/utils/include", 349 "$dsoftbus_root_path/interfaces/kits/bus_center", 350 "$dsoftbus_root_path/interfaces/kits/common", 351 "$dsoftbus_root_path/core/adapter/bus_center/include", 352 "//commonlibrary/c_utils/base/include", 353 "//third_party/cJSON", 354 "unittest/common/", 355 "$dsoftbus_root_path/core/connection/manager", 356 "$dsoftbus_root_path/adapter/common/bus_center/include/", 357 "$dsoftbus_root_path/core/discovery/manager/include", 358 "$dsoftbus_root_path/core/discovery/interface", 359 "$dsoftbus_root_path/interfaces/kits/discovery", 360 "$dsoftbus_root_path/core/bus_center/service/include", 361 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 362 "//base/security/huks/interfaces/innerkits/huks_standard/main/include", 363 ] 364 365 deps = [ 366 "$dsoftbus_root_path/adapter:softbus_adapter", 367 "$dsoftbus_root_path/core/common:softbus_utils", 368 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 369 "//base/security/device_auth/services:deviceauth_sdk", 370 "//third_party/googletest:gmock", 371 "//third_party/googletest:gtest_main", 372 ] 373 374 if (is_standard_system) { 375 external_deps = [ 376 "c_utils:utils", 377 "hiviewdfx_hilog_native:libhilog", 378 ] 379 } else { 380 external_deps = [ 381 "c_utils:utils", 382 "hilog:libhilog", 383 ] 384 } 385} 386 387ohos_unittest("LNNLedgerTest") { 388 module_out_path = module_output_path 389 sources = [ 390 "net_ledger/lnn_disctributed_net_ledger_test.cpp", 391 "net_ledger/lnn_ledger_common_test.cpp", 392 "net_ledger/lnn_meta_node_ledger_test.cpp", 393 ] 394 395 include_dirs = [ 396 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 397 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 398 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 399 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 400 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/sync_info/include", 401 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 402 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 403 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 404 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 405 "$dsoftbus_root_path/core/bus_center/monitor/include", 406 "$dsoftbus_root_path/core/common/include", 407 "$dsoftbus_root_path/adapter/common/include", 408 "$dsoftbus_root_path/core/connection/interface", 409 "$dsoftbus_root_path/core/connection/p2p/interface", 410 "$dsoftbus_root_path/core/connection/p2p/common/include", 411 "$dsoftbus_root_path/core/authentication/interface", 412 "$dsoftbus_root_path/core/bus_center/interface", 413 "$dsoftbus_root_path/core/bus_center/utils/include", 414 "$dsoftbus_root_path/interfaces/kits/bus_center", 415 "$dsoftbus_root_path/interfaces/kits/common", 416 "$dsoftbus_root_path/core/adapter/bus_center/include", 417 "//commonlibrary/c_utils/base/include", 418 "//third_party/cJSON", 419 "unittest/common/", 420 "$dsoftbus_root_path/core/connection/manager", 421 "$dsoftbus_root_path/adapter/common/bus_center/include/", 422 "$dsoftbus_root_path/core/discovery/manager/include", 423 "$dsoftbus_root_path/core/discovery/interface", 424 "$dsoftbus_root_path/interfaces/kits/discovery", 425 "$dsoftbus_root_path/core/bus_center/service/include", 426 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 427 "//base/security/huks/interfaces/innerkits/huks_standard/main/include", 428 ] 429 430 deps = [ 431 "$dsoftbus_root_path/adapter:softbus_adapter", 432 "$dsoftbus_root_path/core/common:softbus_utils", 433 "$dsoftbus_root_path/core/frame:softbus_server", 434 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 435 "//base/security/device_auth/services:deviceauth_sdk", 436 "//third_party/googletest:gmock", 437 "//third_party/googletest:gtest_main", 438 ] 439 if (dsoftbus_feature_lnn_net) { 440 sources += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger.c" ] 441 } else { 442 sources += [ "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/src/lnn_distributed_net_ledger_virtual.c" ] 443 } 444 if (is_standard_system) { 445 external_deps = [ 446 "c_utils:utils", 447 "hiviewdfx_hilog_native:libhilog", 448 ] 449 } else { 450 external_deps = [ 451 "c_utils:utils", 452 "hilog:libhilog", 453 ] 454 } 455} 456 457ohos_unittest("LNNLaneTestMock") { 458 module_out_path = module_output_path 459 sources = [ 460 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane.c", 461 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_common.c", 462 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link.c", 463 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_link_proc.c", 464 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_model.c", 465 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_score_virtual.c", 466 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_select.c", 467 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_select_rule.c", 468 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_trans_lane.c", 469 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_async_callback_utils.c", 470 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_map.c", 471 "lane/src/lnn_lane_deps_mock.cpp", 472 "lane/src/lnn_lane_test.cpp", 473 "lane/src/lnn_wifi_adpter_mock.cpp", 474 ] 475 476 include_dirs = [ 477 "lane/include", 478 "$dsoftbus_root_path/core/adapter/bus_center/include", 479 "$dsoftbus_root_path/core/authentication/interface", 480 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 481 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 482 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 483 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 484 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 485 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 486 "$dsoftbus_root_path/core/bus_center/interface", 487 "$dsoftbus_root_path/core/bus_center/utils/include", 488 "$dsoftbus_root_path/core/common/include", 489 "$dsoftbus_root_path/adapter/common/include", 490 "$dsoftbus_root_path/adapter/common/bus_center/include/", 491 "$dsoftbus_root_path/adapter/common/net/wifi/include", 492 "$dsoftbus_root_path/core/connection/interface", 493 "$dsoftbus_root_path/core/connection/p2p/interface", 494 "$dsoftbus_root_path/core/connection/p2p/common/include", 495 "$dsoftbus_root_path/core/discovery/manager/include", 496 "$dsoftbus_root_path/core/discovery/interface", 497 "$dsoftbus_root_path/interfaces/kits/common", 498 "//commonlibrary/c_utils/base/include", 499 "//foundation/communication/wifi/wifi/interfaces/kits/c", 500 "//foundation/communication/wifi/wifi/frameworks/native/include", 501 "//third_party/cJSON", 502 "unittest/common/", 503 ] 504 505 deps = [ 506 "$dsoftbus_root_path/adapter:softbus_adapter", 507 "$dsoftbus_root_path/core/common:softbus_utils", 508 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 509 "//base/security/device_auth/services:deviceauth_sdk", 510 "//third_party/googletest:gmock", 511 "//third_party/googletest:gtest_main", 512 ] 513 514 if (is_standard_system) { 515 external_deps = [ 516 "c_utils:utils", 517 "hiviewdfx_hilog_native:libhilog", 518 ] 519 } else { 520 external_deps = [ 521 "c_utils:utils", 522 "hilog:libhilog", 523 ] 524 } 525} 526 527native_source_path = rebase_path("$dsoftbus_root_path") 528dep_dir = "dsoftbus_enhance/core/bus_center/lnn/lane_hub" 529enhanced_test = exec_script("$dsoftbus_root_path/check_sub_module.py", 530 [ 531 "$native_source_path", 532 "$dep_dir", 533 ], 534 "value") 535 536if (!defined(ohos_lite) && enhanced_test) { 537 ohos_unittest("LNNDbTestMock") { 538 module_out_path = module_output_path 539 sources = [ 540 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_ctrl.c", 541 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_fsm.c", 542 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_strategy.c", 543 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/src/lnn_decision_db.c", 544 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c", 545 "net_ledger/lnn_decision_db_deps_mock.cpp", 546 "net_ledger/lnn_decision_db_test.cpp", 547 ] 548 549 include_dirs = [ 550 "$dsoftbus_root_path/core/authentication/include", 551 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 552 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 553 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 554 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 555 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/sync_info/include", 556 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 557 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 558 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 559 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 560 "$dsoftbus_root_path/core/bus_center/monitor/include", 561 "$dsoftbus_root_path/core/common/include", 562 "$dsoftbus_root_path/adapter/common/include", 563 "$dsoftbus_root_path/core/connection/interface", 564 "$dsoftbus_root_path/core/connection/p2p/interface", 565 "$dsoftbus_root_path/core/connection/p2p/common/include", 566 "$dsoftbus_root_path/core/authentication/interface", 567 "$dsoftbus_root_path/core/bus_center/interface", 568 "$dsoftbus_root_path/core/bus_center/utils/include", 569 "$dsoftbus_root_path/interfaces/kits/bus_center", 570 "$dsoftbus_root_path/interfaces/kits/common", 571 "$dsoftbus_root_path/core/adapter/bus_center/include", 572 "//commonlibrary/c_utils/base/include", 573 "//third_party/cJSON", 574 "unittest/common/", 575 "$dsoftbus_root_path/core/connection/manager", 576 "$dsoftbus_root_path/adapter/common/bus_center/include/", 577 "$dsoftbus_root_path/core/discovery/manager/include", 578 "$dsoftbus_root_path/core/discovery/interface", 579 "$dsoftbus_root_path/interfaces/kits/discovery", 580 "$dsoftbus_root_path/core/bus_center/service/include", 581 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 582 "//base/security/huks/interfaces/innerkits/huks_standard/main/include", 583 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 584 ] 585 586 deps = [ 587 "$dsoftbus_root_path/adapter:softbus_adapter", 588 "$dsoftbus_root_path/core/common:softbus_utils", 589 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 590 "//base/security/device_auth/services:deviceauth_sdk", 591 "//third_party/googletest:gmock", 592 "//third_party/googletest:gtest_main", 593 ] 594 595 if (is_standard_system) { 596 external_deps = [ 597 "c_utils:utils", 598 "hiviewdfx_hilog_native:libhilog", 599 ] 600 } else { 601 external_deps = [ 602 "c_utils:utils", 603 "hilog:libhilog", 604 ] 605 } 606 } 607} 608 609group("unittest") { 610 testonly = true 611 deps = [ 612 ":LNNLaneTestMock", 613 ":LNNLedgerTest", 614 ":LNNLedgerTestMock", 615 ":LNNNetBuilderMockTest", 616 ":LNNNetBuilderTest", 617 ":LNNTest", 618 ":LNNTestMock", 619 ] 620 if (!defined(ohos_lite) && enhanced_test) { 621 deps += [ ":LNNDbTestMock" ] 622 } 623 if (enhanced_test) { 624 deps += [ 625 "$dsoftbus_root_path/dsoftbus_enhance/test/core/bus_center/lnn/lane_hub/heartbeat:unittest", 626 "$dsoftbus_root_path/dsoftbus_enhance/test/core/bus_center/lnn/lane_hub/lane_channel_rating:unittest", 627 "$dsoftbus_root_path/dsoftbus_enhance/test/core/bus_center/lnn/unittest:unittest", 628 ] 629 } 630} 631