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") 18import("//foundation/arkui/ace_engine/ace_config.gni") 19module_output_path = "arkui/manifest_fuzzer" 20 21##############################fuzztest########################################## 22ohos_fuzztest("ManifestFuzzTest") { 23 module_out_path = module_output_path 24 fuzz_config_file = 25 "//foundation/arkui/ace_engine/test/fuzztest/manifest_fuzzer" 26 27 deps = [ 28 "$ace_root/frameworks/core/components/theme:build_theme_code", 29 "$ace_root/test/unittest:ace_engine_unittest_flutter_deps", 30 "$cjson_root:cjson", 31 ] 32 sources = [ 33 # base 34 "$ace_root/frameworks/base/json/json_util.cpp", 35 "$ace_root/frameworks/base/log/dump_log.cpp", 36 "$ace_root/frameworks/base/utils/base_id.cpp", 37 38 # properties 39 "$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp", 40 "$ace_root/frameworks/core/components/common/properties/border.cpp", 41 "$ace_root/frameworks/core/components/common/properties/border_edge.cpp", 42 "$ace_root/frameworks/core/components/common/properties/color.cpp", 43 "$ace_root/frameworks/core/components/common/properties/text_style.cpp", 44 45 # theme 46 "$ace_root/frameworks/core/components/theme/app_theme.cpp", 47 "$ace_root/frameworks/core/components/theme/theme_attributes.cpp", 48 "$ace_root/frameworks/core/components/theme/theme_constants.cpp", 49 "$ace_root/frameworks/core/components/theme/theme_utils.cpp", 50 "$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp", 51 52 # animation 53 "$ace_root/frameworks/core/animation/animator.cpp", 54 "$ace_root/frameworks/core/animation/anticipate_curve.cpp", 55 "$ace_root/frameworks/core/animation/cubic_curve.cpp", 56 "$ace_root/frameworks/core/animation/curves.cpp", 57 "$ace_root/frameworks/core/animation/scheduler.cpp", 58 "$ace_root/test/mock/frameworks/base/log/mock_jank_frame_report.cpp", 59 60 # common 61 "$ace_root/frameworks/base/geometry/animatable_dimension.cpp", 62 "$ace_root/frameworks/base/memory/memory_monitor.cpp", 63 "$ace_root/frameworks/core/common/ace_application_info.cpp", 64 "$ace_root/frameworks/core/common/ace_engine.cpp", 65 "$ace_root/frameworks/core/common/container.cpp", 66 "$ace_root/frameworks/core/common/container_scope.cpp", 67 "$ace_root/frameworks/core/common/frontend.cpp", 68 "$ace_root/frameworks/core/common/thread_checker.cpp", 69 "$ace_root/frameworks/core/common/window.cpp", 70 71 # event 72 "$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp", 73 "$ace_root/frameworks/core/event/back_end_event_manager.cpp", 74 75 #"theme_constants_test.cpp", 76 "$ace_root/frameworks/core/components/test/unittest/theme/theme_mock.cpp", 77 78 #fuzz 79 "$ace_root/adapter/ohos/entrance/file_asset_provider.cpp", 80 "$ace_root/adapter/ohos/osal/system_properties.cpp", 81 "$ace_root/frameworks/base/resource/ace_res_config.cpp", 82 "$ace_root/frameworks/base/resource/ace_res_key_parser.cpp", 83 "$ace_root/frameworks/bridge/common/manifest/manifest_appinfo.cpp", 84 "$ace_root/frameworks/bridge/common/manifest/manifest_parser.cpp", 85 "$ace_root/frameworks/bridge/common/manifest/manifest_router.cpp", 86 "$ace_root/frameworks/bridge/common/manifest/manifest_widget.cpp", 87 "$ace_root/frameworks/bridge/common/manifest/manifest_window.cpp", 88 "$ace_root/frameworks/core/common/flutter/flutter_asset_manager.cpp", 89 "$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp", 90 "$ace_root/test/mock/base/mock_event_report.cpp", 91 "manifest_fuzzer.cpp", 92 ] 93 94 # add sources only needed by wearable like watch. 95 if (is_wearable_product) { 96 sources += [ "$root_out_dir/arkui/framework/core/components/theme/theme_constants_watch.cpp" ] 97 } 98 99 # add sources needed by phone and TV. wearable like watch do not need them 100 if (!is_wearable_product) { 101 sources += [ 102 # theme 103 "$root_out_dir/arkui/framework/core/components/theme/theme_constants_tv.cpp", 104 ] 105 } 106 107 configs = [ ":config_theme_manager_test" ] 108 109 ldflags = [] 110 cflags = [] 111 if (ace_engine_feature_enable_coverage) { 112 cflags += [ "--coverage" ] 113 ldflags += [ "--coverage" ] 114 } 115 116 if (is_ohos_standard_system) { 117 external_deps = [ 118 "hilog:libhilog", 119 "init:libbegetutil", 120 ] 121 deps += [ "$ace_flutter_engine_root/icu:ace_libicu_ohos" ] 122 } else { 123 external_deps = [ 124 "hilog:libhilog", 125 "init_lite:libbegetutil", 126 ] 127 } 128 external_deps += [ "c_utils:utils" ] 129 sources += [ 130 "$ace_root/adapter/ohos/osal/log_wrapper.cpp", 131 "$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp", 132 ] 133 part_name = ace_engine_part 134 135 include_dirs = [ 136 "$ace_root/frameworks/core/components/common/properties", 137 "$ace_root/frameworks/core/components/theme", 138 "$ace_root/frameworks/core/event", 139 "$ace_root/frameworks/core", 140 "$ace_root/frameworks/base/utils", 141 "$ace_root/frameworks/base", 142 "$ace_root/frameworks/base/memory", 143 "$ace_root/frameworks/base/log", 144 "$ace_root/frameworks", 145 "$ace_root", 146 "$root_out_dir/arkui/framework", 147 "//third_party/flutter/engine/flutter/assets", 148 "//third_party/flutter/engine", 149 "//third_party", 150 "//commonlibrary/c_utils/base/include", 151 ] 152} 153 154config("config_theme_manager_test") { 155 visibility = [ ":*" ] 156} 157 158############################################################################### 159group("fuzztest") { 160 testonly = true 161 deps = [] 162 deps += [ 163 # deps file 164 ":ManifestFuzzTest", 165 ] 166} 167############################################################################### 168