• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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("../../../../device_status.gni")
16
17module_output_path = "${device_status_part_name}/device_status/unit_out"
18
19ohos_unittest("BoomerangClientTest") {
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24    blocklist = "./../../ipc_blocklist.txt"
25  }
26
27  branch_protector_ret = "pac_ret"
28
29  public_configs = [ "${device_status_root_path}/intention/ipc/tunnel:intention_tunnel_public_config" ]
30
31  module_out_path = module_output_path
32  include_dirs = [
33    "${device_status_interfaces_path}/innerkits/interaction/include",
34    "${device_status_utils_path}",
35    "${device_status_utils_path}/include",
36    "${device_status_root_path}/intention/boomerang/client/include",
37    "${device_status_root_path}/test/unittest/intention/boomerang/include",
38    "${device_status_root_path}/intention/ipc/tunnel/include",
39  ]
40
41  sources = [
42    "${device_status_root_path}/intention/boomerang/client/src/boomerang_client.cpp",
43    "src/boomerang_client_test.cpp",
44  ]
45
46  cflags = [
47    "-Dprivate=public",
48    "-Dprotected=public",
49  ]
50
51  configs = []
52
53  deps = [
54    "${device_status_interfaces_path}/innerkits:devicestatus_client",
55    "${device_status_root_path}/intention/ipc/socket:intention_socket_connection",
56    "${device_status_root_path}/intention/prototype:intention_prototype",
57    "${device_status_root_path}/utils/common:devicestatus_util",
58    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
59  ]
60  external_deps = [
61    "access_token:libaccesstoken_sdk",
62    "access_token:libnativetoken_shared",
63    "access_token:libtokensetproc_shared",
64    "c_utils:utils",
65    "eventhandler:libeventhandler",
66    "googletest:gmock_main",
67    "googletest:gtest_main",
68    "graphic_2d:librender_service_base",
69    "graphic_2d:librender_service_client",
70    "hilog:libhilog",
71    "hitrace:hitrace_meter",
72    "image_framework:image_native",
73    "input:libmmi-client",
74    "ipc:ipc_single",
75    "samgr:samgr_proxy",
76  ]
77}
78
79ohos_unittest("BoomerangServerTest") {
80  sanitize = {
81    integer_overflow = true
82    ubsan = true
83    boundary_sanitize = true
84    cfi = true
85    cfi_cross_dso = true
86    debug = false
87    blocklist = "./../../ipc_blocklist.txt"
88  }
89
90  branch_protector_ret = "pac_ret"
91  module_out_path = module_output_path
92  include_dirs = [
93    "include",
94    "${device_status_interfaces_path}/innerkits/interaction/include",
95    "${device_status_interfaces_path}/innerkits/include",
96    "${device_status_utils_path}",
97    "${device_status_utils_path}/include",
98    "${device_status_root_path}/intention/boomerang/data/include",
99    "${device_status_root_path}/intention/boomerang/server/include",
100    "${device_status_root_path}/intention/prototype/include",
101    "${device_status_root_path}/intention/data/include",
102    "${device_status_root_path}/libs/interface",
103    "${device_status_root_path}/services/native/include",
104    "${device_status_root_path}/services/communication/service/include",
105    "${device_status_root_path}/services/communication/base/",
106  ]
107
108  sources = [
109    "src/boomerang_server_test.cpp",
110  ]
111
112  cflags = [
113    "-Dprivate=public",
114    "-Dprotected=public",
115  ]
116
117  deps = [
118    "${device_status_root_path}/services:devicestatus_static_service",
119    "${device_status_root_path}/utils/common:devicestatus_util",
120    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
121  ]
122  external_deps = [
123    "ability_runtime:app_manager",
124    "access_token:libaccesstoken_sdk",
125    "access_token:libnativetoken_shared",
126    "access_token:libtokensetproc_shared",
127    "bundle_framework:appexecfwk_core",
128    "cJSON:cjson",
129    "c_utils:utils",
130    "eventhandler:libeventhandler",
131    "googletest:gmock_main",
132    "googletest:gtest_main",
133    "graphic_2d:libcomposer",
134    "graphic_2d:librender_service_base",
135    "graphic_2d:librender_service_client",
136    "graphic_2d:window_animation",
137    "hilog:libhilog",
138    "hisysevent:libhisysevent",
139    "hitrace:hitrace_meter",
140    "image_framework:image_native",
141    "input:libmmi-client",
142    "ipc:ipc_single",
143    "samgr:samgr_proxy",
144    "window_manager:libdm",
145    "window_manager:libwm",
146  ]
147}
148
149ohos_unittest("BoomerangManagerTest") {
150   sanitize = {
151    integer_overflow = true
152    ubsan = true
153    boundary_sanitize = true
154    cfi = true
155    cfi_cross_dso = true
156    debug = false
157    blocklist = "./../../ipc_blocklist.txt"
158  }
159
160  branch_protector_ret = "pac_ret"
161  module_out_path = module_output_path
162  include_dirs = [
163    "include",
164    "${device_status_interfaces_path}/innerkits/interaction/include",
165    "${device_status_interfaces_path}/innerkits/include",
166    "${device_status_utils_path}",
167    "${device_status_utils_path}/include",
168    "${device_status_root_path}/intention/boomerang/data/include",
169    "${device_status_root_path}/intention/boomerang/server/include",
170    "${device_status_root_path}/intention/prototype/include",
171    "${device_status_root_path}/intention/data/include",
172    "${device_status_root_path}/libs/interface",
173    "${device_status_root_path}/services/native/include",
174    "${device_status_root_path}/services/communication/service/include",
175    "${device_status_root_path}/services/communication/base/",
176  ]
177
178  sources = [
179    "src/boomerang_manager_test.cpp",
180  ]
181
182  cflags = [
183    "-Dprivate=public",
184    "-Dprotected=public",
185  ]
186
187  deps = [
188    "${device_status_root_path}/services:devicestatus_static_service",
189    "${device_status_root_path}/utils/common:devicestatus_util",
190    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
191  ]
192  external_deps = [
193    "ability_runtime:app_manager",
194    "access_token:libaccesstoken_sdk",
195    "access_token:libnativetoken_shared",
196    "access_token:libtokensetproc_shared",
197    "bundle_framework:appexecfwk_core",
198    "cJSON:cjson",
199    "c_utils:utils",
200    "eventhandler:libeventhandler",
201    "googletest:gmock_main",
202    "googletest:gtest_main",
203    "graphic_2d:libcomposer",
204    "graphic_2d:librender_service_base",
205    "graphic_2d:librender_service_client",
206    "graphic_2d:window_animation",
207    "hilog:libhilog",
208    "hisysevent:libhisysevent",
209    "hitrace:hitrace_meter",
210    "image_framework:image_native",
211    "input:libmmi-client",
212    "ipc:ipc_single",
213    "samgr:samgr_proxy",
214    "window_manager:libdm",
215    "window_manager:libwm",
216  ]
217}
218
219group("unittest") {
220  testonly = true
221  deps = [
222    ":BoomerangClientTest",
223    ":BoomerangServerTest",
224    ":BoomerangManagerTest",
225  ]
226}
227