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/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/core/connection/interface", 36 "$dsoftbus_root_path/sdk/transmission/session/include", 37 "$dsoftbus_root_path/interfaces/inner_kits/transport", 38 "$dsoftbus_root_path/interfaces/kits/transport", 39 "$dsoftbus_root_path/tests/sdk/common/include", 40 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/src", 41 "$dsoftbus_root_path/adapter/common/include", 42 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include", 43 "$dsoftbus_root_path/sdk/transmission/session/include", 44 "$dsoftbus_root_path/core/frame/common/include", 45 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 46 "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include", 47 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 48 "$dsoftbus_root_path/sdk/transmission/ipc/include", 49 ] 50 51 deps = [ 52 "$dsoftbus_root_path/adapter:softbus_adapter", 53 "$dsoftbus_root_path/core/common:softbus_utils", 54 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 55 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 56 ] 57 58 external_deps = [ 59 "bounds_checking_function:libsec_static", 60 "c_utils:utils", 61 "hilog:libhilog", 62 ] 63} 64 65ohos_unittest("TransSessionTest") { 66 module_out_path = module_output_path 67 sources = [ "trans_session_test.cpp" ] 68 69 include_dirs = [ 70 "$dsoftbus_root_path/core/common/include", 71 "$dsoftbus_root_path/core/common/include", 72 "$dsoftbus_root_path/core/connection/interface", 73 "$dsoftbus_root_path/sdk/transmission/session/include", 74 "$dsoftbus_root_path/interfaces/inner_kits/transport", 75 "$dsoftbus_root_path/interfaces/kits/transport", 76 "$dsoftbus_root_path/tests/sdk/common/include", 77 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/src", 78 "$dsoftbus_root_path/adapter/common/include", 79 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include", 80 "$dsoftbus_root_path/sdk/transmission/session/include", 81 "$dsoftbus_root_path/core/frame/common/include", 82 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 83 "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include", 84 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 85 "$dsoftbus_root_path/sdk/transmission/ipc/include", 86 ] 87 88 deps = [ 89 "$dsoftbus_root_path/core/common:softbus_utils", 90 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 91 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 92 ] 93 94 if (is_standard_system) { 95 external_deps = [ 96 "c_utils:utils", 97 "hilog:libhilog", 98 ] 99 } else { 100 external_deps = [ 101 "c_utils:utils", 102 "hilog:libhilog", 103 ] 104 } 105} 106 107ohos_unittest("TransTcpDirectTest") { 108 module_out_path = module_output_path 109 sources = [ "trans_tcp_direct_test.cpp" ] 110 111 include_dirs = [ 112 "$dsoftbus_root_path/core/common/include", 113 "$dsoftbus_root_path/core/common/include", 114 "$dsoftbus_root_path/core/connection/interface", 115 "$dsoftbus_root_path/sdk/transmission/session/include", 116 "$dsoftbus_root_path/interfaces/inner_kits/transport", 117 "$dsoftbus_root_path/interfaces/kits/transport", 118 "$dsoftbus_root_path/tests/sdk/common/include", 119 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/src", 120 "$dsoftbus_root_path/adapter/common/include", 121 "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include", 122 "$dsoftbus_root_path/sdk/transmission/session/include", 123 "$dsoftbus_root_path/core/frame/common/include", 124 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include", 125 "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include", 126 "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include", 127 "$dsoftbus_root_path/sdk/transmission/ipc/include", 128 ] 129 130 deps = [ 131 "$dsoftbus_root_path/core/common:softbus_utils", 132 "$dsoftbus_root_path/tests/sdk:softbus_client_static", 133 "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test", 134 ] 135 136 if (is_standard_system) { 137 external_deps = [ 138 "c_utils:utils", 139 "hilog:libhilog", 140 ] 141 } else { 142 external_deps = [ 143 "c_utils:utils", 144 "hilog:libhilog", 145 ] 146 } 147} 148 149group("unittest") { 150 testonly = true 151 deps = [ 152 ":TransSdkTcpDirectTest", 153 ":TransSessionTest", 154 ":TransTcpDirectTest", 155 ] 156} 157