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/soft_bus/transmission" 18dsoftbus_root_path = "../../../../.." 19softbus_adapter_config = "${dsoftbus_root_path}/adapter/default_config" 20 21ohos_unittest("TransSdkTcpDirectTest") { 22 sanitize = { 23 cfi = true 24 cfi_cross_dso = true 25 debug = false 26 } 27 module_out_path = module_output_path 28 sources = [ "trans_sdk_tcp_direct_test.cpp" ] 29 30 include_dirs = [ 31 "$dsoftbus_root_path/core/common/softbus_property/include", 32 "$softbus_adapter_config/spec_config", 33 "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux", 34 "$dsoftbus_root_path/core/common/include", 35 "$dsoftbus_root_path/interfaces/kits/connect", 36 "$dsoftbus_root_path/core/connection/interface", 37 "$dsoftbus_root_path/sdk/transmission/session/include", 38 "$dsoftbus_root_path/interfaces/inner_kits/transport", 39 "$dsoftbus_root_path/interfaces/kits/transport", 40 "$dsoftbus_root_path/tests/sdk/common/include", 41 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/src", 42 "$dsoftbus_root_path/adapter/common/include", 43 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include", 44 "$dsoftbus_root_path/sdk/transmission/session/include", 45 "$dsoftbus_root_path/core/frame/common/include", 46 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 47 "$dsoftbus_root_path/interfaces/kits/transport", 48 "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include", 49 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 50 "$dsoftbus_root_path/sdk/transmission/ipc/include", 51 "$dsoftbus_root_path/sdk/bus_center/manager/include", 52 ] 53 54 deps = [ 55 "$dsoftbus_root_path/adapter:softbus_adapter", 56 "$dsoftbus_root_path/core/common:softbus_utils", 57 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 58 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 59 ] 60 61 external_deps = [ 62 "bounds_checking_function:libsec_static", 63 "c_utils:utils", 64 "hilog:libhilog", 65 ] 66} 67 68ohos_unittest("TransSessionTest") { 69 module_out_path = module_output_path 70 sources = [ "trans_session_test.cpp" ] 71 72 include_dirs = [ 73 "$dsoftbus_root_path/core/common/include", 74 "$dsoftbus_root_path/core/common/include", 75 "$dsoftbus_root_path/interfaces/kits/connect", 76 "$dsoftbus_root_path/core/connection/interface", 77 "$dsoftbus_root_path/sdk/transmission/session/include", 78 "$dsoftbus_root_path/interfaces/inner_kits/transport", 79 "$dsoftbus_root_path/interfaces/kits/transport", 80 "$dsoftbus_root_path/tests/sdk/common/include", 81 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/src", 82 "$dsoftbus_root_path/adapter/common/include", 83 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include", 84 "$dsoftbus_root_path/sdk/transmission/session/include", 85 "$dsoftbus_root_path/core/frame/common/include", 86 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 87 "$dsoftbus_root_path/interfaces/kits/transport", 88 "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include", 89 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 90 "$dsoftbus_root_path/sdk/transmission/ipc/include", 91 ] 92 93 deps = [ 94 "$dsoftbus_root_path/core/common:softbus_utils", 95 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 96 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 97 ] 98 99 if (is_standard_system) { 100 external_deps = [ 101 "c_utils:utils", 102 "googletest:gmock", 103 "hilog:libhilog", 104 ] 105 } else { 106 external_deps = [ 107 "c_utils:utils", 108 "hilog:libhilog", 109 ] 110 } 111} 112 113ohos_unittest("TransTcpDirectTest") { 114 module_out_path = module_output_path 115 sources = [ 116 "trans_tcp_direct_mock.cpp", 117 "trans_tcp_direct_test.cpp", 118 ] 119 120 include_dirs = [ 121 "$dsoftbus_root_path/core/common/include", 122 "$dsoftbus_root_path/core/common/include", 123 "$dsoftbus_root_path/interfaces/kits/connect", 124 "$dsoftbus_root_path/core/connection/interface", 125 "$dsoftbus_root_path/sdk/transmission/session/include", 126 "$dsoftbus_root_path/interfaces/inner_kits/transport", 127 "$dsoftbus_root_path/interfaces/kits/transport", 128 "$dsoftbus_root_path/tests/sdk/common/include", 129 "$dsoftbus_root_path/sdk/transmission/trans_channel/common/include", 130 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/src", 131 "$dsoftbus_root_path/adapter/common/include", 132 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include", 133 "$dsoftbus_root_path/sdk/transmission/session/include", 134 "$dsoftbus_root_path/core/frame/common/include", 135 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 136 "$dsoftbus_root_path/interfaces/kits/transport", 137 "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include", 138 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 139 "$dsoftbus_root_path/sdk/transmission/ipc/include", 140 "$dsoftbus_root_path/sdk/transmission/common/include", 141 "$dsoftbus_root_path/sdk/transmission/common/src", 142 "$dsoftbus_root_path/core/transmission/common/include", 143 "$dsoftbus_root_path/core/transmission/common/src", 144 "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux", 145 "$dsoftbus_root_path/adapter/default_config/spec_config", 146 "$dsoftbus_root_path/sdk/bus_center/manager/include", 147 ] 148 149 deps = [ 150 "$dsoftbus_root_path/core/common:softbus_utils", 151 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 152 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 153 ] 154 155 if (is_standard_system) { 156 external_deps = [ 157 "c_utils:utils", 158 "googletest:gmock", 159 "hilog:libhilog", 160 ] 161 } else { 162 external_deps = [ 163 "c_utils:utils", 164 "hilog:libhilog", 165 ] 166 } 167} 168 169ohos_unittest("TransTcpDirectMockTest") { 170 module_out_path = module_output_path 171 sources = [ 172 "trans_tcp_direct_mock_test.cpp", 173 "trans_tcp_direct_tlv_mock.cpp", 174 ] 175 176 include_dirs = [ 177 "$dsoftbus_root_path/core/common/include", 178 "$dsoftbus_root_path/core/common/include", 179 "$dsoftbus_root_path/core/connection/interface", 180 "$dsoftbus_root_path/sdk/transmission/session/include", 181 "$dsoftbus_root_path/interfaces/inner_kits/transport", 182 "$dsoftbus_root_path/interfaces/kits/transport", 183 "$dsoftbus_root_path/tests/sdk/common/include", 184 "$dsoftbus_root_path/sdk/transmission/trans_channel/common/include", 185 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/src", 186 "$dsoftbus_root_path/adapter/common/include", 187 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include", 188 "$dsoftbus_root_path/sdk/transmission/session/include", 189 "$dsoftbus_root_path/core/frame/common/include", 190 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 191 "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include", 192 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 193 "$dsoftbus_root_path/sdk/transmission/ipc/include", 194 "$dsoftbus_root_path/core/transmission/common/include", 195 "$dsoftbus_root_path/core/transmission/common/src", 196 "$dsoftbus_root_path/sdk/bus_center/manager/include", 197 ] 198 199 deps = [ 200 "$dsoftbus_root_path/adapter:softbus_adapter", 201 "$dsoftbus_root_path/core/common:softbus_utils", 202 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 203 ] 204 205 if (is_standard_system) { 206 external_deps = [ 207 "c_utils:utils", 208 "googletest:gmock", 209 "hilog:libhilog", 210 ] 211 } else { 212 external_deps = [ 213 "c_utils:utils", 214 "googletest:gmock", 215 "hilog:libhilog", 216 ] 217 } 218} 219 220group("unittest") { 221 testonly = true 222 deps = [ 223 ":TransSdkTcpDirectTest", 224 ":TransSessionTest", 225 ":TransTcpDirectMockTest", 226 ":TransTcpDirectTest", 227 ] 228} 229