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