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