1# Copyright (c) 2024 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/test.gni")
16import("//foundation/ability/ability_runtime/ability_runtime.gni")
17##############################fuzztest##########################################
18module_output_path = "ability_runtime/appmgrservice"
19ohos_fuzztest("AbilityAppMgrEventFuzzTest") {
20  module_out_path = module_output_path
21
22  fuzz_config_file =
23      "${ability_runtime_test_path}/fuzztest/abilityappmgrevent_fuzzer"
24
25  include_dirs =
26      [ "${ability_runtime_innerkits_path}/app_manager/include/appmgr" ]
27
28  cflags = [
29    "-g",
30    "-O0",
31    "-Wno-unused-variable",
32    "-fno-omit-frame-pointer",
33  ]
34  sources = [
35    "${ability_runtime_services_path}/appmgr/src/app_mgr_event.cpp",
36    "${ability_runtime_services_path}/common/src/event_report.cpp",
37    "abilityappmgrevent_fuzzer.cpp",
38  ]
39
40  configs = [ "${ability_runtime_services_path}/appmgr:appmgr_config" ]
41
42  deps = [ "${ability_runtime_services_path}/appmgr:libappms" ]
43
44  external_deps = [
45    "ability_base:configuration",
46    "ability_base:want",
47    "ability_runtime:app_manager",
48    "access_token:libaccesstoken_sdk",
49    "access_token:libnativetoken",
50    "access_token:libtoken_setproc",
51    "appspawn:appspawn_client",
52    "bundle_framework:appexecfwk_base",
53    "bundle_framework:appexecfwk_core",
54    "c_utils:utils",
55    "ffrt:libffrt",
56    "hilog:libhilog",
57    "hisysevent:libhisysevent",
58    "hitrace:hitrace_meter",
59    "init:libbeget_proxy",
60    "init:libbegetutil",
61    "ipc:ipc_core",
62  ]
63
64  if (ability_runtime_graphics) {
65    external_deps += [ "window_manager:libwm" ]
66  }
67
68  defines = []
69  if (background_task_mgr_continuous_task_enable) {
70    defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ]
71  }
72}
73
74###############################################################################
75group("fuzztest") {
76  testonly = true
77  deps = []
78  deps += [
79    # deps file
80    ":AbilityAppMgrEventFuzzTest",
81  ]
82}
83###############################################################################
84