# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("../../../../dsoftbus.gni") module_output_path = "dsoftbus/LNN" dsoftbus_root_path = "../../../.." ohos_unittest("HeartBeatMediumTest") { module_out_path = module_output_path sources = [ "$dsoftbus_root_path/core/authentication/src/auth_deviceprofile_virtual.cpp", "$dsoftbus_root_path/core/authentication/src/auth_interface.c", "$dsoftbus_root_path/core/authentication/src/virtual/auth_device_common_key_virtual.c", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_cipherkey_manager_virtual.c", "$dsoftbus_root_path/core/bus_center/lnn/net_builder/src/lnn_device_info_recovery_virtual.c", "$dsoftbus_root_path/core/bus_center/utils/src/lnn_connection_addr_utils.c", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_medium_mgr_test.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp", ] include_dirs = [ "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", "$dsoftbus_root_path/core/connection/p2p/common/include", "$dsoftbus_root_path/core/connection/p2p/interface", "$dsoftbus_root_path/core/bus_center/service/include", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/authentication/include", "$dsoftbus_root_path/core/authentication/interface", "$dsoftbus_root_path/core/discovery/interface", "$dsoftbus_root_path/core/discovery/manager/include", "$dsoftbus_root_path/core/core/discovery/manager/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", "$dsoftbus_root_path/core/bus_center/interface", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", "$dsoftbus_root_path/core/bus_center/utils/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/adapter/bus_center/include", "$dsoftbus_root_path/adapter/common/include", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", "$dsoftbus_root_path/core/connection/wifi_direct", "$dsoftbus_root_path/adapter/common/net/bluetooth/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", ] deps = [ "$dsoftbus_root_path/adapter:softbus_adapter", "$dsoftbus_root_path/core/common:softbus_utils", "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "device_auth:deviceauth_sdk", "hilog:libhilog", ] } else { external_deps = [ "hilog:libhilog", "huks:libhukssdk", ] } external_deps += [ "c_utils:utils", "ipc:ipc_core", ] } ohos_unittest("HeartBeatFSMTest") { module_out_path = module_output_path sources = [ "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_deviceinfo_to_profile_virtual.c", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c", "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_fsm_test.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_mock.cpp", ] include_dirs = [ "$dsoftbus_root_path/core/connection/interface", "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", "$dsoftbus_root_path/core/connection/p2p/common/include", "$dsoftbus_root_path/core/connection/p2p/interface", "$dsoftbus_root_path/core/bus_center/service/include", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/authentication/include", "$dsoftbus_root_path/core/authentication/interface", "$dsoftbus_root_path/core/discovery/interface", "$dsoftbus_root_path/core/discovery/manager/include", "$dsoftbus_root_path/core/core/discovery/manager/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", "$dsoftbus_root_path/core/bus_center/interface", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", "$dsoftbus_root_path/core/bus_center/utils/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/adapter/bus_center/include", "$dsoftbus_root_path/adapter/common/include", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", "$dsoftbus_root_path/core/connection/wifi_direct", ] deps = [ "$dsoftbus_root_path/adapter:softbus_adapter", "$dsoftbus_root_path/core/common:softbus_utils", "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "c_utils:utils", "device_auth:deviceauth_sdk", "hilog:libhilog", ] } else { external_deps = [ "c_utils:utils", "hilog:libhilog", "huks:libhukssdk", ] } } ohos_unittest("HeartBeatStrategyTest") { module_out_path = module_output_path sources = [ "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_strategy_test.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_strategy_mock.cpp", ] include_dirs = [ "$dsoftbus_root_path/adapter/common/include", "$dsoftbus_root_path/core/adapter/bus_center/include", "$dsoftbus_root_path/core/authentication/interface", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/bus_center/interface", "$dsoftbus_root_path/core/bus_center/service/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/bus_center/utils/include", "$dsoftbus_root_path/core/discovery/interface", "$dsoftbus_root_path/core/discovery/manager/include", "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", ] deps = [ "$dsoftbus_root_path/adapter:softbus_adapter", "$dsoftbus_root_path/core/common:softbus_utils", "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "device_auth:deviceauth_sdk", "hilog:libhilog", ] } else { external_deps = [ "hilog:libhilog", "huks:libhukssdk", ] } external_deps += [ "c_utils:utils", "ipc:ipc_core", ] } ohos_unittest("HeartBeatUtilsTest") { module_out_path = module_output_path sources = [ "$dsoftbus_root_path/core/adapter/bus_center/src/lnn_deviceinfo_to_profile_virtual.c", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_ble_heartbeat_virtual.c", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_utils.c", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/src/lnn_feature_capability.c", "$dsoftbus_root_path/core/bus_center/utils/src/lnn_state_machine.c", "$dsoftbus_root_path/core/connection/wifi_direct/wifi_direct_manager_virtual.c", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/lnn_connection_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_utils_test.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_fsm_mock.cpp", ] include_dirs = [ "$dsoftbus_root_path/core/connection/interface", "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", "$dsoftbus_root_path/core/connection/p2p/common/include", "$dsoftbus_root_path/core/connection/p2p/interface", "$dsoftbus_root_path/core/bus_center/service/include", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/authentication/include", "$dsoftbus_root_path/core/authentication/interface", "$dsoftbus_root_path/core/discovery/interface", "$dsoftbus_root_path/core/discovery/manager/include", "$dsoftbus_root_path/core/core/discovery/manager/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", "$dsoftbus_root_path/core/bus_center/interface", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", "$dsoftbus_root_path/core/bus_center/utils/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/adapter/bus_center/include", "$dsoftbus_root_path/adapter/common/include", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", "$dsoftbus_root_path/core/connection/wifi_direct", ] deps = [ "$dsoftbus_root_path/adapter:softbus_adapter", "$dsoftbus_root_path/core/common:softbus_utils", "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "c_utils:utils", "device_auth:deviceauth_sdk", "hilog:libhilog", ] } else { external_deps = [ "c_utils:utils", "hilog:libhilog", "huks:libhukssdk", ] } } ohos_unittest("HeartBeatCtrlTest") { module_out_path = module_output_path sources = [ "$dsoftbus_root_path/core/bus_center/lnn/decision_center/src/lnn_decision_center_virtual.c", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src/lnn_heartbeat_ctrl.c", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/src/lnn_net_ledger_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter/lnn_ip_network_impl_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/mock_common/src/distribute_net_ledger_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/heartbeat/hb_ctrl_test.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_ctrl_deps_mock.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/hb_strategy_mock.cpp", ] include_dirs = [ "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/tests/core/bus_center/mock_common/include", "$dsoftbus_root_path/core/connection/p2p/common/include", "$dsoftbus_root_path/core/connection/p2p/interface", "$dsoftbus_root_path/core/bus_center/service/include", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_builder/mock", "$dsoftbus_root_path/core/authentication/include", "$dsoftbus_root_path/core/authentication/interface", "$dsoftbus_root_path/core/discovery/interface", "$dsoftbus_root_path/core/discovery/manager/include", "$dsoftbus_root_path/core/core/discovery/manager/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/src", "$dsoftbus_root_path/core/bus_center/interface", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", "$dsoftbus_root_path/core/bus_center/utils/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", "$dsoftbus_root_path/core/adapter/bus_center/include", "$dsoftbus_root_path/adapter/common/include", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", "$dsoftbus_root_path/core/connection/wifi_direct", "$dsoftbus_root_path/adapter/common/net/bluetooth/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", "$dsoftbus_root_path/core/bus_center/ipc/include", "$dsoftbus_root_path/tests/core/bus_center/lnn/net_buscenter", "$dsoftbus_root_path/adapter/common/net/bluetooth/broadcast/interface", ] deps = [ "$dsoftbus_root_path/adapter:softbus_adapter", "$dsoftbus_root_path/core/common:softbus_utils", "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "device_auth:deviceauth_sdk", "hilog:libhilog", ] } else { external_deps = [ "hilog:libhilog", "huks:libhukssdk", ] } external_deps += [ "c_utils:utils", "ipc:ipc_core", ] } ohos_unittest("ClientProxyTest") { module_out_path = "dsoftbus/bus_center" sources = [ "$dsoftbus_root_path/tests/core/bus_center/test/ipc/client_proxy_test.cpp", ] include_dirs = [ "$dsoftbus_root_path/adapter/common/include", "$dsoftbus_root_path/core/bus_center/ipc/standard/include", "$dsoftbus_root_path/sdk/frame/standard/include", "$dsoftbus_root_path/interfaces/kits/discovery", "$dsoftbus_root_path/interfaces/kits/transport", "$dsoftbus_root_path/core/frame/standard/init/include", "$dsoftbus_root_path/core/frame/standard/client_manager/include", "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/core/frame/common/include", "../../transmission/ipc/samgr/interfaces/innerkits/samgr_proxy/include", "//foundation/window/window_manager/previewer/mock", "//foundation/communication/ipc/interfaces/innerkits/c/ipc/include", "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include", "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include/", ] deps = [ "$dsoftbus_root_path/adapter:softbus_adapter", "$dsoftbus_root_path/core/common:softbus_utils", "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", "$dsoftbus_root_path/core/frame:softbus_server", "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "c_utils:utils", "device_auth:deviceauth_sdk", "hilog:libhilog", "samgr:samgr_proxy", ] } else { external_deps = [ "c_utils:utils", "hilog:libhilog", "huks:libhukssdk", "samgr:samgr_proxy", ] } } ohos_unittest("BusCenterIpcTest") { module_out_path = module_output_path sources = [ "$dsoftbus_root_path/tests/core/bus_center/test/ipc/bus_center_ipc_test.cpp", "$dsoftbus_root_path/tests/core/bus_center/test/mock/src/bus_center_ipc_mock.cpp", ] include_dirs = [ "$dsoftbus_root_path/core/common/include", "$dsoftbus_root_path/tests/core/bus_center/test/mock/include", "$dsoftbus_root_path/core/bus_center/service/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", "$dsoftbus_root_path/core/authentication/interface", "$dsoftbus_root_path/core/discovery/manager/include", "$dsoftbus_root_path/core/bus_center/ipc/include", "$dsoftbus_root_path/core/bus_center/ipc/standard/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/discovery/interface", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/time_sync/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", "$dsoftbus_root_path/core/bus_center/interface", "$dsoftbus_root_path/core/bus_center/ipc/standard/src", "$dsoftbus_root_path/core/bus_center/utils/include", "$dsoftbus_root_path/core/bus_center/ipc/standard/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include", ] deps = [ "$dsoftbus_root_path/adapter:softbus_adapter", "$dsoftbus_root_path/core/common:softbus_utils", "$dsoftbus_root_path/core/common/dfx/log:softbus_dfx_log", "//foundation/communication/ipc/interfaces/innerkits/ipc_core:ipc_core", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "c_utils:utils", "device_auth:deviceauth_sdk", "hilog:libhilog", ] } else { external_deps = [ "c_utils:utils", "hilog:libhilog", "huks:libhukssdk", ] } } group("unittest") { testonly = true deps = [ ":BusCenterIpcTest", ":ClientProxyTest", ":HeartBeatCtrlTest", ":HeartBeatFSMTest", ":HeartBeatMediumTest", ":HeartBeatStrategyTest", ] }