# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #####################hydra-fuzz################### import("//build/config/features.gni") import("//build/test.gni") import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") module_output_path = "work_scheduler/work_scheduler" config("worksched_private_config") { include_dirs = [ "${worksched_service_path}/zidl/include", "${worksched_service_path}/native/include", ] } ##############################fuzztest########################################## ohos_fuzztest("WorkSchedulerStopAndClearWorksFuzzTest") { module_out_path = module_output_path fuzz_config_file = "${worksched_test_path}/fuzztest/workschedulerstopandclearworks_fuzzer" configs = [ ":worksched_private_config" ] cflags = [ "-g", "-O0", "-Wno-unused-variable", "-fno-omit-frame-pointer", "-Dprivate=public", "-Dprotected=public", ] sources = [ "workschedulerstopandclearworks_fuzzer.cpp" ] deps = [ "${worksched_frameworks_path}:workschedclient", "${worksched_frameworks_path}/extension:workschedextension", "${worksched_service_path}:workschedservice_static", "${worksched_utils_path}:workschedutils", "//third_party/jsoncpp", ] external_deps = [ "ability_base:want", "ability_runtime:ability_manager", "ability_runtime:app_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_single", "resource_management:global_resmgr", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] resource_config_file = "${worksched_test_path}/resource/ohos_test.xml" defines = [ "WORK_SCHEDULER_TEST" ] if (bundle_active_enable) { external_deps += [ "device_usage_statistics:usagestatsinner" ] defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] } if (device_standby_enable) { external_deps += [ "device_standby:standby_innerkits" ] defines += [ "DEVICE_STANDBY_ENABLE" ] } if (resourceschedule_bgtaskmgr_enable) { external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ] } if (powermgr_battery_manager_enable) { external_deps += [ "battery_manager:batterysrv_client" ] defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] } if (powermgr_thermal_manager_enable) { external_deps += [ "thermal_manager:thermalsrv_client" ] defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] } if (powermgr_power_manager_enable) { external_deps += [ "power_manager:powermgr_client" ] defines += [ "POWERMGR_POWER_MANAGER_ENABLE" ] } if (workscheduler_with_communication_netmanager_base_enable) { defines += [ "COMMUNICATION_NETMANAGER_BASE_ENABLE" ] external_deps += [ "netmanager_base:net_conn_manager_if" ] } } ############################################################################### group("fuzztest") { testonly = true deps = [] deps += [ # deps file ":WorkSchedulerStopAndClearWorksFuzzTest", ] } ###############################################################################