1# Copyright (c) 2022 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") 17module_output_path = "work_scheduler/work_scheduler" 18 19import("//foundation/resourceschedule/work_scheduler/workscheduler.gni") 20config("worksched_private_config") { 21 include_dirs = [ 22 "${target_gen_dir}", 23 "${worksched_service_path}/zidl/include", 24 "${worksched_service_path}/native/include", 25 ] 26} 27 28##############################fuzztest########################################## 29ohos_fuzztest("WorkScheduleServiceFuzzTest") { 30 module_out_path = module_output_path 31 fuzz_config_file = 32 "${worksched_test_path}/fuzztest/workscheduleservice_fuzzer" 33 34 configs = [ ":worksched_private_config" ] 35 cflags = [ 36 "-g", 37 "-O0", 38 "-Wno-unused-variable", 39 "-fno-omit-frame-pointer", 40 ] 41 sources = [ "workscheduleservice_fuzzer.cpp" ] 42 43 deps = [ 44 "${worksched_frameworks_path}:work_sched_service_proxy", 45 "${worksched_frameworks_path}:work_sched_service_stub", 46 "${worksched_frameworks_path}:workschedclient", 47 "${worksched_frameworks_path}/extension:workschedextension", 48 "${worksched_service_path}:workschedservice", 49 "${worksched_utils_path}:workschedutils", 50 "${worksched_zidl_path}:workschedservice_zidl_proxy", 51 "${worksched_zidl_path}:workschedservice_zidl_stub", 52 ] 53 54 external_deps = [ 55 "ability_base:want", 56 "ability_runtime:ability_manager", 57 "ability_runtime:app_manager", 58 "bundle_framework:appexecfwk_base", 59 "bundle_framework:appexecfwk_core", 60 "c_utils:utils", 61 "common_event_service:cesfwk_innerkits", 62 "eventhandler:libeventhandler", 63 "ffrt:libffrt", 64 "hilog:libhilog", 65 "hisysevent:libhisysevent", 66 "ipc:ipc_single", 67 "safwk:system_ability_fwk", 68 "samgr:samgr_proxy", 69 ] 70 defines = [] 71 if (powermgr_battery_manager_enable) { 72 external_deps += [ "battery_manager:batterysrv_client" ] 73 defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ] 74 } 75 if (powermgr_thermal_manager_enable) { 76 external_deps += [ "thermal_manager:thermalsrv_client" ] 77 defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ] 78 } 79 if (powermgr_power_manager_enable) { 80 external_deps += [ "power_manager:powermgr_client" ] 81 defines += [ "POWERMGR_POWER_MANAGER_ENABLE" ] 82 } 83 resource_config_file = "${worksched_test_path}/resource/ohos_test.xml" 84} 85 86############################################################################### 87group("fuzztest") { 88 testonly = true 89 deps = [] 90 deps += [ 91 # deps file 92 ":WorkScheduleServiceFuzzTest", 93 ] 94} 95############################################################################### 96