• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2025 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")
16import("../../../../sdk/transmission/trans_channel/udp/trans_udp_sdk.gni")
17
18dsoftbus_root_path = "../../../.."
19
20trans_sdk_test_common_inc = [
21  "$dsoftbus_root_path/core/common/include",
22  "$dsoftbus_root_path/interfaces/kits/connect",
23  "$dsoftbus_root_path/core/connection/interface",
24  "$dsoftbus_root_path/sdk/transmission/session/include",
25  "$dsoftbus_root_path/interfaces/inner_kits/transport",
26  "$dsoftbus_root_path/interfaces/kits/transport",
27  "$dsoftbus_root_path/tests/sdk/common/include",
28  "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/src",
29  "$dsoftbus_root_path/adapter/common/include",
30  "$dsoftbus_root_path/sdk/transmission/trans_channel/tcp_direct/include",
31  "$dsoftbus_root_path/sdk/transmission/session/include",
32  "$dsoftbus_root_path/core/frame/common/include",
33  "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include",
34  "$dsoftbus_root_path/interfaces/kits/transport",
35  "$dsoftbus_root_path/core/transmission/trans_channel/udp_negotiation/include",
36  "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
37  "$dsoftbus_root_path/sdk/transmission/ipc/include",
38]
39trans_sdk_test_common_deps = [
40  "$dsoftbus_root_path/core/common:softbus_utils",
41  "$dsoftbus_root_path/sdk:softbus_client",
42  "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
43]
44
45if (defined(ohos_lite)) {
46  import("//build/lite/config/component/lite_component.gni")
47  import("//build/lite/config/test.gni")
48
49  if (ohos_build_type == "debug") {
50    unittest("TransSdkStreamTest") {
51      output_extension = "bin"
52      output_dir = "$root_out_dir/test/unittest/dsoftbus"
53      sources = [ "udp/stream/trans_sdk_stream_test.cpp" ]
54      include_dirs = trans_sdk_test_common_inc
55      include_dirs += [
56        "$dsoftbus_root_path/core/common/softbus_property/include",
57        "$softbus_adapter_config/spec_config",
58        "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux",
59      ]
60      deps = trans_sdk_test_common_deps
61      deps += [
62        "$dsoftbus_root_path/adapter:softbus_adapter",
63        "$hilog_lite_deps_path",
64      ]
65    }
66  }
67} else {
68  import("//build/test.gni")
69
70  trans_sdk_proxy_test_inc = [
71    "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include",
72    "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
73  ]
74
75  trans_sdk_proxy_test_deps =
76      [ "$dsoftbus_root_path/tests/sdk:softbus_client_static" ]
77
78  module_output_path = "dsoftbus/soft_bus/transmission"
79  ohos_unittest("TransSdkStreamTest") {
80    module_out_path = module_output_path
81    sources = [ "udp/stream/trans_sdk_stream_test.cpp" ]
82    include_dirs = trans_sdk_test_common_inc
83    deps = trans_sdk_test_common_deps
84    deps += trans_sdk_proxy_test_deps
85    if (is_standard_system) {
86      external_deps = [ "hilog:libhilog" ]
87    } else {
88      external_deps = [ "hilog:libhilog" ]
89    }
90  }
91
92  module_output_path = "dsoftbus/soft_bus/transmission"
93  ohos_unittest("TransSdkCommStreamTest") {
94    module_out_path = module_output_path
95    sources = [ "udp/stream/trans_sdk_comm_stream_test.cpp" ]
96    include_dirs = trans_sdk_test_common_inc
97    include_dirs += trans_sdk_proxy_test_inc
98    deps = trans_sdk_test_common_deps
99    deps += trans_sdk_proxy_test_deps
100    if (is_standard_system) {
101      external_deps = [ "hilog:libhilog" ]
102    } else {
103      external_deps = [ "hilog:libhilog" ]
104    }
105  }
106
107  module_output_path = "dsoftbus/soft_bus/transmission"
108  ohos_unittest("ClientTransProxyFileCommonTest") {
109    module_out_path = module_output_path
110    sources = [ "proxy/client_trans_proxy_file_common_test.cpp" ]
111    include_dirs = trans_sdk_test_common_inc
112    include_dirs += trans_sdk_proxy_test_inc
113    deps = trans_sdk_test_common_deps
114    deps += trans_sdk_proxy_test_deps
115    if (is_standard_system) {
116      external_deps = [ "hilog:libhilog" ]
117    } else {
118      external_deps = [ "hilog:libhilog" ]
119    }
120  }
121
122  module_output_path = "dsoftbus/soft_bus/transmission"
123  ohos_unittest("ClientTransPendingTest") {
124    module_out_path = module_output_path
125    sources = [ "proxy/client_trans_pending_test.cpp" ]
126    include_dirs = trans_sdk_test_common_inc
127    include_dirs += trans_sdk_proxy_test_inc
128    deps = trans_sdk_test_common_deps
129    deps += trans_sdk_proxy_test_deps
130    if (is_standard_system) {
131      external_deps = [ "hilog:libhilog" ]
132    } else {
133      external_deps = [ "hilog:libhilog" ]
134    }
135  }
136
137  module_output_path = "dsoftbus/soft_bus/transmission"
138  ohos_unittest("ClientTransProxyManagerTest") {
139    sanitize = {
140      cfi = true
141      cfi_cross_dso = true
142      debug = false
143    }
144    module_out_path = module_output_path
145    sources = [ "proxy/client_trans_proxy_manager_test.cpp" ]
146    include_dirs = trans_sdk_test_common_inc
147    include_dirs += trans_sdk_proxy_test_inc
148    include_dirs += [
149      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/src",
150      "$dsoftbus_root_path/sdk/transmission/trans_channel/common/include",
151      "$dsoftbus_root_path/core/transmission/common/include",
152      "$dsoftbus_root_path/core/transmission/common/src",
153    ]
154    deps = trans_sdk_test_common_deps
155    deps += trans_sdk_proxy_test_deps
156    deps += [ "$dsoftbus_root_path/adapter:softbus_adapter" ]
157    if (is_standard_system) {
158      external_deps = [ "hilog:libhilog" ]
159    } else {
160      external_deps = [ "hilog:libhilog" ]
161    }
162  }
163
164  module_output_path = "dsoftbus/soft_bus/transmission"
165  ohos_unittest("ClientTransProxyManagerMockTest") {
166    module_out_path = module_output_path
167    sources = [
168      "proxy/client_trans_proxy_manager_mock_test.cpp",
169      "proxy/mock/client_trans_proxy_manager_mock.cpp",
170    ]
171    include_dirs = trans_sdk_test_common_inc
172    include_dirs += [
173      "$dsoftbus_root_path/sdk/transmission/trans_channel/common/include",
174      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include",
175      "$dsoftbus_root_path/core/transmission/common/src",
176      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/src",
177      "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include",
178      "$dsoftbus_root_path/core/frame/common/include",
179      "$dsoftbus_root_path/core/transmission/common/include",
180      "$dsoftbus_root_path/sdk/transmission/ipc/include",
181      "$dsoftbus_root_path/interfaces/kits/lnn",
182      "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
183      "$dsoftbus_root_path/interfaces/inner_kits/lnn",
184      "$dsoftbus_root_path/sdk/transmission/session/include",
185      "$dsoftbus_root_path/tests/sdk/transmission/trans_channel/proxy/mock",
186      "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux",
187      "$dsoftbus_root_path/adapter/default_config/spec_config",
188    ]
189    deps = trans_sdk_test_common_deps
190    deps += [
191      "$dsoftbus_root_path/adapter:softbus_adapter",
192      "$dsoftbus_root_path/dfx:softbus_dfx",
193    ]
194    external_deps = [
195      "googletest:gmock",
196      "hilog:libhilog",
197    ]
198  }
199
200  module_output_path = "dsoftbus/soft_bus/transmission"
201  ohos_unittest("ClientTransProxyFileHelperMockTest") {
202    module_out_path = module_output_path
203    sources = [
204      "proxy/client_trans_proxy_file_helper_mock_test.cpp",
205      "proxy/mock/client_trans_proxy_file_helper_mock.cpp",
206    ]
207    include_dirs = trans_sdk_test_common_inc
208    include_dirs += [
209      "$dsoftbus_root_path/sdk/transmission/trans_channel/common/include",
210      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include",
211      "$dsoftbus_root_path/core/transmission/common/src",
212      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/src",
213      "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include",
214      "$dsoftbus_root_path/core/frame/common/include",
215      "$dsoftbus_root_path/core/transmission/common/include",
216      "$dsoftbus_root_path/sdk/transmission/ipc/include",
217      "$dsoftbus_root_path/interfaces/kits/lnn",
218      "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
219      "$dsoftbus_root_path/interfaces/inner_kits/lnn",
220      "$dsoftbus_root_path/sdk/transmission/session/include",
221      "$dsoftbus_root_path/tests/sdk/transmission/trans_channel/proxy/mock",
222      "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux",
223      "$dsoftbus_root_path/adapter/default_config/spec_config",
224    ]
225    deps = trans_sdk_test_common_deps
226    deps += [
227      "$dsoftbus_root_path/adapter:softbus_adapter",
228      "$dsoftbus_root_path/dfx:softbus_dfx",
229    ]
230    external_deps = [
231      "googletest:gmock",
232      "hilog:libhilog",
233    ]
234  }
235
236  module_output_path = "dsoftbus/soft_bus/transmission"
237  ohos_unittest("ClientTransUdpManagerTest") {
238    sanitize = {
239      cfi = true
240      cfi_cross_dso = true
241      debug = false
242    }
243    module_out_path = module_output_path
244    sources = [ "udp/common/client_trans_udp_manager_test.cpp" ]
245    include_dirs = trans_sdk_test_common_inc
246    include_dirs += trans_sdk_proxy_test_inc
247    include_dirs += [
248      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/src",
249      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
250      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/stream/include",
251      "$dsoftbus_root_path/components/nstackx/fillp/include",
252      "$dsoftbus_root_path/components/nstackx/nstackx_util/interface",
253      "$dsoftbus_root_path/adapter/common/security/access_token/include",
254    ]
255    include_dirs += trans_sdk_proxy_test_inc
256    deps = trans_sdk_test_common_deps
257    deps += trans_sdk_proxy_test_deps
258    if (!defined(global_parts_info) ||
259      defined(global_parts_info.communication_dsoftbus_service_ext)) {
260      include_dirs += [ "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_util/interface" ]
261      deps += [ "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_core/dfile:nstackx_dfile" ]
262    } else {
263      include_dirs +=
264          [ "$dsoftbus_root_path/components/nstackx/nstackx_util/interface" ]
265      deps += [ "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile:nstackx_dfile.open" ]
266    }
267    if (is_standard_system) {
268      external_deps = [ "hilog:libhilog" ]
269    } else {
270      external_deps = [ "hilog:libhilog" ]
271    }
272  }
273
274  module_output_path = "dsoftbus/soft_bus/transmission"
275  ohos_unittest("ClientTransUdpManagerStaticTest") {
276    module_out_path = module_output_path
277    sources = [ "udp/common/client_trans_udp_manager_static_test.cpp" ]
278    include_dirs = trans_sdk_test_common_inc
279    include_dirs += [
280      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/src",
281      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
282      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/stream/include",
283      "$dsoftbus_root_path/sdk/transmission/ipc/include",
284      "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include",
285      "$dsoftbus_root_path/components/nstackx/fillp/include",
286      "$dsoftbus_root_path/adapter/common/security/access_token/include",
287    ]
288    deps = trans_sdk_test_common_deps
289    deps += trans_sdk_proxy_test_deps
290
291    if (!defined(global_parts_info) ||
292      defined(global_parts_info.communication_dsoftbus_service_ext)) {
293      include_dirs += [ "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_util/interface" ]
294      deps += [ "$dsoftbus_root_path/components/nstackx_enhanced/nstackx_core/dfile:nstackx_dfile" ]
295    } else {
296      include_dirs +=
297          [ "$dsoftbus_root_path/components/nstackx/nstackx_util/interface" ]
298      deps += [ "$dsoftbus_root_path/components/nstackx/nstackx_core/dfile:nstackx_dfile.open" ]
299    }
300    if (is_standard_system) {
301      external_deps = [ "hilog:libhilog" ]
302    } else {
303      external_deps = [ "hilog:libhilog" ]
304    }
305  }
306
307  module_output_path = "dsoftbus/soft_bus/transmission"
308  ohos_unittest("ClientTransProxyFileManagerTest") {
309    sanitize = {
310      cfi = true
311      cfi_cross_dso = true
312      debug = false
313    }
314    module_out_path = module_output_path
315    sources = [ "proxy/client_trans_proxy_file_manager_test.cpp" ]
316    include_dirs = trans_sdk_test_common_inc
317    include_dirs += [
318      "$dsoftbus_root_path/sdk/frame/common/include",
319      "$dsoftbus_root_path/sdk/transmission/trans_channel/common/include",
320      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include",
321      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
322      "$dsoftbus_root_path/sdk/transmission/ipc/include",
323      "$dsoftbus_root_path/sdk/bus_center/manager/include",
324      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/src",
325      "$dsoftbus_root_path/sdk/transmission/session/src",
326      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
327      "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include",
328      "$dsoftbus_root_path/core/frame/common/include",
329      "$dsoftbus_root_path/core/transmission/common/include",
330      "$dsoftbus_root_path/interfaces/kits/lnn",
331      "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
332      "$dsoftbus_root_path/interfaces/inner_kits/lnn",
333      "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux",
334      "$dsoftbus_root_path/adapter/default_config/spec_config",
335      "$dsoftbus_root_path/adapter/common/security/access_token/include",
336    ]
337    deps = trans_sdk_test_common_deps
338    deps += trans_sdk_proxy_test_deps
339    if (is_standard_system) {
340      external_deps = [ "hilog:libhilog" ]
341    } else {
342      external_deps = [ "hilog:libhilog" ]
343    }
344  }
345
346  module_output_path = "dsoftbus/soft_bus/transmission"
347  ohos_unittest("ClientTransProxyFileManagerMockTest") {
348    module_out_path = module_output_path
349    sources = [
350      "proxy/client_trans_proxy_file_manager_mock_test.cpp",
351      "proxy/mock/client_trans_proxy_file_manager_mock.cpp",
352    ]
353    include_dirs = trans_sdk_test_common_inc
354    include_dirs += [
355      "$dsoftbus_root_path/sdk/transmission/trans_channel/common/include",
356      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include",
357      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
358      "$dsoftbus_root_path/sdk/transmission/ipc/include",
359      "$dsoftbus_root_path/sdk/bus_center/manager/include",
360      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/src",
361      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
362      "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include",
363      "$dsoftbus_root_path/core/frame/common/include",
364      "$dsoftbus_root_path/core/transmission/common/include",
365      "$dsoftbus_root_path/interfaces/kits/lnn",
366      "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
367      "$dsoftbus_root_path/interfaces/inner_kits/lnn",
368      "$dsoftbus_root_path/tests/sdk/transmission/trans_channel/proxy/mock",
369      "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux",
370      "$dsoftbus_root_path/adapter/default_config/spec_config",
371    ]
372    deps = trans_sdk_test_common_deps
373    deps += [
374      "$dsoftbus_root_path/adapter:softbus_adapter",
375      "$dsoftbus_root_path/dfx:softbus_dfx",
376    ]
377    external_deps = [
378      "googletest:gmock",
379      "hilog:libhilog",
380    ]
381  }
382
383  module_output_path = "dsoftbus/soft_bus/transmission"
384  ohos_unittest("TransClientProxyFileManagerMockTest") {
385    module_out_path = module_output_path
386    sources = [
387      "proxy/mock/trans_client_proxy_file_manager_mock.cpp",
388      "proxy/trans_client_proxy_file_manager_mock_test.cpp",
389    ]
390    include_dirs = trans_sdk_test_common_inc
391    include_dirs += [
392      "$dsoftbus_root_path/sdk/transmission/trans_channel/common/include",
393      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include",
394      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
395      "$dsoftbus_root_path/sdk/transmission/ipc/include",
396      "$dsoftbus_root_path/sdk/bus_center/manager/include",
397      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/src",
398      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
399      "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include",
400      "$dsoftbus_root_path/core/frame/common/include",
401      "$dsoftbus_root_path/core/transmission/common/include",
402      "$dsoftbus_root_path/interfaces/kits/lnn",
403      "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
404      "$dsoftbus_root_path/interfaces/inner_kits/lnn",
405      "$dsoftbus_root_path/tests/sdk/transmission/trans_channel/proxy/mock",
406      "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux",
407      "$dsoftbus_root_path/adapter/default_config/spec_config",
408    ]
409    deps = trans_sdk_test_common_deps
410    deps += [
411      "$dsoftbus_root_path/adapter:softbus_adapter",
412      "$dsoftbus_root_path/dfx:softbus_dfx",
413    ]
414    external_deps = [
415      "googletest:gmock",
416      "hilog:libhilog",
417    ]
418  }
419
420  module_output_path = "dsoftbus/soft_bus/transmission"
421  ohos_unittest("ClientTransChannelManagerTest") {
422    sanitize = {
423      cfi = true
424      cfi_cross_dso = true
425      debug = false
426    }
427    module_out_path = module_output_path
428    sources = [ "manager/client_trans_channel_manager_test.cpp" ]
429    include_dirs = trans_sdk_test_common_inc
430    include_dirs += [
431      "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include",
432      "$dsoftbus_root_path/sdk/transmission/trans_channel/auth/include",
433      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include",
434      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
435      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include",
436    ]
437    deps = trans_sdk_test_common_deps
438    deps += trans_sdk_proxy_test_deps
439    if (is_standard_system) {
440      external_deps = [ "hilog:libhilog" ]
441    } else {
442      external_deps = [ "hilog:libhilog" ]
443    }
444  }
445
446  module_output_path = "dsoftbus/soft_bus/transmission"
447  ohos_unittest("ClientTransChannelCallbackTest") {
448    sanitize = {
449      cfi = true
450      cfi_cross_dso = true
451      debug = false
452    }
453    module_out_path = module_output_path
454    sources = [ "manager/client_trans_channel_callback_test.cpp" ]
455    include_dirs = trans_sdk_test_common_inc
456    include_dirs += [
457      "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include",
458      "$dsoftbus_root_path/sdk/transmission/trans_channel/auth/include",
459      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include",
460      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
461      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/common/include",
462    ]
463    deps = trans_sdk_test_common_deps
464    deps += trans_sdk_proxy_test_deps
465    if (is_standard_system) {
466      external_deps = [ "hilog:libhilog" ]
467    } else {
468      external_deps = [ "hilog:libhilog" ]
469    }
470  }
471
472  ohos_unittest("ClientTransUdpStreamInterfaceTest") {
473    sanitize = {
474      cfi = true
475      cfi_cross_dso = true
476      debug = false
477    }
478    module_out_path = module_output_path
479    sources = [ "udp/stream/client_trans_udp_stream_interface_test.cpp" ]
480    include_dirs = trans_udp_channel_sdk_inc
481    deps = trans_sdk_test_common_deps
482    deps += trans_sdk_proxy_test_deps
483    if (is_standard_system) {
484      external_deps = [ "hilog:libhilog" ]
485    } else {
486      external_deps = [ "hilog:libhilog" ]
487    }
488  }
489
490  ohos_unittest("ClientTransStreamTest") {
491    module_out_path = module_output_path
492    sources = [ "udp/stream/client_trans_stream_test.cpp" ]
493    include_dirs = trans_udp_channel_sdk_inc
494    include_dirs += trans_sdk_test_common_inc
495    include_dirs += [
496      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/stream/src",
497      "$dsoftbus_root_path/sdk/transmission/ipc/standard/src",
498      "$dsoftbus_root_path/sdk/transmission/ipc/standard/include",
499      "$dsoftbus_root_path/core/frame/standard/init/include",
500      "$dsoftbus_root_path/sdk/transmission/session/include",
501    ]
502
503    deps = trans_sdk_test_common_deps
504    deps += trans_sdk_proxy_test_deps
505    if (is_standard_system) {
506      external_deps = [ "hilog:libhilog" ]
507    } else {
508      external_deps = [ "hilog:libhilog" ]
509    }
510  }
511
512  ohos_unittest("StreamAdaptorTest") {
513    module_out_path = module_output_path
514    sources = [ "udp/stream/stream_adaptor_test.cpp" ]
515    include_dirs = trans_udp_channel_sdk_inc
516    deps = trans_sdk_test_common_deps
517    deps += trans_sdk_proxy_test_deps
518    if (is_standard_system) {
519      external_deps = [ "hilog:libhilog" ]
520    } else {
521      external_deps = [ "hilog:libhilog" ]
522    }
523  }
524
525  module_output_path = "dsoftbus/soft_bus/transmission"
526  ohos_unittest("ClientTransProxyD2DTest") {
527    sanitize = {
528      cfi = true
529      cfi_cross_dso = true
530      debug = false
531    }
532    module_out_path = module_output_path
533    sources = [
534      "proxy/client_trans_proxy_manager_d2d_test.cpp",
535      "proxy/mock/client_trans_proxy_manager_d2d_mock.cpp",
536      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/src/client_trans_proxy_file_manager_virtual.c",
537    ]
538    include_dirs = trans_sdk_test_common_inc
539    include_dirs += [
540      "$dsoftbus_root_path/sdk/frame/common/include",
541      "$dsoftbus_root_path/sdk/transmission/trans_channel/common/include",
542      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/include",
543      "$dsoftbus_root_path/sdk/transmission/ipc/include",
544      "$dsoftbus_root_path/sdk/bus_center/manager/include",
545      "$dsoftbus_root_path/sdk/transmission/trans_channel/proxy/src",
546      "$dsoftbus_root_path/sdk/transmission/trans_channel/udp/file/include",
547      "$dsoftbus_root_path/sdk/transmission/trans_channel/manager/include",
548      "$dsoftbus_root_path/core/frame/common/include",
549      "$dsoftbus_root_path/core/transmission/common/include",
550      "$dsoftbus_root_path/interfaces/kits/lnn",
551      "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/lane_manager/include",
552      "$dsoftbus_root_path/interfaces/inner_kits/lnn",
553      "$dsoftbus_root_path/adapter/common/include/OS_adapter_define/linux",
554      "$dsoftbus_root_path/adapter/default_config/spec_config",
555      "$dsoftbus_root_path/common/security/access_token/include",
556      "$dsoftbus_root_path/adapter/common/security/access_token/include",
557      "$dsoftbus_root_path/tests/sdk/transmission/trans_channel/proxy/mock",
558    ]
559    deps = [
560      "$dsoftbus_root_path/adapter:softbus_adapter",
561      "$dsoftbus_root_path/core/common:softbus_utils",
562      "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
563    ]
564    if (is_standard_system) {
565      external_deps = [
566        "googletest:gmock",
567        "googletest:gtest_main",
568        "hilog:libhilog",
569      ]
570    } else {
571      external_deps = [
572        "googletest:gmock",
573        "googletest:gtest_main",
574        "hilog:libhilog",
575      ]
576    }
577  }
578
579  group("unittest") {
580    testonly = true
581    deps = [
582      ":ClientTransChannelCallbackTest",
583      ":ClientTransChannelManagerTest",
584      ":ClientTransPendingTest",
585      ":ClientTransProxyD2DTest",
586      ":ClientTransProxyFileCommonTest",
587      ":ClientTransProxyFileManagerMockTest",
588      ":ClientTransProxyFileManagerTest",
589      ":ClientTransProxyManagerMockTest",
590      ":ClientTransProxyManagerTest",
591      ":ClientTransUdpManagerStaticTest",
592      ":ClientTransUdpManagerTest",
593      ":TransClientProxyFileManagerMockTest",
594      ":ClientTransProxyFileHelperMockTest",
595      ":TransSdkCommStreamTest",
596      ":TransSdkStreamTest",
597      "auth:unittest",
598      "monitor_permission_test:CheckPermissionTest",
599      "permission:TransDynamicPermissionTest",
600      "qos:unittest",
601      "statistics:unittest",
602      "udp/distributed_stream:distributed_stream_test",
603      "udp/file:unittest",
604    ]
605    if (dsoftbus_feature_trans_udp == true) {
606      if (dsoftbus_feature_trans_udp_stream == true) {
607        if (!defined(ohos_lite)) {
608          deps += [
609            ":ClientTransStreamTest",
610            ":ClientTransUdpStreamInterfaceTest",
611            ":StreamAdaptorTest",
612            "tcp_direct:unittest",
613            "udp/stream/libsoftbus_stream:unittest",
614          ]
615        }
616      }
617    }
618  }
619}
620