1# Copyright (c) 2022-2025 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/test.gni") 15import("../../../../dsoftbus.gni") 16 17module_output_path = "dsoftbus/soft_bus/LNN" 18dsoftbus_root_path = "../../../.." 19 20ohos_unittest("LNNConnAddrUtilsTest") { 21 module_out_path = module_output_path 22 sources = [ "lnn_bus_center_utils_test.cpp" ] 23 include_dirs = [ 24 "$dsoftbus_dfx_path/interface/include/form", 25 "$dsoftbus_root_path/adapter/common/bus_center/include/", 26 "$dsoftbus_root_path/adapter/common/include", 27 "$dsoftbus_root_path/core/adapter/bus_center/include", 28 "$dsoftbus_root_path/core/authentication/interface", 29 "$dsoftbus_root_path/core/bus_center/interface", 30 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 31 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/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_builder/sync_info/include", 35 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 36 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 37 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 38 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 39 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 40 "$dsoftbus_root_path/core/bus_center/monitor/include", 41 "$dsoftbus_root_path/core/bus_center/service/include", 42 "$dsoftbus_root_path/core/bus_center/utils/include", 43 "$dsoftbus_root_path/core/common/include", 44 "$dsoftbus_root_path/core/connection/interface", 45 "$dsoftbus_root_path/core/connection/manager", 46 "$dsoftbus_root_path/core/connection/p2p/common/include", 47 "$dsoftbus_root_path/core/connection/p2p/interface", 48 "$dsoftbus_root_path/core/discovery/interface", 49 "$dsoftbus_root_path/core/discovery/manager/include", 50 "$dsoftbus_root_path/interfaces/kits/authentication", 51 "$dsoftbus_root_path/interfaces/kits/bus_center", 52 "$dsoftbus_root_path/interfaces/kits/common", 53 "$dsoftbus_root_path/interfaces/kits/connect", 54 "$dsoftbus_root_path/interfaces/kits/disc", 55 "$dsoftbus_root_path/interfaces/kits/discovery", 56 "$dsoftbus_root_path/interfaces/kits/lnn", 57 "unittest/common/", 58 ] 59 deps = [ 60 "$dsoftbus_dfx_path:softbus_dfx", 61 "$dsoftbus_root_path/adapter:softbus_adapter", 62 "$dsoftbus_root_path/core/common:softbus_utils", 63 "$dsoftbus_root_path/core/frame:softbus_server", 64 ] 65 if (is_standard_system) { 66 external_deps = [ 67 "c_utils:utils", 68 "device_auth:deviceauth_sdk", 69 "googletest:gmock", 70 "googletest:gtest_main", 71 "hilog:libhilog", 72 ] 73 } else { 74 external_deps = [ 75 "c_utils:utils", 76 "googletest:gmock", 77 "googletest:gtest_main", 78 "hilog:libhilog", 79 "huks:libhukssdk", 80 ] 81 } 82} 83 84ohos_unittest("LNNFileUtilsTest") { 85 module_out_path = module_output_path 86 sources = [ 87 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_ledger/lnn_decision_db_deps_mock.cpp", 88 "lnn_file_utils_test.cpp", 89 ] 90 include_dirs = [ 91 "$dsoftbus_dfx_path/interface/include/form", 92 "$dsoftbus_root_path/adapter/common/include", 93 "$dsoftbus_root_path/core/authentication/interface", 94 "$dsoftbus_root_path/core/bus_center/interface", 95 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 96 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 97 "$dsoftbus_root_path/core/bus_center/service/include", 98 "$dsoftbus_root_path/core/bus_center/utils/include", 99 "$dsoftbus_root_path/core/common/include", 100 "$dsoftbus_root_path/core/discovery/interface", 101 "$dsoftbus_root_path/core/discovery/manager/include", 102 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 103 "$dsoftbus_root_path/interfaces/kits/bus_center", 104 "$dsoftbus_root_path/interfaces/kits/common", 105 "$dsoftbus_root_path/interfaces/kits/discovery", 106 "$dsoftbus_root_path/interfaces/kits/lnn", 107 "$dsoftbus_root_path/tests/core/bus_center/lnn/net_ledger", 108 "unittest/common/", 109 ] 110 deps = [ 111 "$dsoftbus_dfx_path:softbus_dfx", 112 "$dsoftbus_root_path/adapter:softbus_adapter", 113 "$dsoftbus_root_path/core/common:softbus_utils", 114 "$dsoftbus_root_path/core/frame:softbus_server", 115 ] 116 if (is_standard_system) { 117 external_deps = [ 118 "c_utils:utils", 119 "device_auth:deviceauth_sdk", 120 "googletest:gmock", 121 "googletest:gtest_main", 122 "hilog:libhilog", 123 "huks:libhukssdk", 124 ] 125 } else { 126 external_deps = [ 127 "c_utils:utils", 128 "googletest:gmock", 129 "googletest:gtest_main", 130 "hilog:libhilog", 131 "huks:libhukssdk", 132 ] 133 } 134} 135 136ohos_unittest("BusCenterUtilsTest") { 137 module_out_path = module_output_path 138 sources = [ 139 "$dsoftbus_root_path/core/bus_center/utils/src/lnn_compress.c", 140 "bus_center_utils_mock.cpp", 141 "bus_center_utils_test.cpp", 142 ] 143 include_dirs = [ 144 "$dsoftbus_dfx_path/interface/include/form", 145 "$dsoftbus_root_path/adapter/common/include", 146 "$dsoftbus_root_path/core/bus_center/interface", 147 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 148 "$dsoftbus_root_path/core/bus_center/utils/include", 149 "$dsoftbus_root_path/core/bus_center/utils/src", 150 "$dsoftbus_root_path/interfaces/kits/common", 151 "$dsoftbus_root_path/tests/core/bus_center/utils", 152 ] 153 deps = [ 154 "$dsoftbus_dfx_path:softbus_dfx", 155 "$dsoftbus_root_path/adapter:softbus_adapter", 156 "$dsoftbus_root_path/core/common:softbus_utils", 157 "$dsoftbus_root_path/core/frame:softbus_server", 158 ] 159 external_deps = [ 160 "bounds_checking_function:libsec_static", 161 "c_utils:utils", 162 "dsoftbus:softbus_client", 163 "googletest:gmock", 164 "googletest:gtest_main", 165 "hilog:libhilog", 166 "zlib:libz", 167 ] 168} 169 170group("unittest") { 171 testonly = true 172 deps = [ 173 ":BusCenterUtilsTest", 174 ":LNNConnAddrUtilsTest", 175 ":LNNFileUtilsTest", 176 ] 177} 178