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