• 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("../../test.gni")
15
16module_output_path = "previewer/cli"
17
18group("json_parse_fuzztest") {
19  testonly = true
20  deps = [
21    ":DeviceConfigParseFuzzTest",
22    ":GetHspAceModuleBuildFuzzTest",
23    ":GetModuleBufferFromHspFuzzTest",
24    ":GetModulePathMapFuzzTest",
25    ":ParseMockJsonFileFuzzTest",
26    ":ReadFileContentsFuzzTest",
27    ":SetPkgContextInfoFuzzTest",
28  ]
29}
30
31ide_fuzztest("DeviceConfigParseFuzzTest") {
32  testonly = true
33  part_name = "previewer"
34  subsystem_name = "ide"
35  module_out_path = module_output_path
36  output_name = "DeviceConfigParseFuzzTest"
37  include_dirs = [
38    "../",
39    "$ide_previewer_path/test/mock",
40    "$ide_previewer_path/cli",
41    "$ide_previewer_path/util",
42    "//third_party/libwebsockets/include",
43    "//third_party/cJSON",
44    "//third_party/bounds_checking_function/include",
45  ]
46  include_dirs += graphic_2d_include_path
47  include_dirs += window_manager_include_path
48  include_dirs += ability_runtime_include_path
49  include_dirs += ace_engine_include_path
50  include_dirs += [
51    "$ide_previewer_path/jsapp",
52    "$ide_previewer_path/jsapp/rich",
53    "$ide_previewer_path/mock",
54    "$ide_previewer_path/mock/rich",
55  ]
56  sources = [
57    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
58    "$ide_previewer_path/cli/CommandLine.cpp",
59    "$ide_previewer_path/cli/CommandLineFactory.cpp",
60    "$ide_previewer_path/cli/CommandLineInterface.cpp",
61    "$ide_previewer_path/mock/KeyInput.cpp",
62    "$ide_previewer_path/mock/MouseInput.cpp",
63    "$ide_previewer_path/mock/MouseWheel.cpp",
64    "$ide_previewer_path/mock/VirtualMessage.cpp",
65    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
66    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
67    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
68    "$ide_previewer_path/test/mock/jsapp/MockJsApp.cpp",
69    "$ide_previewer_path/test/mock/jsapp/MockJsAppImpl.cpp",
70    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
71    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
72    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
73    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
74    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
75    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
76    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
77    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
78    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
79    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
80    "$ide_previewer_path/util/CallbackQueue.cpp",
81    "$ide_previewer_path/util/CommandParser.cpp",
82    "$ide_previewer_path/util/CppTimer.cpp",
83    "$ide_previewer_path/util/CppTimerManager.cpp",
84    "$ide_previewer_path/util/FileSystem.cpp",
85    "$ide_previewer_path/util/Interrupter.cpp",
86    "$ide_previewer_path/util/JsonReader.cpp",
87    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
88    "$ide_previewer_path/util/SharedDataManager.cpp",
89    "$ide_previewer_path/util/TimeTool.cpp",
90    "$ide_previewer_path/util/TraceTool.cpp",
91    "$ide_previewer_path/util/unix/LocalDate.cpp",
92    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
93  ]
94  sources += [
95    "../ChangeJsonUtil.cpp",
96    "../main.cpp",
97    "DeviceConfigParseFuzzer.cpp",
98  ]
99  deps = [
100    "//third_party/bounds_checking_function:libsec_static",
101    "//third_party/cJSON:cjson_static",
102  ]
103  libs = []
104  cflags = [ "-Wno-error=overflow" ]
105  cflags_cc = [ "-Wno-error=overflow" ]
106  ldflags = [ "-Wno-error=overflow" ]
107}
108
109ide_fuzztest("ReadFileContentsFuzzTest") {
110  testonly = true
111  part_name = "previewer"
112  subsystem_name = "ide"
113  module_out_path = module_output_path
114  output_name = "ReadFileContentsFuzzTest"
115  sources = [
116    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
117    "$ide_previewer_path/cli/CommandLine.cpp",
118    "$ide_previewer_path/cli/CommandLineFactory.cpp",
119    "$ide_previewer_path/cli/CommandLineInterface.cpp",
120    "$ide_previewer_path/jsapp/JsApp.cpp",
121    "$ide_previewer_path/jsapp/rich/JsAppImpl.cpp",
122    "$ide_previewer_path/jsapp/rich/external/EventHandler.cpp",
123    "$ide_previewer_path/jsapp/rich/external/EventQueue.cpp",
124    "$ide_previewer_path/jsapp/rich/external/EventRunner.cpp",
125    "$ide_previewer_path/jsapp/rich/external/StageContext.cpp",
126    "$ide_previewer_path/mock/KeyInput.cpp",
127    "$ide_previewer_path/mock/MouseInput.cpp",
128    "$ide_previewer_path/mock/MouseWheel.cpp",
129    "$ide_previewer_path/mock/VirtualMessage.cpp",
130    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
131    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
132    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
133    "$ide_previewer_path/test/mock/arkui/MockAcePreviewHelper.cpp",
134    "$ide_previewer_path/test/mock/graphic/MockGlfwRenderContext.cpp",
135    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
136    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
137    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
138    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
139    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
140    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
141    "$ide_previewer_path/test/mock/util/MockClipboardHelper.cpp",
142    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
143    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
144    "$ide_previewer_path/test/mock/window/MockWindow.cpp",
145    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
146    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
147    "$ide_previewer_path/util/CallbackQueue.cpp",
148    "$ide_previewer_path/util/CommandParser.cpp",
149    "$ide_previewer_path/util/CppTimer.cpp",
150    "$ide_previewer_path/util/CppTimerManager.cpp",
151    "$ide_previewer_path/util/FileSystem.cpp",
152    "$ide_previewer_path/util/Interrupter.cpp",
153    "$ide_previewer_path/util/JsonReader.cpp",
154    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
155    "$ide_previewer_path/util/SharedDataManager.cpp",
156    "$ide_previewer_path/util/TimeTool.cpp",
157    "$ide_previewer_path/util/TraceTool.cpp",
158    "$ide_previewer_path/util/unix/LocalDate.cpp",
159    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
160  ]
161  sources += [ "$ide_previewer_path/test/mock/MockFile.cpp" ]
162  sources += [
163    "../ChangeJsonUtil.cpp",
164    "../main.cpp",
165    "ReadFileContentsFuzzer.cpp",
166  ]
167  include_dirs = [
168    "../",
169    "$ide_previewer_path/test/mock",
170    "$ide_previewer_path/test/mock/window",
171    "$ide_previewer_path/cli",
172    "$ide_previewer_path/util",
173    "//third_party/libwebsockets/include",
174    "//third_party/cJSON",
175    "//third_party/bounds_checking_function/include",
176    "//third_party/zlib",
177  ]
178  include_dirs += graphic_2d_include_path
179  include_dirs += window_manager_include_path
180  include_dirs += ability_runtime_include_path
181  include_dirs += ace_engine_include_path
182  include_dirs += [
183    "$ide_previewer_path/jsapp",
184    "$ide_previewer_path/jsapp/rich",
185    "$ide_previewer_path/jsapp/rich/external",
186    "$ide_previewer_path/mock",
187    "$ide_previewer_path/mock/rich",
188  ]
189  deps = [
190    "//third_party/bounds_checking_function:libsec_static",
191    "//third_party/cJSON:cjson_static",
192    "//third_party/zlib:libz",
193  ]
194  libs = []
195  cflags = [ "-Wno-error=overflow" ]
196  cflags_cc = [ "-Wno-error=overflow" ]
197  ldflags = [ "-Wno-error=overflow" ]
198}
199
200ide_fuzztest("GetModulePathMapFuzzTest") {
201  testonly = true
202  part_name = "previewer"
203  subsystem_name = "ide"
204  module_out_path = module_output_path
205  output_name = "GetModulePathMapFuzzTest"
206  sources = [
207    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
208    "$ide_previewer_path/cli/CommandLine.cpp",
209    "$ide_previewer_path/cli/CommandLineFactory.cpp",
210    "$ide_previewer_path/cli/CommandLineInterface.cpp",
211    "$ide_previewer_path/jsapp/JsApp.cpp",
212    "$ide_previewer_path/jsapp/rich/JsAppImpl.cpp",
213    "$ide_previewer_path/jsapp/rich/external/EventHandler.cpp",
214    "$ide_previewer_path/jsapp/rich/external/EventQueue.cpp",
215    "$ide_previewer_path/jsapp/rich/external/EventRunner.cpp",
216    "$ide_previewer_path/jsapp/rich/external/StageContext.cpp",
217    "$ide_previewer_path/mock/KeyInput.cpp",
218    "$ide_previewer_path/mock/MouseInput.cpp",
219    "$ide_previewer_path/mock/MouseWheel.cpp",
220    "$ide_previewer_path/mock/VirtualMessage.cpp",
221    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
222    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
223    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
224    "$ide_previewer_path/test/mock/arkui/MockAcePreviewHelper.cpp",
225    "$ide_previewer_path/test/mock/graphic/MockGlfwRenderContext.cpp",
226    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
227    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
228    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
229    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
230    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
231    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
232    "$ide_previewer_path/test/mock/util/MockClipboardHelper.cpp",
233    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
234    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
235    "$ide_previewer_path/test/mock/window/MockWindow.cpp",
236    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
237    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
238    "$ide_previewer_path/util/CallbackQueue.cpp",
239    "$ide_previewer_path/util/CommandParser.cpp",
240    "$ide_previewer_path/util/CppTimer.cpp",
241    "$ide_previewer_path/util/CppTimerManager.cpp",
242    "$ide_previewer_path/util/FileSystem.cpp",
243    "$ide_previewer_path/util/Interrupter.cpp",
244    "$ide_previewer_path/util/JsonReader.cpp",
245    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
246    "$ide_previewer_path/util/SharedDataManager.cpp",
247    "$ide_previewer_path/util/TimeTool.cpp",
248    "$ide_previewer_path/util/TraceTool.cpp",
249    "$ide_previewer_path/util/unix/LocalDate.cpp",
250    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
251  ]
252  sources += [
253    "../ChangeJsonUtil.cpp",
254    "../main.cpp",
255    "GetModulePathMapFuzzer.cpp",
256  ]
257  include_dirs = [
258    "../",
259    "$ide_previewer_path/test/mock",
260    "$ide_previewer_path/test/mock/window",
261    "$ide_previewer_path/cli",
262    "$ide_previewer_path/util",
263    "//third_party/libwebsockets/include",
264    "//third_party/cJSON",
265    "//third_party/bounds_checking_function/include",
266    "//third_party/zlib",
267  ]
268  include_dirs += graphic_2d_include_path
269  include_dirs += window_manager_include_path
270  include_dirs += ability_runtime_include_path
271  include_dirs += ace_engine_include_path
272  include_dirs += [
273    "$ide_previewer_path/jsapp",
274    "$ide_previewer_path/jsapp/rich",
275    "$ide_previewer_path/jsapp/rich/external",
276    "$ide_previewer_path/mock",
277    "$ide_previewer_path/mock/rich",
278  ]
279  deps = [
280    "//third_party/bounds_checking_function:libsec_static",
281    "//third_party/cJSON:cjson_static",
282    "//third_party/zlib:libz",
283  ]
284  libs = []
285  cflags = [ "-Wno-error=overflow" ]
286  cflags_cc = [ "-Wno-error=overflow" ]
287  ldflags = [ "-Wno-error=overflow" ]
288}
289
290ide_fuzztest("GetHspAceModuleBuildFuzzTest") {
291  testonly = true
292  part_name = "previewer"
293  subsystem_name = "ide"
294  module_out_path = module_output_path
295  output_name = "GetHspAceModuleBuildFuzzTest"
296  sources = [
297    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
298    "$ide_previewer_path/cli/CommandLine.cpp",
299    "$ide_previewer_path/cli/CommandLineFactory.cpp",
300    "$ide_previewer_path/cli/CommandLineInterface.cpp",
301    "$ide_previewer_path/jsapp/JsApp.cpp",
302    "$ide_previewer_path/jsapp/rich/JsAppImpl.cpp",
303    "$ide_previewer_path/jsapp/rich/external/EventHandler.cpp",
304    "$ide_previewer_path/jsapp/rich/external/EventQueue.cpp",
305    "$ide_previewer_path/jsapp/rich/external/EventRunner.cpp",
306    "$ide_previewer_path/jsapp/rich/external/StageContext.cpp",
307    "$ide_previewer_path/mock/KeyInput.cpp",
308    "$ide_previewer_path/mock/MouseInput.cpp",
309    "$ide_previewer_path/mock/MouseWheel.cpp",
310    "$ide_previewer_path/mock/VirtualMessage.cpp",
311    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
312    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
313    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
314    "$ide_previewer_path/test/mock/arkui/MockAcePreviewHelper.cpp",
315    "$ide_previewer_path/test/mock/graphic/MockGlfwRenderContext.cpp",
316    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
317    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
318    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
319    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
320    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
321    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
322    "$ide_previewer_path/test/mock/util/MockClipboardHelper.cpp",
323    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
324    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
325    "$ide_previewer_path/test/mock/window/MockWindow.cpp",
326    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
327    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
328    "$ide_previewer_path/util/CallbackQueue.cpp",
329    "$ide_previewer_path/util/CommandParser.cpp",
330    "$ide_previewer_path/util/CppTimer.cpp",
331    "$ide_previewer_path/util/CppTimerManager.cpp",
332    "$ide_previewer_path/util/FileSystem.cpp",
333    "$ide_previewer_path/util/Interrupter.cpp",
334    "$ide_previewer_path/util/JsonReader.cpp",
335    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
336    "$ide_previewer_path/util/SharedDataManager.cpp",
337    "$ide_previewer_path/util/TimeTool.cpp",
338    "$ide_previewer_path/util/TraceTool.cpp",
339    "$ide_previewer_path/util/unix/LocalDate.cpp",
340    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
341  ]
342  sources += [
343    "../ChangeJsonUtil.cpp",
344    "../main.cpp",
345    "GetHspAceModuleBuildFuzzer.cpp",
346  ]
347  include_dirs = [
348    "../",
349    "$ide_previewer_path/test/mock",
350    "$ide_previewer_path/test/mock/window",
351    "$ide_previewer_path/cli",
352    "$ide_previewer_path/util",
353    "//third_party/libwebsockets/include",
354    "//third_party/cJSON",
355    "//third_party/bounds_checking_function/include",
356    "//third_party/zlib",
357  ]
358  include_dirs += graphic_2d_include_path
359  include_dirs += window_manager_include_path
360  include_dirs += ability_runtime_include_path
361  include_dirs += ace_engine_include_path
362  include_dirs += [
363    "$ide_previewer_path/jsapp",
364    "$ide_previewer_path/jsapp/rich",
365    "$ide_previewer_path/jsapp/rich/external",
366    "$ide_previewer_path/mock",
367    "$ide_previewer_path/mock/rich",
368  ]
369  deps = [
370    "//third_party/bounds_checking_function:libsec_static",
371    "//third_party/cJSON:cjson_static",
372    "//third_party/zlib:libz",
373  ]
374  libs = []
375  cflags = [ "-Wno-error=overflow" ]
376  cflags_cc = [ "-Wno-error=overflow" ]
377  ldflags = [ "-Wno-error=overflow" ]
378}
379
380ide_fuzztest("GetModuleBufferFromHspFuzzTest") {
381  testonly = true
382  part_name = "previewer"
383  subsystem_name = "ide"
384  module_out_path = module_output_path
385  output_name = "GetModuleBufferFromHspFuzzTest"
386  sources = [
387    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
388    "$ide_previewer_path/cli/CommandLine.cpp",
389    "$ide_previewer_path/cli/CommandLineFactory.cpp",
390    "$ide_previewer_path/cli/CommandLineInterface.cpp",
391    "$ide_previewer_path/jsapp/JsApp.cpp",
392    "$ide_previewer_path/jsapp/rich/JsAppImpl.cpp",
393    "$ide_previewer_path/jsapp/rich/external/EventHandler.cpp",
394    "$ide_previewer_path/jsapp/rich/external/EventQueue.cpp",
395    "$ide_previewer_path/jsapp/rich/external/EventRunner.cpp",
396    "$ide_previewer_path/jsapp/rich/external/StageContext.cpp",
397    "$ide_previewer_path/mock/KeyInput.cpp",
398    "$ide_previewer_path/mock/MouseInput.cpp",
399    "$ide_previewer_path/mock/MouseWheel.cpp",
400    "$ide_previewer_path/mock/VirtualMessage.cpp",
401    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
402    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
403    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
404    "$ide_previewer_path/test/mock/arkui/MockAcePreviewHelper.cpp",
405    "$ide_previewer_path/test/mock/graphic/MockGlfwRenderContext.cpp",
406    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
407    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
408    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
409    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
410    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
411    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
412    "$ide_previewer_path/test/mock/util/MockClipboardHelper.cpp",
413    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
414    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
415    "$ide_previewer_path/test/mock/window/MockWindow.cpp",
416    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
417    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
418    "$ide_previewer_path/util/CallbackQueue.cpp",
419    "$ide_previewer_path/util/CommandParser.cpp",
420    "$ide_previewer_path/util/CppTimer.cpp",
421    "$ide_previewer_path/util/CppTimerManager.cpp",
422    "$ide_previewer_path/util/FileSystem.cpp",
423    "$ide_previewer_path/util/Interrupter.cpp",
424    "$ide_previewer_path/util/JsonReader.cpp",
425    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
426    "$ide_previewer_path/util/SharedDataManager.cpp",
427    "$ide_previewer_path/util/TimeTool.cpp",
428    "$ide_previewer_path/util/TraceTool.cpp",
429    "$ide_previewer_path/util/unix/LocalDate.cpp",
430    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
431  ]
432  sources += [ "$ide_previewer_path/test/mock/MockFile.cpp" ]
433  sources += [
434    "../ChangeJsonUtil.cpp",
435    "../main.cpp",
436    "GetModuleBufferFromHspFuzzer.cpp",
437  ]
438  include_dirs = [
439    "../",
440    "$ide_previewer_path/test/mock",
441    "$ide_previewer_path/test/mock/window",
442    "$ide_previewer_path/cli",
443    "$ide_previewer_path/util",
444    "//third_party/libwebsockets/include",
445    "//third_party/cJSON",
446    "//third_party/bounds_checking_function/include",
447    "//third_party/zlib",
448  ]
449  include_dirs += graphic_2d_include_path
450  include_dirs += window_manager_include_path
451  include_dirs += ability_runtime_include_path
452  include_dirs += ace_engine_include_path
453  include_dirs += [
454    "$ide_previewer_path/jsapp",
455    "$ide_previewer_path/jsapp/rich",
456    "$ide_previewer_path/jsapp/rich/external",
457    "$ide_previewer_path/mock",
458    "$ide_previewer_path/mock/rich",
459  ]
460  deps = [
461    "//third_party/bounds_checking_function:libsec_static",
462    "//third_party/cJSON:cjson_static",
463    "//third_party/zlib:libz",
464  ]
465  libs = []
466  cflags = [ "-Wno-error=overflow" ]
467  cflags_cc = [ "-Wno-error=overflow" ]
468  ldflags = [ "-Wno-error=overflow" ]
469}
470
471ide_fuzztest("ParseMockJsonFileFuzzTest") {
472  testonly = true
473  part_name = "previewer"
474  subsystem_name = "ide"
475  module_out_path = module_output_path
476  output_name = "ParseMockJsonFileFuzzTest"
477  sources = [
478    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
479    "$ide_previewer_path/cli/CommandLine.cpp",
480    "$ide_previewer_path/cli/CommandLineFactory.cpp",
481    "$ide_previewer_path/cli/CommandLineInterface.cpp",
482    "$ide_previewer_path/jsapp/JsApp.cpp",
483    "$ide_previewer_path/jsapp/rich/JsAppImpl.cpp",
484    "$ide_previewer_path/jsapp/rich/external/EventHandler.cpp",
485    "$ide_previewer_path/jsapp/rich/external/EventQueue.cpp",
486    "$ide_previewer_path/jsapp/rich/external/EventRunner.cpp",
487    "$ide_previewer_path/jsapp/rich/external/StageContext.cpp",
488    "$ide_previewer_path/mock/KeyInput.cpp",
489    "$ide_previewer_path/mock/MouseInput.cpp",
490    "$ide_previewer_path/mock/MouseWheel.cpp",
491    "$ide_previewer_path/mock/VirtualMessage.cpp",
492    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
493    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
494    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
495    "$ide_previewer_path/test/mock/arkui/MockAcePreviewHelper.cpp",
496    "$ide_previewer_path/test/mock/graphic/MockGlfwRenderContext.cpp",
497    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
498    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
499    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
500    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
501    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
502    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
503    "$ide_previewer_path/test/mock/util/MockClipboardHelper.cpp",
504    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
505    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
506    "$ide_previewer_path/test/mock/window/MockWindow.cpp",
507    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
508    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
509    "$ide_previewer_path/util/CallbackQueue.cpp",
510    "$ide_previewer_path/util/CommandParser.cpp",
511    "$ide_previewer_path/util/CppTimer.cpp",
512    "$ide_previewer_path/util/CppTimerManager.cpp",
513    "$ide_previewer_path/util/FileSystem.cpp",
514    "$ide_previewer_path/util/Interrupter.cpp",
515    "$ide_previewer_path/util/JsonReader.cpp",
516    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
517    "$ide_previewer_path/util/SharedDataManager.cpp",
518    "$ide_previewer_path/util/TimeTool.cpp",
519    "$ide_previewer_path/util/TraceTool.cpp",
520    "$ide_previewer_path/util/unix/LocalDate.cpp",
521    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
522  ]
523  sources += [
524    "../ChangeJsonUtil.cpp",
525    "../main.cpp",
526    "ParseMockJsonFileFuzzer.cpp",
527  ]
528  include_dirs = [
529    "../",
530    "$ide_previewer_path/test/mock",
531    "$ide_previewer_path/test/mock/window",
532    "$ide_previewer_path/cli",
533    "$ide_previewer_path/util",
534    "//third_party/libwebsockets/include",
535    "//third_party/cJSON",
536    "//third_party/bounds_checking_function/include",
537    "//third_party/zlib",
538  ]
539  include_dirs += graphic_2d_include_path
540  include_dirs += window_manager_include_path
541  include_dirs += ability_runtime_include_path
542  include_dirs += ace_engine_include_path
543  include_dirs += [
544    "$ide_previewer_path/jsapp",
545    "$ide_previewer_path/jsapp/rich",
546    "$ide_previewer_path/jsapp/rich/external",
547    "$ide_previewer_path/mock",
548    "$ide_previewer_path/mock/rich",
549  ]
550  deps = [
551    "//third_party/bounds_checking_function:libsec_static",
552    "//third_party/cJSON:cjson_static",
553    "//third_party/zlib:libz",
554  ]
555  libs = []
556  cflags = [ "-Wno-error=overflow" ]
557  cflags_cc = [ "-Wno-error=overflow" ]
558  ldflags = [ "-Wno-error=overflow" ]
559}
560
561ide_fuzztest("SetPkgContextInfoFuzzTest") {
562  testonly = true
563  part_name = "previewer"
564  subsystem_name = "ide"
565  module_out_path = module_output_path
566  output_name = "SetPkgContextInfoFuzzTest"
567  sources = [
568    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
569    "$ide_previewer_path/cli/CommandLine.cpp",
570    "$ide_previewer_path/cli/CommandLineFactory.cpp",
571    "$ide_previewer_path/cli/CommandLineInterface.cpp",
572    "$ide_previewer_path/jsapp/JsApp.cpp",
573    "$ide_previewer_path/jsapp/rich/JsAppImpl.cpp",
574    "$ide_previewer_path/jsapp/rich/external/EventHandler.cpp",
575    "$ide_previewer_path/jsapp/rich/external/EventQueue.cpp",
576    "$ide_previewer_path/jsapp/rich/external/EventRunner.cpp",
577    "$ide_previewer_path/jsapp/rich/external/StageContext.cpp",
578    "$ide_previewer_path/mock/KeyInput.cpp",
579    "$ide_previewer_path/mock/MouseInput.cpp",
580    "$ide_previewer_path/mock/MouseWheel.cpp",
581    "$ide_previewer_path/mock/VirtualMessage.cpp",
582    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
583    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
584    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
585    "$ide_previewer_path/test/mock/arkui/MockAcePreviewHelper.cpp",
586    "$ide_previewer_path/test/mock/graphic/MockGlfwRenderContext.cpp",
587    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
588    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
589    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
590    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
591    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
592    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
593    "$ide_previewer_path/test/mock/util/MockClipboardHelper.cpp",
594    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
595    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
596    "$ide_previewer_path/test/mock/window/MockWindow.cpp",
597    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
598    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
599    "$ide_previewer_path/util/CallbackQueue.cpp",
600    "$ide_previewer_path/util/CommandParser.cpp",
601    "$ide_previewer_path/util/CppTimer.cpp",
602    "$ide_previewer_path/util/CppTimerManager.cpp",
603    "$ide_previewer_path/util/FileSystem.cpp",
604    "$ide_previewer_path/util/Interrupter.cpp",
605    "$ide_previewer_path/util/JsonReader.cpp",
606    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
607    "$ide_previewer_path/util/SharedDataManager.cpp",
608    "$ide_previewer_path/util/TimeTool.cpp",
609    "$ide_previewer_path/util/TraceTool.cpp",
610    "$ide_previewer_path/util/unix/LocalDate.cpp",
611    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
612  ]
613  sources += [
614    "../ChangeJsonUtil.cpp",
615    "../main.cpp",
616    "SetPkgContextInfoFuzzer.cpp",
617  ]
618  include_dirs = [
619    "../",
620    "$ide_previewer_path/test/mock",
621    "$ide_previewer_path/test/mock/window",
622    "$ide_previewer_path/cli",
623    "$ide_previewer_path/util",
624    "//third_party/libwebsockets/include",
625    "//third_party/cJSON",
626    "//third_party/bounds_checking_function/include",
627    "//third_party/zlib",
628  ]
629  include_dirs += graphic_2d_include_path
630  include_dirs += window_manager_include_path
631  include_dirs += ability_runtime_include_path
632  include_dirs += ace_engine_include_path
633  include_dirs += [
634    "$ide_previewer_path/jsapp",
635    "$ide_previewer_path/jsapp/rich",
636    "$ide_previewer_path/jsapp/rich/external",
637    "$ide_previewer_path/mock",
638    "$ide_previewer_path/mock/rich",
639  ]
640  deps = [
641    "//third_party/bounds_checking_function:libsec_static",
642    "//third_party/cJSON:cjson_static",
643    "//third_party/zlib:libz",
644  ]
645  libs = []
646  cflags = [ "-Wno-error=overflow" ]
647  cflags_cc = [ "-Wno-error=overflow" ]
648  ldflags = [ "-Wno-error=overflow" ]
649}
650