# Copyright (c) 2022 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("//build/config/features.gni") import("//build/test.gni") #####################hydra-fuzz################### import("//foundation/arkui/ace_engine/ace_config.gni") module_output_path = "ace_engine/ace_engine/imageApi" ##############################fuzztest########################################## ohos_fuzztest("ImageApiFuzzTest") { module_out_path = module_output_path fuzz_config_file = "//foundation/arkui/ace_engine/test/fuzztest/imageApi_fuzzer" include_dirs = [] cflags = [ "-g", "-O0", "-Wno-unused-variable", "-fno-omit-frame-pointer", ] deps = [ "$ace_root/frameworks/base:ace_memory_monitor_ohos", "$ace_root/frameworks/base/resource:ace_resource", "$ace_root/frameworks/core/components/theme:build_theme_code", "$ace_root/test/unittest:ace_engine_unittest_flutter_deps", "$cjson_root:cjson", ] sources = [ # base "$ace_root/frameworks/base/json/json_util.cpp", "$ace_root/frameworks/base/log/dump_log.cpp", "$ace_root/frameworks/base/utils/base_id.cpp", # properties "$ace_root/frameworks/core/components/common/properties/border.cpp", "$ace_root/frameworks/core/components/common/properties/border_edge.cpp", "$ace_root/frameworks/core/components/common/properties/color.cpp", "$ace_root/frameworks/core/components/common/properties/text_style.cpp", "$ace_root/test/mock/core/common/mock_ace_application_info.cpp", # theme "$ace_root/frameworks/core/components/theme/app_theme.cpp", "$ace_root/frameworks/core/components/theme/theme_attributes.cpp", "$ace_root/frameworks/core/components/theme/theme_constants.cpp", "$ace_root/frameworks/core/components/theme/theme_utils.cpp", "$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp", # animation "$ace_root/frameworks/core/animation/animator.cpp", "$ace_root/frameworks/core/animation/anticipate_curve.cpp", "$ace_root/frameworks/core/animation/cubic_curve.cpp", "$ace_root/frameworks/core/animation/curves.cpp", "$ace_root/frameworks/core/animation/scheduler.cpp", "$ace_root/test/mock/base/mock_jank_frame_report.cpp", # common "$ace_root/frameworks/base/geometry/animatable_dimension.cpp", "$ace_root/frameworks/base/memory/memory_monitor.cpp", "$ace_root/frameworks/core/common/ace_application_info.cpp", "$ace_root/frameworks/core/common/ace_engine.cpp", "$ace_root/frameworks/core/common/container.cpp", "$ace_root/frameworks/core/common/container_scope.cpp", "$ace_root/frameworks/core/common/frontend.cpp", "$ace_root/frameworks/core/common/thread_checker.cpp", "$ace_root/frameworks/core/common/window.cpp", "$ace_root/test/mock/interfaces/mock_ace_forward_compatibility.cpp", # event "$ace_root/frameworks/core/event/back_end_event_manager.cpp", "$ace_root/test/mock/core/common/mock_watch_dog.cpp", #"theme_constants_test.cpp", "$ace_root/adapter/ohos/osal/frame_trace_adapter_fake_impl.cpp", #fuzz "$ace_root/adapter/ohos/entrance/file_asset_provider_impl.cpp", "$ace_root/adapter/ohos/osal/system_properties.cpp", "$ace_root/frameworks/base/log/ace_tracker.cpp", "$ace_root/frameworks/base/thread/background_task_executor.cpp", "$ace_root/frameworks/core/common/asset_manager_impl.cpp", "$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp", "$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp", "$ace_root/frameworks/core/image/image_cache.cpp", "$ace_root/frameworks/core/image/image_compressor.cpp", "$ace_root/frameworks/core/image/image_object.cpp", "$ace_root/frameworks/core/image/image_provider.cpp", "$ace_root/frameworks/core/image/image_source_info.cpp", "$ace_root/frameworks/core/pipeline/pipeline_base.cpp", "$ace_root/test/mock/base/mock_download_manager.cpp", "imageApi_fuzzer.cpp", ] # add sources only needed by wearable like watch. if (is_wearable_product) { sources += [ "$root_out_dir/arkui/framework/core/components/theme/theme_constants_watch.cpp" ] } # add sources needed by phone and TV. wearable like watch do not need them if (!is_wearable_product) { sources += [ # theme "$root_out_dir/arkui/framework/core/components/theme/theme_constants_tv.cpp", ] } ldflags = [] if (ace_engine_feature_enable_coverage) { cflags += [ "--coverage" ] ldflags += [ "--coverage" ] } if (is_ohos_standard_system) { external_deps = [ "hilog:libhilog", "init:libbegetutil", ] } else { external_deps = [ "hilog:libhilog", "init:libbegetutil", ] } external_deps += [ "c_utils:utils" ] sources += [ "$ace_root/adapter/ohos/osal/log_wrapper.cpp", "$ace_root/test/mock/core/common/mock_resource_adapter.cpp", ] part_name = ace_engine_part #defined =["FUZZTEST"]; include_dirs = [ "$ace_root/frameworks/core/components/common/properties", "$ace_root/frameworks/core/components/theme", "$ace_root/frameworks/core/event", "$ace_root/frameworks/core", "$ace_root/frameworks/base/utils", "$ace_root/frameworks/base", "$ace_root/frameworks/base/memory", "$ace_root/frameworks/base/log", "$ace_root/frameworks", "$ace_root", "//third_party/flutter/engine/flutter/assets", "//third_party/flutter/engine", "//third_party", "//commonlibrary/c_utils/base/include", "$root_out_dir/arkui/framework", ] if (ace_use_rosen_drawing) { include_dirs += [ "//foundation/graphic/graphic_2d/rosen/modules/2d_engine", "//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text", ] external_deps += [ "graphic_2d:2d_graphics" ] } } ############################################################################### group("fuzztest") { testonly = true deps = [] if (!is_asan) { deps += [ ":ImageApiFuzzTest" ] } } ###############################################################################