1# Copyright (c) 2022 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 ] 31 32 deps = [ 33 "$dsoftbus_dfx_path/log:softbus_dfx_log", 34 "$dsoftbus_root_path/core/common:softbus_utils", 35 "$dsoftbus_root_path/core/frame:softbus_server", 36 "$dsoftbus_root_path/sdk:softbus_client", 37 "//third_party/googletest:gtest_main", 38 ] 39 40 if (is_standard_system) { 41 external_deps = [ 42 "c_utils:utils", 43 "hilog:libhilog", 44 ] 45 } else { 46 external_deps = [ 47 "c_utils:utils", 48 "hilog:libhilog", 49 ] 50 } 51} 52 53ohos_unittest("TransClientSessionServiceTest") { 54 module_out_path = module_output_path 55 sources = [ "client_trans_session_service_test.cpp" ] 56 57 include_dirs = [ 58 "$dsoftbus_root_path/core/common/include", 59 "$dsoftbus_root_path/core/frame/common/include", 60 "$dsoftbus_root_path/core/transmission/common/include", 61 "$dsoftbus_root_path/sdk/transmission/session/include", 62 "$dsoftbus_root_path/adapter/default_config/spec_config", 63 ] 64 65 deps = [ 66 "$dsoftbus_dfx_path/log:softbus_dfx_log", 67 "$dsoftbus_root_path/core/common:softbus_utils", 68 "$dsoftbus_root_path/core/frame:softbus_server", 69 "$dsoftbus_root_path/sdk:softbus_client", 70 "//third_party/googletest:gtest_main", 71 ] 72 73 if (is_standard_system) { 74 external_deps = [ 75 "c_utils:utils", 76 "hilog:libhilog", 77 ] 78 } else { 79 external_deps = [ 80 "c_utils:utils", 81 "hilog:libhilog", 82 ] 83 } 84} 85 86ohos_unittest("TransClientSessionCallbackTest") { 87 module_out_path = module_output_path 88 sources = [ "client_trans_session_callback_test.cpp" ] 89 90 include_dirs = [ 91 "$dsoftbus_root_path/core/common/include", 92 "$dsoftbus_root_path/core/frame/common/include", 93 "$dsoftbus_root_path/core/transmission/common/include", 94 "$dsoftbus_root_path/sdk/transmission/session/include", 95 "$dsoftbus_root_path/adapter/default_config/spec_config", 96 "$dsoftbus_root_path/sdk/transmission/session/src", 97 "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include", 98 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 99 ] 100 101 deps = [ 102 "$dsoftbus_dfx_path/log:softbus_dfx_log", 103 "$dsoftbus_root_path/core/common:softbus_utils", 104 "$dsoftbus_root_path/core/frame:softbus_server", 105 "$dsoftbus_root_path/sdk:softbus_client", 106 "//third_party/googletest:gtest_main", 107 ] 108 109 if (is_standard_system) { 110 external_deps = [ 111 "c_utils:utils", 112 "hilog:libhilog", 113 ] 114 } else { 115 external_deps = [ 116 "c_utils:utils", 117 "hilog:libhilog", 118 ] 119 } 120} 121 122ohos_unittest("TransClientMsgServiceTest") { 123 module_out_path = module_output_path 124 sources = [ "client_trans_message_service_test.cpp" ] 125 126 include_dirs = [ 127 "$dsoftbus_root_path/core/common/include", 128 "$dsoftbus_root_path/core/frame/common/include", 129 "$dsoftbus_root_path/core/transmission/common/include", 130 "$dsoftbus_root_path/sdk/transmission/session/include", 131 "$dsoftbus_root_path/sdk/transmission/session/src", 132 "$dsoftbus_root_path/interfaces/inner_kits/transport", 133 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 134 "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include", 135 "$dsoftbus_root_path/sdk/frame/common/include", 136 "$dsoftbus_root_path/tests/sdk/common/include", 137 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 138 ] 139 140 deps = [ 141 "$dsoftbus_dfx_path/log:softbus_dfx_log", 142 "$dsoftbus_root_path/core/common:softbus_utils", 143 "$dsoftbus_root_path/core/frame:softbus_server", 144 "$dsoftbus_root_path/sdk:softbus_client", 145 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 146 "//third_party/googletest:gtest_main", 147 ] 148 149 if (is_standard_system) { 150 external_deps = [ 151 "c_utils:utils", 152 "hilog:libhilog", 153 ] 154 } else { 155 external_deps = [ 156 "c_utils:utils", 157 "hilog:libhilog", 158 ] 159 } 160} 161 162ohos_unittest("TransClientSessionTest") { 163 module_out_path = module_output_path 164 sources = [ "client_trans_session_test.cpp" ] 165 166 include_dirs = [ 167 "$dsoftbus_root_path/core/common/include", 168 "$dsoftbus_root_path/core/frame/common/include", 169 "$dsoftbus_root_path/core/transmission/common/include", 170 "$dsoftbus_root_path/sdk/transmission/session/include", 171 "$dsoftbus_root_path/sdk/transmission/session/src", 172 "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include", 173 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 174 "$dsoftbus_root_path/sdk/transmission/trans_channel/qos/include", 175 "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include", 176 "$dsoftbus_root_path/sdk/frame/common/include", 177 "$dsoftbus_root_path/sdk/transmission/ipc/include", 178 "$dsoftbus_root_path/tests/sdk/common/include", 179 "$dsoftbus_root_path/interfaces/kits/common", 180 "$dsoftbus_root_path/sdk/bus_center/manager/include", 181 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include", 182 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 183 ] 184 185 deps = [ 186 "$dsoftbus_dfx_path/log:softbus_dfx_log", 187 "$dsoftbus_root_path/core/common:softbus_utils", 188 "$dsoftbus_root_path/core/frame:softbus_server", 189 "$dsoftbus_root_path/sdk:softbus_client", 190 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 191 "//third_party/googletest:gtest_main", 192 ] 193 194 if (is_standard_system) { 195 external_deps = [ 196 "c_utils:utils", 197 "hilog:libhilog", 198 ] 199 } else { 200 external_deps = [ 201 "c_utils:utils", 202 "hilog:libhilog", 203 ] 204 } 205} 206 207ohos_unittest("TransClientSocketServiceTest") { 208 module_out_path = module_output_path 209 sources = [ "client_trans_socket_service_test.cpp" ] 210 211 deps = [ 212 "$dsoftbus_root_path/sdk:softbus_client", 213 "//third_party/googletest:gtest_main", 214 ] 215 216 if (is_standard_system) { 217 external_deps = [ 218 "c_utils:utils", 219 "hilog:libhilog", 220 ] 221 } else { 222 external_deps = [ 223 "c_utils:utils", 224 "hilog:libhilog", 225 ] 226 } 227} 228 229group("unittest") { 230 testonly = true 231 deps = [ 232 ":TransClientMsgServiceTest", 233 ":TransClientSessionCallbackTest", 234 ":TransClientSessionManagerTest", 235 ":TransClientSessionServiceTest", 236 ":TransClientSessionTest", 237 ":TransClientSocketServiceTest", 238 ] 239} 240