# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("../../test.gni") module_output_path = "previewer/cli" group("command_parse_fuzztest") { testonly = true deps = [ ":CommonCommandParseFuzzTest", ":LiteCommandParseFuzzTest", ":RichCommandParseFuzzTest", ] } ide_fuzztest("RichCommandParseFuzzTest") { testonly = true part_name = "previewer" subsystem_name = "ide" module_out_path = module_output_path output_name = "RichCommandParseFuzzTest" include_dirs = [ "../", "$ide_previewer_path/test/mock", "$ide_previewer_path/cli", "$ide_previewer_path/util", "//third_party/libwebsockets/include", "//third_party/cJSON", "//third_party/bounds_checking_function/include", ] include_dirs += graphic_2d_include_path include_dirs += window_manager_include_path include_dirs += ability_runtime_include_path include_dirs += ace_engine_include_path include_dirs += [ "$ide_previewer_path/jsapp", "$ide_previewer_path/jsapp/rich", "$ide_previewer_path/mock", "$ide_previewer_path/mock/rich", ] sources = [ "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp", "$ide_previewer_path/cli/CommandLine.cpp", "$ide_previewer_path/cli/CommandLineFactory.cpp", "$ide_previewer_path/cli/CommandLineInterface.cpp", "$ide_previewer_path/mock/KeyInput.cpp", "$ide_previewer_path/mock/MouseInput.cpp", "$ide_previewer_path/mock/MouseWheel.cpp", "$ide_previewer_path/mock/VirtualMessage.cpp", "$ide_previewer_path/test/mock/MockGlobalResult.cpp", "$ide_previewer_path/test/mock/ability/MockSimulator.cpp", "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp", "$ide_previewer_path/test/mock/jsapp/MockJsApp.cpp", "$ide_previewer_path/test/mock/jsapp/MockJsAppImpl.cpp", "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp", "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp", "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp", "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp", "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp", "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp", "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp", "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp", "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp", "$ide_previewer_path/test/mock/window/MockWindowModel.cpp", "$ide_previewer_path/util/CallbackQueue.cpp", "$ide_previewer_path/util/CommandParser.cpp", "$ide_previewer_path/util/CppTimer.cpp", "$ide_previewer_path/util/CppTimerManager.cpp", "$ide_previewer_path/util/FileSystem.cpp", "$ide_previewer_path/util/Interrupter.cpp", "$ide_previewer_path/util/JsonReader.cpp", "$ide_previewer_path/util/PreviewerEngineLog.cpp", "$ide_previewer_path/util/SharedDataManager.cpp", "$ide_previewer_path/util/TimeTool.cpp", "$ide_previewer_path/util/TraceTool.cpp", "$ide_previewer_path/util/unix/LocalDate.cpp", "$ide_previewer_path/util/unix/NativeFileSystem.cpp", ] sources += [ "../ChangeJsonUtil.cpp", "../main.cpp", "CommandParse.cpp", "RichCommandParseFuzzer.cpp", ] deps = [ "//third_party/bounds_checking_function:libsec_static", "//third_party/cJSON:cjson_static", ] libs = [] cflags = [ "-Wno-error=overflow" ] cflags_cc = [ "-Wno-error=overflow" ] ldflags = [ "-Wno-error=overflow" ] } ide_fuzztest("LiteCommandParseFuzzTest") { testonly = true part_name = "previewer" subsystem_name = "ide" module_out_path = module_output_path output_name = "LiteCommandParseFuzzTest" include_dirs = [ "../", "$ide_previewer_path/test/mock", "$ide_previewer_path/cli", "$ide_previewer_path/util", "//third_party/libwebsockets/include", "//third_party/cJSON", "//third_party/bounds_checking_function/include", ] include_dirs += graphic_2d_include_path include_dirs += window_manager_include_path include_dirs += ability_runtime_include_path include_dirs += ace_engine_include_path include_dirs += [ "$ide_previewer_path/jsapp", "$ide_previewer_path/jsapp/rich", "$ide_previewer_path/mock", "$ide_previewer_path/mock/rich", ] sources = [ "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp", "$ide_previewer_path/cli/CommandLine.cpp", "$ide_previewer_path/cli/CommandLineFactory.cpp", "$ide_previewer_path/cli/CommandLineInterface.cpp", "$ide_previewer_path/mock/KeyInput.cpp", "$ide_previewer_path/mock/MouseInput.cpp", "$ide_previewer_path/mock/MouseWheel.cpp", "$ide_previewer_path/mock/VirtualMessage.cpp", "$ide_previewer_path/test/mock/MockGlobalResult.cpp", "$ide_previewer_path/test/mock/ability/MockSimulator.cpp", "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp", "$ide_previewer_path/test/mock/jsapp/MockJsApp.cpp", "$ide_previewer_path/test/mock/jsapp/MockJsAppImpl.cpp", "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp", "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp", "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp", "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp", "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp", "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp", "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp", "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp", "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp", "$ide_previewer_path/test/mock/window/MockWindowModel.cpp", "$ide_previewer_path/util/CallbackQueue.cpp", "$ide_previewer_path/util/CommandParser.cpp", "$ide_previewer_path/util/CppTimer.cpp", "$ide_previewer_path/util/CppTimerManager.cpp", "$ide_previewer_path/util/FileSystem.cpp", "$ide_previewer_path/util/Interrupter.cpp", "$ide_previewer_path/util/JsonReader.cpp", "$ide_previewer_path/util/PreviewerEngineLog.cpp", "$ide_previewer_path/util/SharedDataManager.cpp", "$ide_previewer_path/util/TimeTool.cpp", "$ide_previewer_path/util/TraceTool.cpp", "$ide_previewer_path/util/unix/LocalDate.cpp", "$ide_previewer_path/util/unix/NativeFileSystem.cpp", ] sources += [ "../ChangeJsonUtil.cpp", "../main.cpp", "CommandParse.cpp", "LiteCommandParseFuzzer.cpp", ] deps = [ "//third_party/bounds_checking_function:libsec_static", "//third_party/cJSON:cjson_static", ] libs = [] cflags = [ "-Wno-error=overflow" ] cflags_cc = [ "-Wno-error=overflow" ] ldflags = [ "-Wno-error=overflow" ] } ide_fuzztest("CommonCommandParseFuzzTest") { testonly = true part_name = "previewer" subsystem_name = "ide" module_out_path = module_output_path output_name = "CommonCommandParseFuzzTest" include_dirs = [ "../", "$ide_previewer_path/test/mock", "$ide_previewer_path/cli", "$ide_previewer_path/util", "//third_party/libwebsockets/include", "//third_party/cJSON", "//third_party/bounds_checking_function/include", ] include_dirs += graphic_2d_include_path include_dirs += window_manager_include_path include_dirs += ability_runtime_include_path include_dirs += ace_engine_include_path include_dirs += [ "$ide_previewer_path/jsapp", "$ide_previewer_path/jsapp/rich", "$ide_previewer_path/mock", "$ide_previewer_path/mock/rich", ] sources = [ "$graphic_2d_path/rosen/modules/platform/utils/refbase.cpp", "$ide_previewer_path/cli/CommandLine.cpp", "$ide_previewer_path/cli/CommandLineFactory.cpp", "$ide_previewer_path/cli/CommandLineInterface.cpp", "$ide_previewer_path/mock/KeyInput.cpp", "$ide_previewer_path/mock/MouseInput.cpp", "$ide_previewer_path/mock/MouseWheel.cpp", "$ide_previewer_path/mock/VirtualMessage.cpp", "$ide_previewer_path/test/mock/MockGlobalResult.cpp", "$ide_previewer_path/test/mock/ability/MockSimulator.cpp", "$ide_previewer_path/test/mock/arkui/MockAceAbility.cpp", "$ide_previewer_path/test/mock/jsapp/MockJsApp.cpp", "$ide_previewer_path/test/mock/jsapp/MockJsAppImpl.cpp", "$ide_previewer_path/test/mock/mock/MockKeyInputImpl.cpp", "$ide_previewer_path/test/mock/mock/MockMouseInputImpl.cpp", "$ide_previewer_path/test/mock/mock/MockMouseWheelImpl.cpp", "$ide_previewer_path/test/mock/mock/MockVirtualMessageImpl.cpp", "$ide_previewer_path/test/mock/mock/MockVirtualScreen.cpp", "$ide_previewer_path/test/mock/mock/MockVirtualScreenImpl.cpp", "$ide_previewer_path/test/mock/util/MockLocalSocket.cpp", "$ide_previewer_path/test/mock/util/MockWebSocketServer.cpp", "$ide_previewer_path/test/mock/window/MockWindowDisplay.cpp", "$ide_previewer_path/test/mock/window/MockWindowModel.cpp", "$ide_previewer_path/util/CallbackQueue.cpp", "$ide_previewer_path/util/CommandParser.cpp", "$ide_previewer_path/util/CppTimer.cpp", "$ide_previewer_path/util/CppTimerManager.cpp", "$ide_previewer_path/util/FileSystem.cpp", "$ide_previewer_path/util/Interrupter.cpp", "$ide_previewer_path/util/JsonReader.cpp", "$ide_previewer_path/util/PreviewerEngineLog.cpp", "$ide_previewer_path/util/SharedDataManager.cpp", "$ide_previewer_path/util/TimeTool.cpp", "$ide_previewer_path/util/TraceTool.cpp", "$ide_previewer_path/util/unix/LocalDate.cpp", "$ide_previewer_path/util/unix/NativeFileSystem.cpp", ] sources += [ "../ChangeJsonUtil.cpp", "../main.cpp", "CommandParse.cpp", "CommonCommandParseFuzzer.cpp", ] deps = [ "//third_party/bounds_checking_function:libsec_static", "//third_party/cJSON:cjson_static", ] libs = [] cflags = [ "-Wno-error=overflow" ] cflags_cc = [ "-Wno-error=overflow" ] ldflags = [ "-Wno-error=overflow" ] }