1# Copyright (c) 2022-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/common/dfx/dsoftbus_dfx.gni") 16import("../../../../dsoftbus.gni") 17 18module_output_path = "dsoftbus/transmission" 19dsoftbus_root_path = "../../../.." 20 21ohos_unittest("TransClientSessionManagerTest") { 22 module_out_path = module_output_path 23 sources = [ "client_trans_session_manager_test.cpp" ] 24 25 include_dirs = [ 26 "$dsoftbus_root_path/core/common/include", 27 "$dsoftbus_root_path/core/frame/common/include", 28 "$dsoftbus_root_path/core/transmission/common/include", 29 "$dsoftbus_root_path/sdk/transmission/session/include", 30 "$dsoftbus_root_path/core/authentication/interface", 31 "$dsoftbus_root_path/core/bus_center/interface", 32 "$dsoftbus_root_path/core/transmission/session/include", 33 "$dsoftbus_root_path/core/connection/interface", 34 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 35 "$dsoftbus_root_path/core/discovery/manager/include", 36 "$dsoftbus_root_path/core/discovery/interface", 37 ] 38 39 deps = [ 40 "$dsoftbus_dfx_path/log:softbus_dfx_log", 41 "$dsoftbus_root_path/core/common:softbus_utils", 42 "$dsoftbus_root_path/core/frame:softbus_server", 43 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 44 ] 45 46 if (is_standard_system) { 47 external_deps = [ 48 "c_utils:utils", 49 "hilog:libhilog", 50 ] 51 } else { 52 external_deps = [ 53 "c_utils:utils", 54 "hilog:libhilog", 55 ] 56 } 57} 58 59ohos_unittest("TransClientSessionServiceTest") { 60 module_out_path = module_output_path 61 sources = [ "client_trans_session_service_test.cpp" ] 62 63 include_dirs = [ 64 "$dsoftbus_root_path/core/common/include", 65 "$dsoftbus_root_path/core/frame/common/include", 66 "$dsoftbus_root_path/core/transmission/common/include", 67 "$dsoftbus_root_path/sdk/transmission/session/include", 68 "$dsoftbus_root_path/adapter/default_config/spec_config", 69 "$dsoftbus_root_path/core/connection/interface", 70 "$dsoftbus_root_path/core/authentication/interface", 71 "$dsoftbus_root_path/core/bus_center/interface", 72 "$dsoftbus_root_path/core/transmission/session/include", 73 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 74 "$dsoftbus_root_path/core/discovery/manager/include", 75 "$dsoftbus_root_path/core/discovery/interface", 76 ] 77 78 deps = [ 79 "$dsoftbus_dfx_path/log:softbus_dfx_log", 80 "$dsoftbus_root_path/core/common:softbus_utils", 81 "$dsoftbus_root_path/core/frame:softbus_server", 82 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 83 ] 84 85 if (is_standard_system) { 86 external_deps = [ 87 "c_utils:utils", 88 "hilog:libhilog", 89 ] 90 } else { 91 external_deps = [ 92 "c_utils:utils", 93 "hilog:libhilog", 94 ] 95 } 96} 97 98ohos_unittest("TransClientSessionCallbackTest") { 99 module_out_path = module_output_path 100 sources = [ "client_trans_session_callback_test.cpp" ] 101 102 include_dirs = [ 103 "$dsoftbus_root_path/core/common/include", 104 "$dsoftbus_root_path/core/frame/common/include", 105 "$dsoftbus_root_path/core/transmission/common/include", 106 "$dsoftbus_root_path/sdk/transmission/session/include", 107 "$dsoftbus_root_path/adapter/default_config/spec_config", 108 "$dsoftbus_root_path/sdk/transmission/session/src", 109 "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include", 110 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 111 "$dsoftbus_root_path/core/connection/interface", 112 "$dsoftbus_root_path/core/authentication/interface", 113 "$dsoftbus_root_path/core/bus_center/interface", 114 "$dsoftbus_root_path/core/transmission/session/include", 115 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 116 "$dsoftbus_root_path/core/discovery/manager/include", 117 "$dsoftbus_root_path/core/discovery/interface", 118 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 119 ] 120 121 deps = [ 122 "$dsoftbus_dfx_path/log:softbus_dfx_log", 123 "$dsoftbus_root_path/core/common:softbus_utils", 124 "$dsoftbus_root_path/core/frame:softbus_server", 125 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 126 ] 127 128 if (is_standard_system) { 129 external_deps = [ 130 "c_utils:utils", 131 "hilog:libhilog", 132 ] 133 } else { 134 external_deps = [ 135 "c_utils:utils", 136 "hilog:libhilog", 137 ] 138 } 139} 140 141ohos_unittest("TransClientMsgServiceTest") { 142 module_out_path = module_output_path 143 sources = [ "client_trans_message_service_test.cpp" ] 144 145 include_dirs = [ 146 "$dsoftbus_root_path/core/common/include", 147 "$dsoftbus_root_path/core/frame/common/include", 148 "$dsoftbus_root_path/core/transmission/common/include", 149 "$dsoftbus_root_path/sdk/transmission/session/include", 150 "$dsoftbus_root_path/sdk/transmission/session/src", 151 "$dsoftbus_root_path/interfaces/inner_kits/transport", 152 "$dsoftbus_root_path/sdk/transmission/trans_channel/statistics/include", 153 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 154 "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include", 155 "$dsoftbus_root_path/sdk/frame/common/include", 156 "$dsoftbus_root_path/tests/sdk/common/include", 157 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 158 "$dsoftbus_root_path/core/connection/interface", 159 "$dsoftbus_root_path/core/authentication/interface", 160 "$dsoftbus_root_path/core/bus_center/interface", 161 "$dsoftbus_root_path/core/transmission/session/include", 162 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 163 "$dsoftbus_root_path/core/discovery/manager/include", 164 "$dsoftbus_root_path/core/discovery/interface", 165 ] 166 167 deps = [ 168 "$dsoftbus_dfx_path/log:softbus_dfx_log", 169 "$dsoftbus_root_path/core/common:softbus_utils", 170 "$dsoftbus_root_path/core/frame:softbus_server", 171 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 172 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 173 ] 174 175 if (is_standard_system) { 176 external_deps = [ 177 "c_utils:utils", 178 "hilog:libhilog", 179 ] 180 } else { 181 external_deps = [ 182 "c_utils:utils", 183 "hilog:libhilog", 184 ] 185 } 186} 187 188ohos_unittest("TransClientSessionTest") { 189 module_out_path = module_output_path 190 sources = [ "client_trans_session_test.cpp" ] 191 192 include_dirs = [ 193 "$dsoftbus_root_path/core/common/include", 194 "$dsoftbus_root_path/core/frame/common/include", 195 "$dsoftbus_root_path/core/transmission/common/include", 196 "$dsoftbus_root_path/sdk/transmission/session/include", 197 "$dsoftbus_root_path/sdk/transmission/session/src", 198 "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include", 199 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 200 "$dsoftbus_root_path/sdk/transmission/trans_channel/qos/include", 201 "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include", 202 "$dsoftbus_root_path/sdk/frame/common/include", 203 "$dsoftbus_root_path/sdk/transmission/ipc/include", 204 "$dsoftbus_root_path/tests/sdk/common/include", 205 "$dsoftbus_root_path/interfaces/kits/common", 206 "$dsoftbus_root_path/sdk/bus_center/manager/include", 207 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include", 208 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 209 "$dsoftbus_root_path/core/connection/interface", 210 "$dsoftbus_root_path/core/authentication/interface", 211 "$dsoftbus_root_path/core/bus_center/interface", 212 "$dsoftbus_root_path/core/transmission/session/include", 213 "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/common/include", 214 "$dsoftbus_root_path/core/discovery/manager/include", 215 "$dsoftbus_root_path/core/discovery/interface", 216 ] 217 218 deps = [ 219 "$dsoftbus_dfx_path/log:softbus_dfx_log", 220 "$dsoftbus_root_path/core/common:softbus_utils", 221 "$dsoftbus_root_path/core/frame:softbus_server", 222 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 223 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 224 ] 225 226 if (is_standard_system) { 227 external_deps = [ 228 "access_token:libtoken_setproc", 229 "c_utils:utils", 230 "hilog:libhilog", 231 ] 232 } else { 233 external_deps = [ 234 "c_utils:utils", 235 "hilog:libhilog", 236 ] 237 } 238} 239 240ohos_unittest("TransClientSocketServiceTest") { 241 module_out_path = module_output_path 242 sources = [ "client_trans_socket_service_test.cpp" ] 243 244 deps = [ "$dsoftbus_root_path/tests/sdk:softbus_client_static" ] 245 246 if (is_standard_system) { 247 external_deps = [ 248 "c_utils:utils", 249 "hilog:libhilog", 250 ] 251 } else { 252 external_deps = [ 253 "c_utils:utils", 254 "hilog:libhilog", 255 ] 256 } 257} 258 259ohos_unittest("TransClientSocketTest") { 260 module_out_path = module_output_path 261 sources = [ "client_trans_inner_socket_test.cpp" ] 262 263 deps = [ "$dsoftbus_root_path/tests/sdk:softbus_client_static" ] 264 265 if (is_standard_system) { 266 external_deps = [ 267 "access_token:libaccesstoken_sdk", 268 "access_token:libnativetoken", 269 "access_token:libtoken_setproc", 270 "c_utils:utils", 271 "hilog:libhilog", 272 ] 273 } else { 274 external_deps = [ 275 "c_utils:utils", 276 "hilog:libhilog", 277 ] 278 } 279} 280 281ohos_unittest("SessionMockTest") { 282 module_out_path = module_output_path 283 sources = [ "session_mock_test.cpp" ] 284 include_dirs = [ 285 "$dsoftbus_root_path/sdk/transmission/session/cpp/src", 286 "$dsoftbus_root_path/sdk/transmission/session/cpp/include", 287 ] 288 289 deps = [ "$dsoftbus_root_path/tests/sdk:softbus_client_static" ] 290 291 if (is_standard_system) { 292 external_deps = [ 293 "access_token:libaccesstoken_sdk", 294 "access_token:libnativetoken", 295 "access_token:libtoken_setproc", 296 "c_utils:utils", 297 "hilog:libhilog", 298 ] 299 } else { 300 external_deps = [ 301 "c_utils:utils", 302 "hilog:libhilog", 303 ] 304 } 305} 306 307ohos_unittest("TransClientSessionImplTest") { 308 module_out_path = module_output_path 309 sources = [ "client_trans_session_impl_test.cpp" ] 310 include_dirs = [ 311 "$dsoftbus_root_path/sdk/transmission/session/cpp/include", 312 "$dsoftbus_root_path/sdk/transmission/session/cpp/src", 313 ] 314 315 deps = [ 316 "$dsoftbus_root_path/core/common:softbus_utils", 317 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 318 ] 319 320 if (is_standard_system) { 321 external_deps = [ "hilog:libhilog" ] 322 } 323} 324 325ohos_unittest("TransClientSessionServiceImplTest") { 326 module_out_path = module_output_path 327 sources = [ "client_trans_session_service_impl_test.cpp" ] 328 include_dirs = [ 329 "$dsoftbus_root_path/sdk/transmission/session/cpp/src", 330 "$dsoftbus_root_path/sdk/transmission/session/cpp/include", 331 ] 332 333 deps = [ 334 "$dsoftbus_root_path/core/common:softbus_utils", 335 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 336 ] 337 338 if (is_standard_system) { 339 external_deps = [ "hilog:libhilog" ] 340 } 341} 342 343group("unittest") { 344 testonly = true 345 deps = [ 346 ":SessionMockTest", 347 ":TransClientMsgServiceTest", 348 ":TransClientSessionCallbackTest", 349 ":TransClientSessionImplTest", 350 ":TransClientSessionManagerTest", 351 ":TransClientSessionServiceImplTest", 352 ":TransClientSessionServiceTest", 353 ":TransClientSessionTest", 354 ":TransClientSocketServiceTest", 355 ":TransClientSocketTest", 356 ] 357} 358