11ebd3d54Sopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd. 21ebd3d54Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 31ebd3d54Sopenharmony_ci# you may not use this file except in compliance with the License. 41ebd3d54Sopenharmony_ci# You may obtain a copy of the License at 51ebd3d54Sopenharmony_ci# 61ebd3d54Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 71ebd3d54Sopenharmony_ci# 81ebd3d54Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 91ebd3d54Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 101ebd3d54Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 111ebd3d54Sopenharmony_ci# See the License for the specific language governing permissions and 121ebd3d54Sopenharmony_ci# limitations under the License. 131ebd3d54Sopenharmony_ci 141ebd3d54Sopenharmony_ci#####################hydra-fuzz################### 151ebd3d54Sopenharmony_ciimport("//build/config/features.gni") 161ebd3d54Sopenharmony_ciimport("//build/test.gni") 171ebd3d54Sopenharmony_ciimport("//foundation/resourceschedule/background_task_mgr/bgtaskmgr.gni") 181ebd3d54Sopenharmony_cimodule_output_path = "background_task_mgr/background_task_mgr" 191ebd3d54Sopenharmony_ci 201ebd3d54Sopenharmony_ci##############################fuzztest########################################## 211ebd3d54Sopenharmony_ciohos_fuzztest("BgTaskSubscribeBackgroundTaskFuzzTest") { 221ebd3d54Sopenharmony_ci module_out_path = module_output_path 231ebd3d54Sopenharmony_ci fuzz_config_file = 241ebd3d54Sopenharmony_ci "${bgtaskmgr_test_path}/fuzztest/bgtasksubscribebackgroundtask_fuzzer" 251ebd3d54Sopenharmony_ci 261ebd3d54Sopenharmony_ci include_dirs = [ "../common" ] 271ebd3d54Sopenharmony_ci cflags = [ 281ebd3d54Sopenharmony_ci "-g", 291ebd3d54Sopenharmony_ci "-O0", 301ebd3d54Sopenharmony_ci "-Wno-unused-variable", 311ebd3d54Sopenharmony_ci "-fno-omit-frame-pointer", 321ebd3d54Sopenharmony_ci "-Dprivate=public", 331ebd3d54Sopenharmony_ci "-Dprotected=public", 341ebd3d54Sopenharmony_ci ] 351ebd3d54Sopenharmony_ci 361ebd3d54Sopenharmony_ci cflags_cc = [ 371ebd3d54Sopenharmony_ci "-fvisibility=hidden", 381ebd3d54Sopenharmony_ci "-fdata-sections", 391ebd3d54Sopenharmony_ci "-ffunction-sections", 401ebd3d54Sopenharmony_ci "-fvisibility-inlines-hidden", 411ebd3d54Sopenharmony_ci "-Os", 421ebd3d54Sopenharmony_ci ] 431ebd3d54Sopenharmony_ci 441ebd3d54Sopenharmony_ci sources = [ 451ebd3d54Sopenharmony_ci "../common/fuzztest_helper.cpp", 461ebd3d54Sopenharmony_ci "bgtasksubscribebackgroundtask_fuzzer.cpp", 471ebd3d54Sopenharmony_ci ] 481ebd3d54Sopenharmony_ci 491ebd3d54Sopenharmony_ci deps = [ 501ebd3d54Sopenharmony_ci "${bgtaskmgr_interfaces_path}/innerkits:bgtaskmgr_innerkits", 511ebd3d54Sopenharmony_ci "${bgtaskmgr_services_path}:bgtaskmgr_service_static", 521ebd3d54Sopenharmony_ci ] 531ebd3d54Sopenharmony_ci 541ebd3d54Sopenharmony_ci external_deps = [ 551ebd3d54Sopenharmony_ci "ability_base:base", 561ebd3d54Sopenharmony_ci "ability_base:want", 571ebd3d54Sopenharmony_ci "ability_base:zuri", 581ebd3d54Sopenharmony_ci "ability_runtime:ability_manager", 591ebd3d54Sopenharmony_ci "ability_runtime:app_manager", 601ebd3d54Sopenharmony_ci "ability_runtime:wantagent_innerkits", 611ebd3d54Sopenharmony_ci "access_token:libaccesstoken_sdk", 621ebd3d54Sopenharmony_ci "access_token:libnativetoken", 631ebd3d54Sopenharmony_ci "access_token:libtoken_setproc", 641ebd3d54Sopenharmony_ci "access_token:libtokenid_sdk", 651ebd3d54Sopenharmony_ci "bundle_framework:appexecfwk_base", 661ebd3d54Sopenharmony_ci "bundle_framework:appexecfwk_core", 671ebd3d54Sopenharmony_ci "c_utils:utils", 681ebd3d54Sopenharmony_ci "common_event_service:cesfwk_innerkits", 691ebd3d54Sopenharmony_ci "eventhandler:libeventhandler", 701ebd3d54Sopenharmony_ci "hilog:libhilog", 711ebd3d54Sopenharmony_ci "hisysevent:libhisysevent", 721ebd3d54Sopenharmony_ci "init:libbegetutil", 731ebd3d54Sopenharmony_ci "ipc:ipc_single", 741ebd3d54Sopenharmony_ci "resource_management:global_resmgr", 751ebd3d54Sopenharmony_ci "safwk:system_ability_fwk", 761ebd3d54Sopenharmony_ci "samgr:samgr_proxy", 771ebd3d54Sopenharmony_ci ] 781ebd3d54Sopenharmony_ci 791ebd3d54Sopenharmony_ci if (has_os_account_part) { 801ebd3d54Sopenharmony_ci cflags_cc += [ "-DHAS_OS_ACCOUNT_PART" ] 811ebd3d54Sopenharmony_ci external_deps += [ "os_account:os_account_innerkits" ] 821ebd3d54Sopenharmony_ci } 831ebd3d54Sopenharmony_ci 841ebd3d54Sopenharmony_ci if (distributed_notification_enable) { 851ebd3d54Sopenharmony_ci cflags_cc += [ "-DDISTRIBUTED_NOTIFICATION_ENABLE" ] 861ebd3d54Sopenharmony_ci external_deps += [ "distributed_notification_service:ans_innerkits" ] 871ebd3d54Sopenharmony_ci sources += [ "${bgtaskmgr_services_path}/continuous_task/src/task_notification_subscriber.cpp" ] 881ebd3d54Sopenharmony_ci } 891ebd3d54Sopenharmony_ci 901ebd3d54Sopenharmony_ci if (background_task_mgr_graphics) { 911ebd3d54Sopenharmony_ci cflags_cc += [ "-DSUPPORT_GRAPHICS" ] 921ebd3d54Sopenharmony_ci external_deps += [ "i18n:intl_util" ] 931ebd3d54Sopenharmony_ci } 941ebd3d54Sopenharmony_ci 951ebd3d54Sopenharmony_ci subsystem_name = "resourceschedule" 961ebd3d54Sopenharmony_ci part_name = "background_task_mgr" 971ebd3d54Sopenharmony_ci} 981ebd3d54Sopenharmony_ci 991ebd3d54Sopenharmony_ci############################################################################### 1001ebd3d54Sopenharmony_cigroup("fuzztest") { 1011ebd3d54Sopenharmony_ci testonly = true 1021ebd3d54Sopenharmony_ci deps = [] 1031ebd3d54Sopenharmony_ci deps += [ 1041ebd3d54Sopenharmony_ci # deps file 1051ebd3d54Sopenharmony_ci ":BgTaskSubscribeBackgroundTaskFuzzTest", 1061ebd3d54Sopenharmony_ci ] 1071ebd3d54Sopenharmony_ci} 1081ebd3d54Sopenharmony_ci############################################################################### 109