• 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
14#####################hydra-fuzz###################
15import("//build/config/features.gni")
16import("//build/test.gni")
17import("//foundation/ability/ability_runtime/ability_runtime.gni")
18module_output_path = "arkui/utilengine"
19
20##############################fuzztest##########################################
21import("//foundation/arkui/ace_engine/ace_config.gni")
22ohos_fuzztest("UtilEngineFuzzTest") {
23  module_out_path = module_output_path
24  fuzz_config_file =
25      "//foundation/arkui/ace_engine/test/fuzztest/utilengine_fuzzer"
26  include_dirs = []
27  cflags = [
28    "-g",
29    "-O0",
30    "-Wno-unused-variable",
31    "-fno-omit-frame-pointer",
32  ]
33  sources = [
34    "$ace_root/adapter/ohos/osal/log_wrapper.cpp",
35    "$ace_root/frameworks/base/geometry/dimension.cpp",
36    "$ace_root/frameworks/base/json/json_util.cpp",
37    "$ace_root/frameworks/base/subwindow/subwindow_manager.cpp",
38    "$ace_root/frameworks/bridge/common/utils/engine_helper.cpp",
39    "$ace_root/frameworks/bridge/js_frontend/engine/common/js_engine_loader.cpp",
40    "$ace_root/frameworks/core/components/test/unittest/mock/subwindow_mock.cpp",
41    "$ace_root/test/mock/core/common/mock_container.cpp",
42    "//third_party/cJSON/cJSON.c",
43    "utilengine_fuzzer.cpp",
44  ]
45  include_dirs = [
46    "$ace_root/frameworks/base/utils",
47    "$ace_root/frameworks/base/json",
48    "$ace_root/frameworks/base/",
49    "$ace_root/frameworks",
50    "$ace_root",
51    cjson_root,
52    "$root_out_dir/arkui/framework",
53  ]
54
55  deps = [
56    "$ace_root/frameworks/base:ace_memory_monitor_ohos",
57    "$ace_root/frameworks/core/components/theme:build_theme_code",
58    "//foundation/window/window_manager/utils:libwmutil",
59    "//foundation/window/window_manager/wm:libwm",
60    "//third_party/googletest:gmock_main",
61    "//third_party/icu/icu4c:shared_icui18n",
62    "//third_party/icu/icu4c:shared_icuuc",
63  ]
64  external_deps = [
65    "ability_base:want",
66    "ability_runtime:ability_manager",
67    "bundle_framework:appexecfwk_base",
68    "c_utils:utils",
69    "eventhandler:libeventhandler",
70    "hilog:libhilog",
71    "input:libmmi-client",
72    "ipc:ipc_core",
73    "window_manager:libdm",
74  ]
75
76  ldflags = []
77  if (ace_engine_feature_enable_coverage) {
78    cflags += [ "--coverage" ]
79    ldflags += [ "--coverage" ]
80  }
81}
82
83###############################################################################
84group("fuzztest") {
85  testonly = true
86  deps = []
87  deps += [
88    # deps file
89    ":UtilEngineFuzzTest",
90  ]
91}
92###############################################################################
93