• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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("//base/inputmethod/imf/inputmethod.gni")
15
16#####################hydra-fuzz###################
17import("//build/config/features.gni")
18import("//build/ohos.gni")
19import("//build/test.gni")
20group("system_ability_stub_fuzztest") {
21  testonly = true
22  deps = [
23    ":DisplayOptionalInputMethodFuzzTest",
24    ":GetCurrentInputmethodFuzzTest",
25    ":GetCurrentInputmethodSubtypeFuzzTest",
26    ":HideCurrentInputDeprecatedFuzzTest",
27    ":HideCurrentInputFuzzTest",
28    ":ListCurrentInputmethodSubtypeFuzzTest",
29    ":ListInputmethodFuzzTest",
30    ":ListInputmethodSubtypeFuzzTest",
31    ":PanelStatusChangeFuzzTest",
32    ":ReleaseInputFuzzTest",
33    ":SetCoreAndAgentFuzzTest",
34    ":ShowCurrentInputDeprecatedFuzzTest",
35    ":ShowCurrentInputFuzzTest",
36    ":StartInputFuzzTest",
37    ":StopInputFuzzTest",
38    ":StopInputSessionFuzzTest",
39    ":SwitchInputMethodFuzzTest",
40    ":UpdateListenEventFlagFuzzTest",
41  ]
42}
43
44common_external_deps = [
45  "ability_runtime:ability_manager",
46  "access_token:libaccesstoken_sdk",
47  "bundle_framework:appexecfwk_core",
48  "data_share:datashare_common",
49  "data_share:datashare_consumer",
50  "hilog:libhilog",
51  "input:libmmi-client",
52]
53
54common_deps = [
55  "${inputmethod_path}/services/adapter/settings_data_provider:settings_data_static",
56  "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common:imf_sa_stub_fuzztest_common_static",
57]
58
59##############################fuzztest##########################################
60ohos_fuzztest("GetCurrentInputmethodFuzzTest") {
61  module_out_path = "imf/imf"
62
63  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getcurrentinputmethod_fuzzer"
64
65  sources = [ "getcurrentinputmethod_fuzzer/getcurrentinputmethod_fuzzer.cpp" ]
66
67  include_dirs = [
68    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getcurrentinputmethod_fuzzer",
69    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
70  ]
71
72  deps = common_deps
73
74  external_deps = common_external_deps
75}
76
77ohos_fuzztest("GetCurrentInputmethodSubtypeFuzzTest") {
78  module_out_path = "imf/imf"
79
80  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getcurrentinputmethodsubtype_fuzzer"
81
82  include_dirs = [
83    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/getcurrentinputmethodsubtype_fuzzer",
84    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
85  ]
86
87  sources = [ "getcurrentinputmethodsubtype_fuzzer/getcurrentinputmethodsubtype_fuzzer.cpp" ]
88
89  deps = common_deps
90
91  external_deps = common_external_deps
92}
93
94ohos_fuzztest("HideCurrentInputFuzzTest") {
95  module_out_path = "imf/imf"
96
97  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hidecurrentinput_fuzzer"
98
99  include_dirs = [
100    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hidecurrentinput_fuzzer",
101    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
102  ]
103
104  sources = [ "hidecurrentinput_fuzzer/hidecurrentinput_fuzzer.cpp" ]
105
106  deps = common_deps
107
108  external_deps = common_external_deps
109}
110
111ohos_fuzztest("HideCurrentInputDeprecatedFuzzTest") {
112  module_out_path = "imf/imf"
113
114  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hidecurrentinputdeprecated_fuzzer"
115
116  include_dirs = [
117    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/hidecurrentinputdeprecated_fuzzer",
118    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
119  ]
120
121  sources = [
122    "hidecurrentinputdeprecated_fuzzer/hidecurrentinputdeprecated_fuzzer.cpp",
123  ]
124
125  deps = common_deps
126
127  external_deps = common_external_deps
128}
129
130ohos_fuzztest("ListCurrentInputmethodSubtypeFuzzTest") {
131  module_out_path = "imf/imf"
132
133  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listcurrentinputmethodsubtype_fuzzer"
134
135  include_dirs = [
136    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listcurrentinputmethodsubtype_fuzzer",
137    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
138  ]
139
140  sources = [ "listcurrentinputmethodsubtype_fuzzer/listcurrentinputmethodsubtype_fuzzer.cpp" ]
141
142  deps = common_deps
143
144  external_deps = common_external_deps
145}
146
147ohos_fuzztest("ListInputmethodFuzzTest") {
148  module_out_path = "imf/imf"
149
150  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listinputmethod_fuzzer"
151
152  include_dirs = [
153    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listinputmethod_fuzzer",
154    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
155  ]
156
157  sources = [ "listinputmethod_fuzzer/listinputmethod_fuzzer.cpp" ]
158
159  deps = common_deps
160
161  external_deps = common_external_deps
162}
163
164ohos_fuzztest("ListInputmethodSubtypeFuzzTest") {
165  module_out_path = "imf/imf"
166
167  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listinputmethodsubtype_fuzzer"
168
169  include_dirs = [
170    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/listinputmethodsubtype_fuzzer",
171    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
172  ]
173
174  sources =
175      [ "listinputmethodsubtype_fuzzer/listinputmethodsubtype_fuzzer.cpp" ]
176
177  deps = common_deps
178
179  external_deps = common_external_deps
180}
181
182ohos_fuzztest("PanelStatusChangeFuzzTest") {
183  module_out_path = "imf/imf"
184
185  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/panelstatuschange_fuzzer"
186
187  include_dirs = [
188    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/panelstatuschange_fuzzer",
189    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
190  ]
191
192  sources = [ "panelstatuschange_fuzzer/panelstatuschange_fuzzer.cpp" ]
193
194  deps = common_deps
195
196  external_deps = common_external_deps
197}
198
199ohos_fuzztest("ReleaseInputFuzzTest") {
200  module_out_path = "imf/imf"
201
202  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/releaseinput_fuzzer"
203
204  include_dirs = [
205    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/releaseinput_fuzzer",
206    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
207  ]
208
209  sources = [ "releaseinput_fuzzer/releaseinput_fuzzer.cpp" ]
210
211  deps = common_deps
212
213  external_deps = common_external_deps
214}
215
216ohos_fuzztest("SetCoreAndAgentFuzzTest") {
217  module_out_path = "imf/imf"
218
219  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/setcoreandagent_fuzzer"
220
221  include_dirs = [
222    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/setcoreandagent_fuzzer",
223    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
224  ]
225
226  sources = [ "setcoreandagent_fuzzer/setcoreandagent_fuzzer.cpp" ]
227
228  deps = common_deps
229
230  external_deps = common_external_deps
231}
232
233ohos_fuzztest("ShowCurrentInputFuzzTest") {
234  module_out_path = "imf/imf"
235
236  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showcurrentinput_fuzzer"
237
238  include_dirs = [
239    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showcurrentinput_fuzzer",
240    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
241  ]
242
243  sources = [ "showcurrentinput_fuzzer/showcurrentinput_fuzzer.cpp" ]
244
245  deps = common_deps
246
247  external_deps = common_external_deps
248}
249
250ohos_fuzztest("ShowCurrentInputDeprecatedFuzzTest") {
251  module_out_path = "imf/imf"
252
253  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showcurrentinputdeprecated_fuzzer"
254
255  include_dirs = [
256    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/showcurrentinputdeprecated_fuzzer",
257    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
258  ]
259
260  sources = [
261    "showcurrentinputdeprecated_fuzzer/showcurrentinputdeprecated_fuzzer.cpp",
262  ]
263
264  deps = common_deps
265
266  external_deps = common_external_deps
267}
268
269ohos_fuzztest("StartInputFuzzTest") {
270  module_out_path = "imf/imf"
271
272  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/startinput_fuzzer"
273
274  include_dirs = [
275    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/startinput_fuzzer",
276    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
277  ]
278
279  sources = [ "startinput_fuzzer/startinput_fuzzer.cpp" ]
280
281  deps = common_deps
282
283  external_deps = common_external_deps
284}
285
286ohos_fuzztest("StopInputFuzzTest") {
287  module_out_path = "imf/imf"
288
289  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/stopinput_fuzzer"
290
291  include_dirs = [
292    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/stopinput_fuzzer",
293    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
294  ]
295
296  sources = [ "stopinput_fuzzer/stopinput_fuzzer.cpp" ]
297
298  deps = common_deps
299
300  external_deps = common_external_deps
301}
302
303ohos_fuzztest("StopInputSessionFuzzTest") {
304  module_out_path = "imf/imf"
305
306  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/stopinputsession_fuzzer"
307
308  include_dirs = [
309    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/stopinputsession_fuzzer",
310    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
311  ]
312
313  sources = [ "stopinputsession_fuzzer/stopinputsession_fuzzer.cpp" ]
314
315  deps = common_deps
316
317  external_deps = common_external_deps
318}
319
320ohos_fuzztest("UpdateListenEventFlagFuzzTest") {
321  module_out_path = "imf/imf"
322
323  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/updatelisteneventflag_fuzzer"
324
325  include_dirs = [
326    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/updatelisteneventflag_fuzzer",
327    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
328  ]
329
330  sources = [ "updatelisteneventflag_fuzzer/updatelisteneventflag_fuzzer.cpp" ]
331
332  deps = common_deps
333
334  external_deps = common_external_deps
335}
336
337ohos_fuzztest("SwitchInputMethodFuzzTest") {
338  module_out_path = "imf/imf"
339
340  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/switchinputmethod_fuzzer"
341
342  include_dirs = [
343    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/switchinputmethod_fuzzer",
344    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
345  ]
346
347  sources = [ "switchinputmethod_fuzzer/switchinputmethod_fuzzer.cpp" ]
348
349  deps = common_deps
350
351  external_deps = common_external_deps
352}
353
354ohos_fuzztest("DisplayOptionalInputMethodFuzzTest") {
355  module_out_path = "imf/imf"
356
357  fuzz_config_file = "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/displayoptionalinputmethod_fuzzer"
358
359  include_dirs = [
360    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/displayoptionalinputmethod_fuzzer",
361    "${inputmethod_path}/test/fuzztest/systemabilitystubfuzztest/common",
362  ]
363
364  sources = [
365    "displayoptionalinputmethod_fuzzer/displayoptionalinputmethod_fuzzer.cpp",
366  ]
367
368  deps = common_deps
369
370  external_deps = common_external_deps
371}
372