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