1# Copyright (c) 2023 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/resourceschedule/background_task_mgr/bgtaskmgr.gni")
18module_output_path = "background_task_mgr/background_task_mgr"
19
20##############################fuzztest##########################################
21ohos_fuzztest("BgTaskSubscriberFuzzTest") {
22  module_out_path = module_output_path
23  fuzz_config_file = "${bgtaskmgr_test_path}/fuzztest/bgtasksubscriber_fuzzer"
24
25  include_dirs = [ "../common" ]
26  cflags = [
27    "-g",
28    "-O0",
29    "-Wno-unused-variable",
30    "-fno-omit-frame-pointer",
31    "-Dprivate=public",
32    "-Dprotected=public",
33  ]
34  sources = [
35    "../common/fuzztest_helper.cpp",
36    "bgtaskSubscriber_fuzzer.cpp",
37  ]
38
39  deps = [
40    "${bgtaskmgr_interfaces_path}/innerkits:bgtaskmgr_innerkits",
41    "${bgtaskmgr_services_path}:bgtaskmgr_service_static",
42  ]
43
44  external_deps = [
45    "ability_base:base",
46    "ability_base:want",
47    "ability_base:zuri",
48    "ability_runtime:ability_manager",
49    "ability_runtime:app_manager",
50    "ability_runtime:wantagent_innerkits",
51    "access_token:libaccesstoken_sdk",
52    "access_token:libnativetoken",
53    "access_token:libtoken_setproc",
54    "access_token:libtokenid_sdk",
55    "bundle_framework:appexecfwk_base",
56    "bundle_framework:appexecfwk_core",
57    "c_utils:utils",
58    "common_event_service:cesfwk_innerkits",
59    "eventhandler:libeventhandler",
60    "hilog:libhilog",
61    "hisysevent:libhisysevent",
62    "init:libbegetutil",
63    "ipc:ipc_single",
64    "resource_management:global_resmgr",
65    "safwk:system_ability_fwk",
66    "samgr:samgr_proxy",
67  ]
68}
69
70###############################################################################
71group("fuzztest") {
72  testonly = true
73  deps = []
74  deps += [
75    # deps file
76    ":BgTaskSubscriberFuzzTest",
77  ]
78}
79###############################################################################
80