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("BgTaskSystemEventObserverFuzzTest") { 22 module_out_path = module_output_path 23 fuzz_config_file = 24 "${bgtaskmgr_test_path}/fuzztest/bgtasksystemeventobserver_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 "bgtasksystemeventobserver_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_shared", 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 "hitrace:libhitracechain", 79 "init:libbegetutil", 80 "ipc:ipc_single", 81 "resource_management:global_resmgr", 82 "safwk:system_ability_fwk", 83 "samgr:samgr_proxy", 84 ] 85 86 if (has_os_account_part) { 87 cflags_cc += [ "-DHAS_OS_ACCOUNT_PART" ] 88 external_deps += [ "os_account:os_account_innerkits" ] 89 } 90 91 if (distributed_notification_enable) { 92 cflags_cc += [ "-DDISTRIBUTED_NOTIFICATION_ENABLE" ] 93 external_deps += [ "distributed_notification_service:ans_innerkits" ] 94 sources += [ "${bgtaskmgr_services_path}/continuous_task/src/task_notification_subscriber.cpp" ] 95 } 96 97 if (background_task_mgr_graphics) { 98 cflags_cc += [ "-DSUPPORT_GRAPHICS" ] 99 external_deps += [ "i18n:intl_util" ] 100 } 101 102 subsystem_name = "resourceschedule" 103 part_name = "background_task_mgr" 104} 105 106############################################################################### 107group("fuzztest") { 108 testonly = true 109 deps = [] 110 deps += [ 111 # deps file 112 ":BgTaskSystemEventObserverFuzzTest", 113 ] 114} 115############################################################################### 116