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 14import("//build/config/features.gni") 15import("//build/test.gni") 16 17#####################hydra-fuzz################### 18import("//foundation/arkui/ace_engine/ace_config.gni") 19module_output_path = "arkui/imageApi" 20 21##############################fuzztest########################################## 22ohos_fuzztest("ImageApiFuzzTest") { 23 module_out_path = module_output_path 24 fuzz_config_file = 25 "//foundation/arkui/ace_engine/test/fuzztest/imageApi_fuzzer" 26 include_dirs = [] 27 cflags = [ 28 "-g", 29 "-O0", 30 "-Wno-unused-variable", 31 "-fno-omit-frame-pointer", 32 ] 33 deps = [ 34 "$ace_flutter_engine_root:third_party_flutter_engine_ohos", 35 "$ace_flutter_engine_root/skia:ace_skia_ohos", 36 "$ace_root/frameworks/base/resource:ace_resource", 37 "$ace_root/frameworks/core/components/theme:build_theme_code", 38 "$cjson_root:cjson_static", 39 40 # "//third_party/googletest:gtest_main", 41 ] 42 sources = [ 43 # base 44 "$ace_root/frameworks/base/json/json_util.cpp", 45 "$ace_root/frameworks/base/log/dump_log.cpp", 46 "$ace_root/frameworks/base/utils/base_id.cpp", 47 48 # properties 49 "$ace_root/frameworks/core/common/test/mock/mock_ace_application_info.cpp", 50 "$ace_root/frameworks/core/components/common/properties/border.cpp", 51 "$ace_root/frameworks/core/components/common/properties/border_edge.cpp", 52 "$ace_root/frameworks/core/components/common/properties/color.cpp", 53 "$ace_root/frameworks/core/components/common/properties/text_style.cpp", 54 55 # theme 56 "$ace_root/frameworks/core/components/theme/app_theme.cpp", 57 "$ace_root/frameworks/core/components/theme/theme_attributes.cpp", 58 "$ace_root/frameworks/core/components/theme/theme_constants.cpp", 59 60 #"$ace_root/frameworks/core/components/theme/theme_manager.cpp", 61 "$ace_root/frameworks/core/components/theme/theme_utils.cpp", 62 "$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp", 63 64 # animation 65 "$ace_root/frameworks/core/animation/animator.cpp", 66 "$ace_root/frameworks/core/animation/anticipate_curve.cpp", 67 "$ace_root/frameworks/core/animation/cubic_curve.cpp", 68 "$ace_root/frameworks/core/animation/curves.cpp", 69 "$ace_root/frameworks/core/animation/scheduler.cpp", 70 71 # common 72 "$ace_root/frameworks/base/geometry/animatable_dimension.cpp", 73 "$ace_root/frameworks/base/memory/memory_monitor.cpp", 74 "$ace_root/frameworks/core/common/ace_application_info.cpp", 75 "$ace_root/frameworks/core/common/ace_engine.cpp", 76 "$ace_root/frameworks/core/common/container.cpp", 77 "$ace_root/frameworks/core/common/container_scope.cpp", 78 "$ace_root/frameworks/core/common/thread_checker.cpp", 79 "$ace_root/frameworks/core/common/window.cpp", 80 81 # event 82 "$ace_root/frameworks/core/common/test/mock/mock_watch_dog.cpp", 83 "$ace_root/frameworks/core/event/back_end_event_manager.cpp", 84 85 #"theme_constants_test.cpp", 86 "$ace_root/frameworks/core/components/test/unittest/theme/theme_mock.cpp", 87 88 # mock 89 #"$ace_root/frameworks/base/test/mock/mock_system_properties.cpp", 90 91 #fuzz 92 "$ace_root/adapter/ohos/entrance/file_asset_provider.cpp", 93 "$ace_root/adapter/ohos/osal/system_properties.cpp", 94 95 #"$ace_root/frameworks/base/resource/ace_res_config.cpp", 96 #"$ace_root/frameworks/base/resource/ace_res_key_parser.cpp", 97 "$ace_root/frameworks/core/common/flutter/flutter_asset_manager.cpp", 98 99 #"$ace_root/frameworks/base/log/ace_trace.cpp", 100 "$ace_root/frameworks/base/thread/background_task_executor.cpp", 101 "$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp", 102 103 #"$ace_root/frameworks/base/resource/internal_resource.cpp", 104 "$ace_root/frameworks/base/log/ace_tracker.cpp", 105 "$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp", 106 "$ace_root/frameworks/core/image/flutter_image_cache.cpp", 107 "$ace_root/frameworks/core/image/image_cache.cpp", 108 "$ace_root/frameworks/core/image/image_compressor.cpp", 109 110 #"$ace_root/frameworks/core/image/image_loader.cpp", 111 "$ace_root/frameworks/base/test/mock/mock_download_manager.cpp", 112 "$ace_root/frameworks/core/image/image_object.cpp", 113 "$ace_root/frameworks/core/image/image_provider.cpp", 114 "$ace_root/frameworks/core/image/image_source_info.cpp", 115 "$ace_root/frameworks/core/pipeline/pipeline_base.cpp", 116 "imageApi_fuzzer.cpp", 117 ] 118 119 # add sources only needed by wearable like watch. 120 if (is_wearable_product) { 121 sources += [ "$root_out_dir/arkui/framework/core/components/theme/theme_constants_watch.cpp" ] 122 } 123 124 # add sources needed by phone and TV. wearable like watch do not need them 125 if (!is_wearable_product) { 126 sources += [ 127 # theme 128 "$root_out_dir/arkui/framework/core/components/theme/theme_constants_tv.cpp", 129 ] 130 } 131 132 configs = [ 133 # ":config_theme_manager_test", 134 "$ace_root:ace_test_config", 135 ] 136 137 if (is_standard_system) { 138 external_deps = [ 139 "hiviewdfx_hilog_native:libhilog", 140 "init:libbegetutil", 141 ] 142 deps += [ "$ace_flutter_engine_root/icu:ace_libicu_ohos" ] 143 } else { 144 external_deps = [ 145 "hilog:libhilog", 146 "init_lite:libbegetutil", 147 ] 148 } 149 external_deps += [ "c_utils:utils" ] 150 sources += [ 151 "$ace_root/adapter/ohos/osal/log_wrapper.cpp", 152 "$ace_root/frameworks/core/components/test/mock/mock_resource_adapter.cpp", 153 ] 154 part_name = ace_engine_part 155 156 #defined =["FUZZTEST"]; 157 include_dirs = [ 158 "$ace_root/frameworks/core/components/common/properties", 159 "$ace_root/frameworks/core/components/theme", 160 "$ace_root/frameworks/core/event", 161 "$ace_root/frameworks/core", 162 "$ace_root/frameworks/base/utils", 163 "$ace_root/frameworks/base", 164 "$ace_root/frameworks/base/memory", 165 "$ace_root/frameworks/base/log", 166 "$ace_root/frameworks", 167 "$ace_root", 168 "//third_party/flutter/engine/flutter/assets", 169 "//third_party/flutter/engine", 170 "//third_party", 171 "//commonlibrary/c_utils/base/include", 172 ] 173} 174 175############################################################################### 176group("fuzztest") { 177 testonly = true 178 deps = [] 179 if (!is_asan) { 180 deps += [ ":ImageApiFuzzTest" ] 181 } 182} 183############################################################################### 184