1# Copyright (c) 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("../../../../core/authentication/authentication.gni") 16import("../../../../dsoftbus.gni") 17 18module_output_path = "dsoftbus/bus_center" 19dsoftbus_root_path = "../../../.." 20 21ohos_unittest("BusCenterDecisionTest") { 22 module_out_path = module_output_path 23 sources = [ 24 "unittest/bus_center_decision_center_deps_mock.cpp", 25 "unittest/bus_center_decision_center_test.cpp", 26 ] 27 28 include_dirs = [ 29 "$dsoftbus_dfx_path/interface/include", 30 "$dsoftbus_root_path/core/bus_center/service/include", 31 "$dsoftbus_root_path/core/bus_center/service/unittest", 32 "$dsoftbus_root_path/core/common/include", 33 "$dsoftbus_root_path/core/connection/interface", 34 "$dsoftbus_root_path/core/bus_center/interface", 35 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 36 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 37 "$dsoftbus_root_path/adapter/common/include", 38 "$dsoftbus_root_path/core/common/include", 39 "$dsoftbus_root_path/interfaces/kits/bus_center", 40 "$dsoftbus_root_path/adapter/common/bus_center/include", 41 "$dsoftbus_root_path/adapter/common/bus_center/wlan", 42 "$dsoftbus_root_path/core/bus_center/utils/include", 43 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 44 "$dsoftbus_root_path/core/discovery/manager/include", 45 "$dsoftbus_root_path/core/discovery/interface", 46 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 47 "$dsoftbus_root_path/core/authentication/interface", 48 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 49 ] 50 51 deps = [ 52 "$dsoftbus_root_path/adapter:softbus_adapter", 53 "$dsoftbus_root_path/core/common:softbus_utils", 54 "$dsoftbus_root_path/core/frame:softbus_server", 55 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 56 ] 57 58 if (is_standard_system) { 59 external_deps = [ 60 "bounds_checking_function:libsec_shared", 61 "c_utils:utils", 62 "dsoftbus:softbus_client", 63 "googletest:gmock_main", 64 "googletest:gtest_main", 65 "hilog:libhilog", 66 ] 67 } else { 68 external_deps = [ 69 "bounds_checking_function:libsec_shared", 70 "c_utils:utils", 71 "dsoftbus:softbus_client", 72 "googletest:gmock_main", 73 "googletest:gtest_main", 74 "hilog:libhilog", 75 ] 76 } 77} 78 79ohos_unittest("BusCenterEventTest") { 80 module_out_path = module_output_path 81 sources = [ 82 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_change_channel_virtual.c", 83 "$dsoftbus_root_path/core/bus_center/service/src/bus_center_event.c", 84 "unittest/bus_center_event_deps_mock.cpp", 85 "unittest/bus_center_event_test.cpp", 86 ] 87 88 include_dirs = [ 89 "$dsoftbus_dfx_path/interface/include", 90 "$dsoftbus_root_path/core/adapter/bus_center/include", 91 "$dsoftbus_root_path/core/bus_center/service/include", 92 "$dsoftbus_root_path/core/bus_center/service/unittest", 93 "$dsoftbus_root_path/core/common/include", 94 "$dsoftbus_root_path/core/connection/interface", 95 "$dsoftbus_root_path/core/bus_center/interface", 96 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 97 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 98 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 99 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", 100 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/common/include", 101 "$dsoftbus_root_path/adapter/common/include", 102 "$dsoftbus_root_path/core/common/include", 103 "$dsoftbus_root_path/interfaces/kits/bus_center", 104 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 105 "$dsoftbus_root_path/interfaces/kits/discovery", 106 "$dsoftbus_root_path/adapter/common/bus_center/include", 107 "$dsoftbus_root_path/core/bus_center/utils/include", 108 "$dsoftbus_root_path/core/discovery/manager/include", 109 "$dsoftbus_root_path/core/discovery/interface", 110 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 111 "$dsoftbus_root_path/core/authentication/interface", 112 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 113 "$dsoftbus_root_path/core/bus_center/ipc/include/", 114 "$dsoftbus_root_path/core/transmission/trans_channel/qos/interface/", 115 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include/", 116 ] 117 118 deps = [ 119 "$dsoftbus_root_path/adapter:softbus_adapter", 120 "$dsoftbus_root_path/core/common:softbus_utils", 121 "$dsoftbus_root_path/core/frame:softbus_server", 122 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 123 ] 124 125 bus_center_event_test_external_deps = [ 126 "c_utils:utils", 127 "hilog:libhilog", 128 ] 129 130 if (is_standard_system) { 131 bus_center_event_test_external_deps += [ 132 "bounds_checking_function:libsec_shared", 133 "googletest:gmock_main", 134 "googletest:gtest_main", 135 "huks:libhukssdk", 136 ] 137 } 138 external_deps = bus_center_event_test_external_deps 139} 140 141ohos_unittest("BusCenterManagerTest") { 142 module_out_path = module_output_path 143 sources = [ 144 "$dsoftbus_root_path/core/authentication/src/auth_pre_link.c", 145 "$dsoftbus_root_path/core/bus_center/service/src/bus_center_manager.c", 146 "unittest/bus_center_manager_deps_mock.cpp", 147 "unittest/bus_center_manager_test.cpp", 148 ] 149 150 if (!enhanced) { 151 sources += [ 152 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_change_channel_virtual.c", 153 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/src/lnn_lane_prelink_virtual.c", 154 ] 155 } 156 157 include_dirs = [ 158 "$dsoftbus_dfx_path/interface/include", 159 "$dsoftbus_root_path/core/adapter/bus_center/include", 160 "$dsoftbus_root_path/core/bus_center/service/include", 161 "$dsoftbus_root_path/core/bus_center/service/unittest", 162 "$dsoftbus_root_path/core/common/include", 163 "$dsoftbus_root_path/core/connection/interface", 164 "$dsoftbus_root_path/core/bus_center/interface", 165 "$dsoftbus_root_path/core/bus_center/lnn/meta_node/include", 166 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 167 "$dsoftbus_root_path/core/bus_center/lnn/net_builder/include", 168 "$dsoftbus_root_path/core/bus_center/lnn/net_buscenter/include", 169 "$dsoftbus_root_path/core/bus_center/lnn/decision_center/include", 170 "$dsoftbus_root_path/core/bus_center/lnn/disc_mgr/include", 171 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/common/include", 172 "$dsoftbus_root_path/core/bus_center/monitor/include", 173 "$dsoftbus_root_path/adapter/common/include", 174 "$dsoftbus_root_path/core/common/include", 175 "$dsoftbus_root_path/interfaces/kits/bus_center", 176 "$dsoftbus_root_path/interfaces/inner_kits/lnn", 177 "$dsoftbus_root_path/interfaces/kits/discovery", 178 "$dsoftbus_root_path/adapter/common/bus_center/include", 179 "$dsoftbus_root_path/adapter/common/bus_center/wlan", 180 "$dsoftbus_root_path/core/bus_center/utils/include", 181 "$dsoftbus_root_path/core/discovery/manager/include", 182 "$dsoftbus_root_path/core/discovery/interface", 183 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include", 184 "$dsoftbus_root_path/core/authentication/interface", 185 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 186 "$dsoftbus_root_path/core/authentication/include", 187 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/decision_db/include", 188 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 189 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/local_ledger/include", 190 ] 191 192 deps = [ 193 "$dsoftbus_root_path/adapter:softbus_adapter", 194 "$dsoftbus_root_path/core/common:softbus_utils", 195 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 196 ] 197 198 bus_center_manager_test_external_deps = [ 199 "c_utils:utils", 200 "hilog:libhilog", 201 ] 202 203 if (is_standard_system) { 204 bus_center_manager_test_external_deps += [ 205 "bounds_checking_function:libsec_shared", 206 "googletest:gmock_main", 207 "googletest:gtest_main", 208 "huks:libhukssdk", 209 ] 210 } 211 external_deps = bus_center_manager_test_external_deps 212} 213group("unittest") { 214 testonly = true 215 216 deps = [ 217 ":BusCenterDecisionTest", 218 ":BusCenterEventTest", 219 ":BusCenterManagerTest", 220 ] 221} 222