1# Copyright (c) 2022 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 14#####################hydra-fuzz################### 15import("//build/config/features.gni") 16import("//build/test.gni") 17import("//foundation/ability/ability_runtime/ability_runtime.gni") 18module_output_path = "ace_engine/ace_engine/utilengine" 19 20##############################fuzztest########################################## 21import("//foundation/arkui/ace_engine/ace_config.gni") 22ohos_fuzztest("UtilEngineFuzzTest") { 23 module_out_path = module_output_path 24 fuzz_config_file = 25 "//foundation/arkui/ace_engine/test/fuzztest/utilengine_fuzzer" 26 include_dirs = [] 27 cflags = [ 28 "-g", 29 "-O0", 30 "-Wno-unused-variable", 31 "-fno-omit-frame-pointer", 32 ] 33 sources = [ 34 "$ace_root/adapter/ohos/osal/log_wrapper.cpp", 35 "$ace_root/frameworks/base/geometry/dimension.cpp", 36 "$ace_root/frameworks/base/json/json_util.cpp", 37 "$ace_root/frameworks/base/subwindow/subwindow_manager.cpp", 38 "$ace_root/frameworks/bridge/common/utils/engine_helper.cpp", 39 "$ace_root/frameworks/bridge/js_frontend/engine/common/js_engine_loader.cpp", 40 "$ace_root/frameworks/core/common/container_scope.cpp", 41 "$ace_root/test/mock/base/mock_subwindow.cpp", 42 "$ace_root/test/mock/core/common/mock_container.cpp", 43 "$ace_root/test/mock/interfaces/mock_ace_forward_compatibility.cpp", 44 "//third_party/cJSON/cJSON.c", 45 "utilengine_fuzzer.cpp", 46 ] 47 include_dirs = [ 48 "$ace_root/frameworks/base/utils", 49 "$ace_root/frameworks/base/json", 50 "$ace_root/frameworks/base/", 51 "$ace_root/frameworks", 52 "$ace_root", 53 cjson_root, 54 "$root_out_dir/arkui/framework", 55 ] 56 57 deps = [ 58 "$ace_root/frameworks/base:ace_memory_monitor_ohos", 59 "$ace_root/frameworks/core/components/theme:build_theme_code", 60 "//foundation/window/window_manager/utils:libwmutil", 61 "//foundation/window/window_manager/wm:libwm", 62 "//third_party/googletest:gmock_main", 63 "//third_party/icu/icu4c:shared_icui18n", 64 "//third_party/icu/icu4c:shared_icuuc", 65 ] 66 external_deps = [ 67 "ability_base:want", 68 "ability_runtime:ability_manager", 69 "bundle_framework:appexecfwk_base", 70 "c_utils:utils", 71 "eventhandler:libeventhandler", 72 "hilog:libhilog", 73 "input:libmmi-client", 74 "ipc:ipc_core", 75 "window_manager:libdm", 76 ] 77 78 ldflags = [] 79 if (ace_engine_feature_enable_coverage) { 80 cflags += [ "--coverage" ] 81 ldflags += [ "--coverage" ] 82 } 83} 84 85############################################################################### 86group("fuzztest") { 87 testonly = true 88 deps = [] 89 deps += [ 90 # deps file 91 ":UtilEngineFuzzTest", 92 ] 93} 94############################################################################### 95