• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 = "ace_engine/ace_engine/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_root/frameworks/base:ace_memory_monitor_ohos",
35    "$ace_root/frameworks/base/resource:ace_resource",
36    "$ace_root/frameworks/core/components/theme:build_theme_code",
37    "$ace_root/test/unittest:ace_engine_unittest_flutter_deps",
38    "$cjson_root:cjson",
39  ]
40  sources = [
41    # base
42    "$ace_root/frameworks/base/json/json_util.cpp",
43    "$ace_root/frameworks/base/log/dump_log.cpp",
44    "$ace_root/frameworks/base/utils/base_id.cpp",
45
46    # properties
47    "$ace_root/frameworks/core/components/common/properties/border.cpp",
48    "$ace_root/frameworks/core/components/common/properties/border_edge.cpp",
49    "$ace_root/frameworks/core/components/common/properties/color.cpp",
50    "$ace_root/frameworks/core/components/common/properties/text_style.cpp",
51    "$ace_root/test/mock/core/common/mock_ace_application_info.cpp",
52
53    # theme
54    "$ace_root/frameworks/core/components/theme/app_theme.cpp",
55    "$ace_root/frameworks/core/components/theme/theme_attributes.cpp",
56    "$ace_root/frameworks/core/components/theme/theme_constants.cpp",
57    "$ace_root/frameworks/core/components/theme/theme_utils.cpp",
58    "$root_out_dir/arkui/framework/core/components/theme/theme_constants_default.cpp",
59
60    # animation
61    "$ace_root/frameworks/core/animation/animator.cpp",
62    "$ace_root/frameworks/core/animation/anticipate_curve.cpp",
63    "$ace_root/frameworks/core/animation/cubic_curve.cpp",
64    "$ace_root/frameworks/core/animation/curves.cpp",
65    "$ace_root/frameworks/core/animation/scheduler.cpp",
66    "$ace_root/test/mock/base/mock_jank_frame_report.cpp",
67
68    # common
69    "$ace_root/frameworks/base/geometry/animatable_dimension.cpp",
70    "$ace_root/frameworks/base/memory/memory_monitor.cpp",
71    "$ace_root/frameworks/core/common/ace_application_info.cpp",
72    "$ace_root/frameworks/core/common/ace_engine.cpp",
73    "$ace_root/frameworks/core/common/container.cpp",
74    "$ace_root/frameworks/core/common/container_scope.cpp",
75    "$ace_root/frameworks/core/common/frontend.cpp",
76    "$ace_root/frameworks/core/common/thread_checker.cpp",
77    "$ace_root/frameworks/core/common/window.cpp",
78    "$ace_root/test/mock/interfaces/mock_ace_forward_compatibility.cpp",
79
80    # event
81    "$ace_root/frameworks/core/event/back_end_event_manager.cpp",
82    "$ace_root/test/mock/core/common/mock_watch_dog.cpp",
83
84    #"theme_constants_test.cpp",
85    "$ace_root/adapter/ohos/osal/frame_trace_adapter_fake_impl.cpp",
86
87    #fuzz
88    "$ace_root/adapter/ohos/entrance/file_asset_provider_impl.cpp",
89    "$ace_root/adapter/ohos/osal/system_properties.cpp",
90    "$ace_root/frameworks/base/log/ace_tracker.cpp",
91    "$ace_root/frameworks/base/thread/background_task_executor.cpp",
92    "$ace_root/frameworks/core/common/asset_manager_impl.cpp",
93    "$ace_root/frameworks/core/components/test/unittest/mock/ace_trace_mock.cpp",
94    "$ace_root/frameworks/core/components/test/unittest/mock/event_report_mock.cpp",
95    "$ace_root/frameworks/core/image/image_cache.cpp",
96    "$ace_root/frameworks/core/image/image_compressor.cpp",
97    "$ace_root/frameworks/core/image/image_object.cpp",
98    "$ace_root/frameworks/core/image/image_provider.cpp",
99    "$ace_root/frameworks/core/image/image_source_info.cpp",
100    "$ace_root/frameworks/core/pipeline/pipeline_base.cpp",
101    "$ace_root/test/mock/base/mock_download_manager.cpp",
102    "imageApi_fuzzer.cpp",
103  ]
104
105  # add sources only needed by wearable like watch.
106  if (is_wearable_product) {
107    sources += [ "$root_out_dir/arkui/framework/core/components/theme/theme_constants_watch.cpp" ]
108  }
109
110  # add sources needed by phone and TV. wearable like watch do not need them
111  if (!is_wearable_product) {
112    sources += [
113      # theme
114      "$root_out_dir/arkui/framework/core/components/theme/theme_constants_tv.cpp",
115    ]
116  }
117
118  ldflags = []
119  if (ace_engine_feature_enable_coverage) {
120    cflags += [ "--coverage" ]
121    ldflags += [ "--coverage" ]
122  }
123
124  if (is_ohos_standard_system) {
125    external_deps = [
126      "hilog:libhilog",
127      "init:libbegetutil",
128    ]
129  } else {
130    external_deps = [
131      "hilog:libhilog",
132      "init:libbegetutil",
133    ]
134  }
135  external_deps += [ "c_utils:utils" ]
136  sources += [
137    "$ace_root/adapter/ohos/osal/log_wrapper.cpp",
138    "$ace_root/test/mock/core/common/mock_resource_adapter.cpp",
139  ]
140  part_name = ace_engine_part
141
142  #defined =["FUZZTEST"];
143  include_dirs = [
144    "$ace_root/frameworks/core/components/common/properties",
145    "$ace_root/frameworks/core/components/theme",
146    "$ace_root/frameworks/core/event",
147    "$ace_root/frameworks/core",
148    "$ace_root/frameworks/base/utils",
149    "$ace_root/frameworks/base",
150    "$ace_root/frameworks/base/memory",
151    "$ace_root/frameworks/base/log",
152    "$ace_root/frameworks",
153    "$ace_root",
154    "//third_party/flutter/engine/flutter/assets",
155    "//third_party/flutter/engine",
156    "//third_party",
157    "//commonlibrary/c_utils/base/include",
158    "$root_out_dir/arkui/framework",
159  ]
160  if (ace_use_rosen_drawing) {
161    include_dirs += [
162      "//foundation/graphic/graphic_2d/rosen/modules/2d_engine",
163      "//foundation/graphic/graphic_2d/rosen/modules/2d_engine/rosen_text",
164    ]
165    external_deps += [ "graphic_2d:2d_graphics" ]
166  }
167}
168
169###############################################################################
170group("fuzztest") {
171  testonly = true
172  deps = []
173  if (!is_asan) {
174    deps += [ ":ImageApiFuzzTest" ]
175  }
176}
177###############################################################################
178