• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/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("BgTaskCancelSuspendDelayFuzzTest") {
22  module_out_path = module_output_path
23  fuzz_config_file =
24      "${bgtaskmgr_test_path}/fuzztest/bgtaskcancelsuspenddelay_fuzzer"
25
26  include_dirs = [
27    "../common",
28    "${target_gen_dir}",
29  ]
30
31  cflags = [
32    "-g",
33    "-O0",
34    "-Wno-unused-variable",
35    "-fno-omit-frame-pointer",
36    "-Dprivate=public",
37    "-Dprotected=public",
38  ]
39
40  cflags_cc = [
41    "-fvisibility=hidden",
42    "-fdata-sections",
43    "-ffunction-sections",
44    "-fvisibility-inlines-hidden",
45    "-Os",
46  ]
47
48  sources = [
49    "../common/fuzztest_helper.cpp",
50    "bgtaskcancelsuspenddelay_fuzzer.cpp",
51  ]
52
53  deps = [
54    "${bgtaskmgr_interfaces_path}/innerkits:background_task_mgr_proxy",
55    "${bgtaskmgr_interfaces_path}/innerkits:background_task_mgr_stub",
56    "${bgtaskmgr_interfaces_path}/innerkits:bgtaskmgr_innerkits",
57    "${bgtaskmgr_services_path}:bgtaskmgr_service_static",
58  ]
59
60  external_deps = [
61    "ability_base:base",
62    "ability_base:want",
63    "ability_base:zuri",
64    "ability_runtime:ability_manager",
65    "ability_runtime:app_manager",
66    "ability_runtime:wantagent_innerkits",
67    "access_token:libaccesstoken_sdk",
68    "access_token:libnativetoken",
69    "access_token:libtoken_setproc",
70    "access_token:libtokenid_sdk",
71    "bundle_framework:appexecfwk_base",
72    "bundle_framework:appexecfwk_core",
73    "c_utils:utils",
74    "common_event_service:cesfwk_innerkits",
75    "eventhandler:libeventhandler",
76    "hilog:libhilog",
77    "hisysevent:libhisysevent",
78    "init:libbegetutil",
79    "ipc:ipc_single",
80    "resource_management:global_resmgr",
81    "safwk:system_ability_fwk",
82    "samgr:samgr_proxy",
83  ]
84
85  if (has_os_account_part) {
86    cflags_cc += [ "-DHAS_OS_ACCOUNT_PART" ]
87    external_deps += [ "os_account:os_account_innerkits" ]
88  }
89
90  if (distributed_notification_enable) {
91    cflags_cc += [ "-DDISTRIBUTED_NOTIFICATION_ENABLE" ]
92    external_deps += [ "distributed_notification_service:ans_innerkits" ]
93    sources += [ "${bgtaskmgr_services_path}/continuous_task/src/task_notification_subscriber.cpp" ]
94  }
95
96  if (background_task_mgr_graphics) {
97    cflags_cc += [ "-DSUPPORT_GRAPHICS" ]
98    external_deps += [ "i18n:intl_util" ]
99  }
100
101  subsystem_name = "resourceschedule"
102  part_name = "background_task_mgr"
103}
104
105###############################################################################
106group("fuzztest") {
107  testonly = true
108  deps = []
109  deps += [
110    # deps file
111    ":BgTaskCancelSuspendDelayFuzzTest",
112  ]
113}
114###############################################################################
115