1# Copyright (c) 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("../../../device_status.gni")
16
17module_output_path = "${device_status_part_name}/unit_out"
18
19ohos_unittest("CooperateClientTest") {
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24  }
25
26  branch_protector_ret = "pac_ret"
27
28  module_out_path = module_output_path
29  include_dirs = [
30    "${device_status_interfaces_path}/innerkits/interaction/include",
31    "${device_status_utils_path}",
32    "${device_status_utils_path}/include",
33    "${device_status_root_path}/intention/cooperate/client/include",
34  ]
35
36  defines = []
37
38  sources = [ "src/cooperate_client_test.cpp" ]
39
40  cflags = [
41    "-Dprivate=public",
42    "-Dprotected=public",
43  ]
44
45  configs = []
46
47  deps = [
48    "${device_status_root_path}/intention/cooperate/client:intention_cooperate_client",
49    "${device_status_root_path}/intention/cooperate/data:intention_cooperate_data",
50    "${device_status_root_path}/intention/data:intention_data",
51    "${device_status_root_path}/intention/ipc/socket:intention_socket_connection",
52    "${device_status_root_path}/intention/ipc/tunnel:intention_tunnel_client",
53    "${device_status_root_path}/intention/prototype:intention_prototype",
54    "${device_status_root_path}/utils/common:devicestatus_util",
55    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
56  ]
57  external_deps = [
58    "access_token:libaccesstoken_sdk",
59    "access_token:libnativetoken_shared",
60    "access_token:libtokensetproc_shared",
61    "c_utils:utils",
62    "eventhandler:libeventhandler",
63    "hilog:libhilog",
64    "hitrace:hitrace_meter",
65    "image_framework:image_native",
66    "input:libmmi-client",
67    "ipc:ipc_single",
68    "samgr:samgr_proxy",
69  ]
70}
71
72ohos_unittest("CooperateServerTest") {
73  module_out_path = module_output_path
74
75  sanitize = {
76    integer_overflow = true
77    ubsan = true
78    boundary_sanitize = true
79    cfi = true
80    cfi_cross_dso = true
81    debug = false
82  }
83
84  branch_protector_ret = "pac_ret"
85
86  include_dirs = [
87    "include",
88    "${device_status_interfaces_path}/innerkits/interaction/include",
89    "${device_status_interfaces_path}/innerkits/include",
90    "${device_status_utils_path}",
91    "${device_status_utils_path}/include",
92    "${device_status_root_path}/intention/prototype/include",
93    "${device_status_root_path}/services/native/include",
94    "${device_status_root_path}/services/communication/service/include",
95    "${device_status_root_path}/services/communication/base/",
96  ]
97
98  defines = []
99
100  sources = [
101    "src/cooperate_server_test.cpp",
102    "src/test_context.cpp",
103  ]
104
105  configs = []
106
107  defines = device_status_default_defines
108
109  cflags = [ "-Dprivate=public" ]
110
111  deps = [
112    "${device_status_root_path}/intention/adapters/dsoftbus_adapter:intention_dsoftbus_adapter",
113    "${device_status_root_path}/intention/adapters/input_adapter:intention_input_adapter",
114    "${device_status_root_path}/intention/cooperate/data:intention_cooperate_data",
115    "${device_status_root_path}/intention/cooperate/server:intention_cooperate_server",
116    "${device_status_root_path}/intention/data:intention_data",
117    "${device_status_root_path}/intention/ipc/socket:intention_socket_session_manager",
118    "${device_status_root_path}/intention/prototype:intention_prototype",
119    "${device_status_root_path}/intention/scheduler/plugin_manager:intention_plugin_manager",
120    "${device_status_root_path}/intention/scheduler/timer_manager:intention_timer_manager",
121    "${device_status_root_path}/intention/services/device_manager:intention_device_manager",
122    "${device_status_root_path}/services/interaction/drag:interaction_drag",
123    "${device_status_root_path}/utils/common:devicestatus_util",
124    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
125  ]
126  external_deps = [
127    "ability_runtime:app_manager",
128    "access_token:libaccesstoken_sdk",
129    "access_token:libnativetoken_shared",
130    "access_token:libtokensetproc_shared",
131    "cJSON:cjson",
132    "c_utils:utils",
133    "eventhandler:libeventhandler",
134    "graphic_2d:libcomposer",
135    "graphic_2d:librender_service_base",
136    "graphic_2d:librender_service_client",
137    "graphic_2d:window_animation",
138    "hilog:libhilog",
139    "hitrace:hitrace_meter",
140    "image_framework:image_native",
141    "input:libmmi-client",
142    "ipc:ipc_single",
143    "samgr:samgr_proxy",
144  ]
145}
146
147group("intention_cooperate_tests") {
148  testonly = true
149  deps = [
150    ":CooperateClientTest",
151    ":CooperateServerTest",
152  ]
153}
154