• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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}/device_status/unit_out"
18
19ohos_unittest("InputAdapterTest") {
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  module_out_path = module_output_path
29  include_dirs = [
30    "include",
31    "${device_status_utils_path}",
32    "${device_status_utils_path}/include",
33    "${device_status_root_path}/intention/prototype/include",
34  ]
35
36  sources = [ "src/input_adapter_test.cpp" ]
37
38  deps = [ "${device_status_root_path}/intention/adapters/input_adapter:intention_input_adapter" ]
39  external_deps = [
40    "access_token:libaccesstoken_sdk",
41    "access_token:libnativetoken_shared",
42    "access_token:libtokensetproc_shared",
43    "c_utils:utils",
44    "data_share:datashare_consumer",
45    "hilog:libhilog",
46    "input:libmmi-client",
47  ]
48}
49
50ohos_unittest("DsoftbusAdapterTest") {
51  sanitize = {
52    cfi = true
53    cfi_cross_dso = true
54    debug = false
55    blocklist = "./../../ipc_blocklist.txt"
56  }
57
58  cflags = [ "-Dprivate=public" ]
59
60  branch_protector_ret = "pac_ret"
61  module_out_path = module_output_path
62  include_dirs = [
63    "${device_status_utils_path}",
64    "${device_status_utils_path}/include",
65    "${device_status_root_path}/intention/prototype/include",
66    "${device_status_root_path}/utils/json_parser/include"
67  ]
68
69  sources = [ "src/dsoftbus_adapter_test.cpp" ]
70
71  deps = [
72    "${device_status_root_path}/intention/adapters/dsoftbus_adapter:intention_dsoftbus_adapter",
73    "${device_status_root_path}/intention/prototype:intention_prototype",
74    "${device_status_root_path}/utils/common:devicestatus_util",
75    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
76  ]
77  external_deps = [
78    "access_token:libaccesstoken_sdk",
79    "access_token:libnativetoken_shared",
80    "access_token:libtokensetproc_shared",
81    "cJSON:cjson",
82    "c_utils:utils",
83    "device_manager:devicemanagersdk",
84    "dsoftbus:softbus_client",
85    "eventhandler:libeventhandler",
86    "hilog:libhilog",
87    "input:libmmi-client",
88  ]
89}
90
91ohos_unittest("DDMAdapterTest") {
92  sanitize = {
93    cfi = true
94    cfi_cross_dso = true
95    debug = false
96    blocklist = "./../../ipc_blocklist.txt"
97  }
98
99  cflags = [ "-Dprivate=public" ]
100
101  branch_protector_ret = "pac_ret"
102  module_out_path = module_output_path
103  include_dirs = [
104    "${device_status_utils_path}",
105    "${device_status_utils_path}/include",
106    "${device_status_root_path}/intention/prototype/include",
107  ]
108
109  sources = [ "src/ddm_adapter_test.cpp" ]
110
111  deps = [ "${device_status_root_path}/intention/adapters/ddm_adapter:intention_ddm_adapter" ]
112  external_deps = [
113    "ability_base:want",
114    "access_token:libaccesstoken_sdk",
115    "access_token:libnativetoken_shared",
116    "access_token:libtokensetproc_shared",
117    "c_utils:utils",
118    "device_manager:devicemanagersdk",
119    "dsoftbus:softbus_client",
120    "hilog:libhilog",
121    "input:libmmi-client",
122    "ipc:ipc_single",
123  ]
124}
125
126ohos_unittest("CommonEventAdapterTest") {
127  sanitize = {
128    cfi = true
129    cfi_cross_dso = true
130    debug = false
131    blocklist = "./../../ipc_blocklist.txt"
132  }
133
134  cflags = [ "-Dprivate=public" ]
135
136  branch_protector_ret = "pac_ret"
137  module_out_path = module_output_path
138  include_dirs = [
139    "${device_status_utils_path}",
140    "${device_status_utils_path}/include",
141    "${device_status_root_path}/intention/prototype/include",
142  ]
143
144  sources = [ "src/common_event_adapter_test.cpp" ]
145
146  deps = [ "${device_status_root_path}/intention/adapters/common_event_adapter:intention_common_event_adapter" ]
147  external_deps = [
148    "ability_base:want",
149    "c_utils:utils",
150    "hilog:libhilog",
151    "input:libmmi-client",
152    "common_event_service:cesfwk_innerkits",
153  ]
154}
155
156group("unittest") {
157  testonly = true
158  deps = [
159    ":CommonEventAdapterTest",
160    ":DDMAdapterTest",
161    ":DsoftbusAdapterTest",
162    ":InputAdapterTest",
163  ]
164}
165