1# Copyright (c) 2021-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/connection" 18dsoftbus_root_path = "../../../.." 19softbus_adapter_common = "${dsoftbus_root_path}/adapter/common" 20 21config("softbus_connection_br_test_config") { 22 include_dirs = [ 23 "$dsoftbus_root_path/core/adapter/br/include", 24 "$dsoftbus_root_path/core/authentication/interface", 25 "$dsoftbus_root_path/core/bus_center/interface", 26 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 27 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 28 "$dsoftbus_root_path/core/bus_center/service/include", 29 "$dsoftbus_root_path/core/common/include", 30 "$dsoftbus_root_path/core/common/softbus_property", 31 "$dsoftbus_root_path/core/connection/ble/include", 32 "$dsoftbus_root_path/core/connection/br/include", 33 "$dsoftbus_root_path/core/connection/br/src", 34 "$dsoftbus_root_path/core/connection/interface", 35 "$dsoftbus_root_path/core/connection/manager", 36 "$dsoftbus_root_path/core/connection/tcp/include", 37 "$dsoftbus_root_path/core/discovery/interface", 38 "$dsoftbus_root_path/core/discovery/manager/include", 39 "$dsoftbus_root_path/core/frame/common/include", 40 "$dsoftbus_root_path/core/frame/init/include", 41 "$dsoftbus_root_path/interfaces/kits/authentication", 42 "$dsoftbus_root_path/interfaces/kits/bus_center", 43 "$dsoftbus_root_path/interfaces/kits/common", 44 "$dsoftbus_root_path/interfaces/kits/connect", 45 "$dsoftbus_root_path/interfaces/kits/disc", 46 "$dsoftbus_root_path/interfaces/kits/discovery", 47 "$dsoftbus_root_path/interfaces/kits/lnn", 48 "$dsoftbus_root_path/tests/core/connection/br/mock", 49 "$dsoftbus_root_path/tests/interfaces/enhance", 50 "$softbus_adapter_common/include", 51 "$softbus_adapter_common/net/bluetooth/include", 52 ] 53} 54 55ohos_unittest("BrConnTest") { 56 module_out_path = module_output_path 57 public_configs = [ ":softbus_connection_br_test_config" ] 58 deps = [ 59 "$dsoftbus_root_path/adapter:softbus_adapter", 60 "$dsoftbus_root_path/core/common:softbus_utils", 61 "$dsoftbus_root_path/core/frame:softbus_server", 62 ] 63 64 external_deps = [ 65 "bluetooth:btframework", 66 "bounds_checking_function:libsec_shared", 67 "c_utils:utils", 68 "googletest:gmock", 69 "hilog:libhilog", 70 ] 71 sources = [ 72 "$dsoftbus_root_path/tests/core/connection/br/mock/softbus_conn_br_manager_mock.cpp", 73 "softbus_conn_br_manager_test.cpp", 74 "$dsoftbus_root_path/core/frame/common/src/softbus_init_common.c", 75 ] 76 include_dirs = [ 77 "$dsoftbus_dfx_path/interface/include/form", 78 "$dsoftbus_root_path/core/frame/common/include", 79 ] 80} 81 82ohos_unittest("ConnectionBrTest") { 83 module_out_path = module_output_path 84 public_configs = [ ":softbus_connection_br_test_config" ] 85 deps = [ 86 "$dsoftbus_root_path/adapter:softbus_adapter", 87 "$dsoftbus_root_path/core/common:softbus_utils", 88 "$dsoftbus_root_path/core/frame:softbus_server", 89 ] 90 91 external_deps = [ 92 "bluetooth:btframework", 93 "bounds_checking_function:libsec_shared", 94 "c_utils:utils", 95 "googletest:gmock", 96 "hilog:libhilog", 97 ] 98 sources = [ 99 "$dsoftbus_root_path/tests/core/connection/br/mock/softbus_conn_br_manager_mock.cpp", 100 "softbus_conn_br_trans_test.cpp", 101 ] 102} 103 104ohos_unittest("BrConnectionTest") { 105 module_out_path = module_output_path 106 107 include_dirs = [ 108 "$dsoftbus_dfx_path/interface/include/form", 109 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 110 "$dsoftbus_root_path/core/adapter/br/include", 111 "$dsoftbus_root_path/core/authentication/interface", 112 "$dsoftbus_root_path/core/bus_center/interface", 113 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 114 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 115 "$dsoftbus_root_path/core/bus_center/service/include", 116 "$dsoftbus_root_path/core/connection/ble/include", 117 "$dsoftbus_root_path/core/connection/br/include", 118 "$dsoftbus_root_path/core/connection/common/include", 119 "$dsoftbus_root_path/interfaces/kits/adapter", 120 "$dsoftbus_root_path/interfaces/kits/authentication", 121 "$dsoftbus_root_path/interfaces/kits/bus_center", 122 "$dsoftbus_root_path/interfaces/kits/connect", 123 "$dsoftbus_root_path/interfaces/kits/lnn", 124 "$dsoftbus_root_path/tests/core/connection/br/mock", 125 ] 126 127 deps = [ 128 "$dsoftbus_root_path/adapter:softbus_adapter", 129 "$dsoftbus_root_path/core/common:softbus_utils", 130 "$dsoftbus_root_path/dfx:softbus_dfx", 131 ] 132 133 external_deps = [ 134 "bluetooth:btframework", 135 "bounds_checking_function:libsec_shared", 136 "c_utils:utils", 137 "googletest:gmock", 138 "hilog:libhilog", 139 ] 140 sources = [ 141 "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_connection.c", 142 "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_manager.c", 143 "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_trans.c", 144 "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c", 145 "$dsoftbus_root_path/tests/core/connection/br/mock/softbus_conn_br_connection_mock.cpp", 146 "softbus_conn_br_connection_test.cpp", 147 ] 148} 149 150ohos_unittest("BrHidumperTest") { 151 module_out_path = module_output_path 152 153 public_configs = [ ":softbus_connection_br_test_config" ] 154 155 include_dirs = [ 156 "$dsoftbus_dfx_path/interface/include/form", 157 "$dsoftbus_root_path/adapter/common/net/bluetooth/include", 158 "$dsoftbus_root_path/core/adapter/br/include", 159 "$dsoftbus_root_path/core/authentication/interface", 160 "$dsoftbus_root_path/core/bus_center/interface", 161 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 162 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", 163 "$dsoftbus_root_path/core/bus_center/service/include", 164 "$dsoftbus_root_path/core/connection/ble/include", 165 "$dsoftbus_root_path/core/connection/br/include", 166 "$dsoftbus_root_path/core/connection/common/include", 167 "$dsoftbus_root_path/interfaces/kits/bus_center", 168 "$dsoftbus_root_path/tests/core/connection/br/mock", 169 ] 170 171 deps = [ 172 "$dsoftbus_root_path/adapter:softbus_adapter", 173 "$dsoftbus_root_path/core/common:softbus_utils", 174 "$dsoftbus_root_path/core/frame:softbus_server", 175 ] 176 177 external_deps = [ 178 "bluetooth:btframework", 179 "bounds_checking_function:libsec_shared", 180 "c_utils:utils", 181 "googletest:gmock", 182 "hilog:libhilog", 183 ] 184 sources = [ 185 "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_connection.c", 186 "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_manager.c", 187 "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_snapshot.c", 188 "$dsoftbus_root_path/core/connection/br/src/softbus_conn_br_trans.c", 189 "$dsoftbus_root_path/core/connection/manager/softbus_conn_flow_control.c", 190 "$dsoftbus_root_path/tests/core/connection/br/mock/softbus_conn_br_connection_mock.cpp", 191 "connection_br_hidumper_test.cpp", 192 ] 193} 194 195group("unittest") { 196 testonly = true 197 deps = [ ":BrConnectionTest" ] 198} 199