• 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("command_parse_fuzztest") {
19  testonly = true
20  deps = [
21    ":CommonCommandParseFuzzTest",
22    ":LiteCommandParseFuzzTest",
23    ":RichCommandParseFuzzTest",
24  ]
25}
26
27ide_fuzztest("RichCommandParseFuzzTest") {
28  testonly = true
29  part_name = "previewer"
30  subsystem_name = "ide"
31  module_out_path = module_output_path
32  output_name = "RichCommandParseFuzzTest"
33  include_dirs = [
34    "../",
35    "$ide_previewer_path/test/mock",
36    "$ide_previewer_path/cli",
37    "$ide_previewer_path/util",
38    "//third_party/libwebsockets/include",
39    "//third_party/cJSON",
40    "//third_party/bounds_checking_function/include",
41  ]
42  include_dirs += graphic_2d_include_path
43  include_dirs += window_manager_include_path
44  include_dirs += ability_runtime_include_path
45  include_dirs += ace_engine_include_path
46  include_dirs += [
47    "$ide_previewer_path/jsapp",
48    "$ide_previewer_path/jsapp/rich",
49    "$ide_previewer_path/mock",
50    "$ide_previewer_path/mock/rich",
51  ]
52  sources = [
53    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
54    "$ide_previewer_path/cli/CommandLine.cpp",
55    "$ide_previewer_path/cli/CommandLineFactory.cpp",
56    "$ide_previewer_path/cli/CommandLineInterface.cpp",
57    "$ide_previewer_path/mock/KeyInput.cpp",
58    "$ide_previewer_path/mock/MouseInput.cpp",
59    "$ide_previewer_path/mock/MouseWheel.cpp",
60    "$ide_previewer_path/mock/VirtualMessage.cpp",
61    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
62    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
63    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
64    "$ide_previewer_path/test/mock/jsapp/MockJsApp.cpp",
65    "$ide_previewer_path/test/mock/jsapp/MockJsAppImpl.cpp",
66    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
67    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
68    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
69    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
70    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
71    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
72    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
73    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
74    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
75    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
76    "$ide_previewer_path/util/CallbackQueue.cpp",
77    "$ide_previewer_path/util/CommandParser.cpp",
78    "$ide_previewer_path/util/CppTimer.cpp",
79    "$ide_previewer_path/util/CppTimerManager.cpp",
80    "$ide_previewer_path/util/FileSystem.cpp",
81    "$ide_previewer_path/util/Interrupter.cpp",
82    "$ide_previewer_path/util/JsonReader.cpp",
83    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
84    "$ide_previewer_path/util/SharedDataManager.cpp",
85    "$ide_previewer_path/util/TimeTool.cpp",
86    "$ide_previewer_path/util/TraceTool.cpp",
87    "$ide_previewer_path/util/unix/LocalDate.cpp",
88    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
89  ]
90  sources += [
91    "../ChangeJsonUtil.cpp",
92    "../main.cpp",
93    "CommandParse.cpp",
94    "RichCommandParseFuzzer.cpp",
95  ]
96  deps = [
97    "//third_party/bounds_checking_function:libsec_static",
98    "//third_party/cJSON:cjson_static",
99  ]
100  libs = []
101  cflags = [ "-Wno-error=overflow" ]
102  cflags_cc = [ "-Wno-error=overflow" ]
103  ldflags = [ "-Wno-error=overflow" ]
104}
105
106ide_fuzztest("LiteCommandParseFuzzTest") {
107  testonly = true
108  part_name = "previewer"
109  subsystem_name = "ide"
110  module_out_path = module_output_path
111  output_name = "LiteCommandParseFuzzTest"
112  include_dirs = [
113    "../",
114    "$ide_previewer_path/test/mock",
115    "$ide_previewer_path/cli",
116    "$ide_previewer_path/util",
117    "//third_party/libwebsockets/include",
118    "//third_party/cJSON",
119    "//third_party/bounds_checking_function/include",
120  ]
121  include_dirs += graphic_2d_include_path
122  include_dirs += window_manager_include_path
123  include_dirs += ability_runtime_include_path
124  include_dirs += ace_engine_include_path
125  include_dirs += [
126    "$ide_previewer_path/jsapp",
127    "$ide_previewer_path/jsapp/rich",
128    "$ide_previewer_path/mock",
129    "$ide_previewer_path/mock/rich",
130  ]
131  sources = [
132    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
133    "$ide_previewer_path/cli/CommandLine.cpp",
134    "$ide_previewer_path/cli/CommandLineFactory.cpp",
135    "$ide_previewer_path/cli/CommandLineInterface.cpp",
136    "$ide_previewer_path/mock/KeyInput.cpp",
137    "$ide_previewer_path/mock/MouseInput.cpp",
138    "$ide_previewer_path/mock/MouseWheel.cpp",
139    "$ide_previewer_path/mock/VirtualMessage.cpp",
140    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
141    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
142    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
143    "$ide_previewer_path/test/mock/jsapp/MockJsApp.cpp",
144    "$ide_previewer_path/test/mock/jsapp/MockJsAppImpl.cpp",
145    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
146    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
147    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
148    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
149    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
150    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
151    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
152    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
153    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
154    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
155    "$ide_previewer_path/util/CallbackQueue.cpp",
156    "$ide_previewer_path/util/CommandParser.cpp",
157    "$ide_previewer_path/util/CppTimer.cpp",
158    "$ide_previewer_path/util/CppTimerManager.cpp",
159    "$ide_previewer_path/util/FileSystem.cpp",
160    "$ide_previewer_path/util/Interrupter.cpp",
161    "$ide_previewer_path/util/JsonReader.cpp",
162    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
163    "$ide_previewer_path/util/SharedDataManager.cpp",
164    "$ide_previewer_path/util/TimeTool.cpp",
165    "$ide_previewer_path/util/TraceTool.cpp",
166    "$ide_previewer_path/util/unix/LocalDate.cpp",
167    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
168  ]
169  sources += [
170    "../ChangeJsonUtil.cpp",
171    "../main.cpp",
172    "CommandParse.cpp",
173    "LiteCommandParseFuzzer.cpp",
174  ]
175  deps = [
176    "//third_party/bounds_checking_function:libsec_static",
177    "//third_party/cJSON:cjson_static",
178  ]
179  libs = []
180  cflags = [ "-Wno-error=overflow" ]
181  cflags_cc = [ "-Wno-error=overflow" ]
182  ldflags = [ "-Wno-error=overflow" ]
183}
184
185ide_fuzztest("CommonCommandParseFuzzTest") {
186  testonly = true
187  part_name = "previewer"
188  subsystem_name = "ide"
189  module_out_path = module_output_path
190  output_name = "CommonCommandParseFuzzTest"
191  include_dirs = [
192    "../",
193    "$ide_previewer_path/test/mock",
194    "$ide_previewer_path/cli",
195    "$ide_previewer_path/util",
196    "//third_party/libwebsockets/include",
197    "//third_party/cJSON",
198    "//third_party/bounds_checking_function/include",
199  ]
200  include_dirs += graphic_2d_include_path
201  include_dirs += window_manager_include_path
202  include_dirs += ability_runtime_include_path
203  include_dirs += ace_engine_include_path
204  include_dirs += [
205    "$ide_previewer_path/jsapp",
206    "$ide_previewer_path/jsapp/rich",
207    "$ide_previewer_path/mock",
208    "$ide_previewer_path/mock/rich",
209  ]
210  sources = [
211    "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp",
212    "$ide_previewer_path/cli/CommandLine.cpp",
213    "$ide_previewer_path/cli/CommandLineFactory.cpp",
214    "$ide_previewer_path/cli/CommandLineInterface.cpp",
215    "$ide_previewer_path/mock/KeyInput.cpp",
216    "$ide_previewer_path/mock/MouseInput.cpp",
217    "$ide_previewer_path/mock/MouseWheel.cpp",
218    "$ide_previewer_path/mock/VirtualMessage.cpp",
219    "$ide_previewer_path/test/mock/MockGlobalResult.cpp",
220    "$ide_previewer_path/test/mock/ability/MockSimulator.cpp",
221    "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp",
222    "$ide_previewer_path/test/mock/jsapp/MockJsApp.cpp",
223    "$ide_previewer_path/test/mock/jsapp/MockJsAppImpl.cpp",
224    "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp",
225    "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp",
226    "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp",
227    "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp",
228    "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp",
229    "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp",
230    "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp",
231    "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp",
232    "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp",
233    "$ide_previewer_path/test/mock/window/MockWindowModel.cpp",
234    "$ide_previewer_path/util/CallbackQueue.cpp",
235    "$ide_previewer_path/util/CommandParser.cpp",
236    "$ide_previewer_path/util/CppTimer.cpp",
237    "$ide_previewer_path/util/CppTimerManager.cpp",
238    "$ide_previewer_path/util/FileSystem.cpp",
239    "$ide_previewer_path/util/Interrupter.cpp",
240    "$ide_previewer_path/util/JsonReader.cpp",
241    "$ide_previewer_path/util/PreviewerEngineLog.cpp",
242    "$ide_previewer_path/util/SharedDataManager.cpp",
243    "$ide_previewer_path/util/TimeTool.cpp",
244    "$ide_previewer_path/util/TraceTool.cpp",
245    "$ide_previewer_path/util/unix/LocalDate.cpp",
246    "$ide_previewer_path/util/unix/NativeFileSystem.cpp",
247  ]
248  sources += [
249    "../ChangeJsonUtil.cpp",
250    "../main.cpp",
251    "CommandParse.cpp",
252    "CommonCommandParseFuzzer.cpp",
253  ]
254  deps = [
255    "//third_party/bounds_checking_function:libsec_static",
256    "//third_party/cJSON:cjson_static",
257  ]
258  libs = []
259  cflags = [ "-Wno-error=overflow" ]
260  cflags_cc = [ "-Wno-error=overflow" ]
261  ldflags = [ "-Wno-error=overflow" ]
262}
263