• 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/work_scheduler/workscheduler.gni")
18module_output_path = "work_scheduler/work_scheduler"
19
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("WorkSchedulerStopAndClearWorksFuzzTest") {
30  module_out_path = module_output_path
31  fuzz_config_file =
32      "${worksched_test_path}/fuzztest/workschedulerstopandclearworks_fuzzer"
33
34  configs = [ ":worksched_private_config" ]
35  cflags = [
36    "-g",
37    "-O0",
38    "-Wno-unused-variable",
39    "-fno-omit-frame-pointer",
40    "-Dprivate=public",
41    "-Dprotected=public",
42  ]
43  sources = [ "workschedulerstopandclearworks_fuzzer.cpp" ]
44
45  deps = [
46    "${worksched_frameworks_path}:work_sched_service_proxy",
47    "${worksched_frameworks_path}:work_sched_service_stub",
48    "${worksched_frameworks_path}:workschedclient",
49    "${worksched_frameworks_path}/extension:workschedextension",
50    "${worksched_service_path}:workschedservice_static",
51    "${worksched_utils_path}:workschedutils",
52    "${worksched_zidl_path}:workschedservice_zidl_proxy",
53    "${worksched_zidl_path}:workschedservice_zidl_stub",
54  ]
55
56  external_deps = [
57    "ability_base:want",
58    "ability_runtime:ability_manager",
59    "ability_runtime:app_manager",
60    "bundle_framework:appexecfwk_base",
61    "bundle_framework:appexecfwk_core",
62    "c_utils:utils",
63    "common_event_service:cesfwk_innerkits",
64    "data_share:datashare_consumer",
65    "eventhandler:libeventhandler",
66    "ffrt:libffrt",
67    "hilog:libhilog",
68    "hisysevent:libhisysevent",
69    "ipc:ipc_single",
70    "jsoncpp:jsoncpp",
71    "resource_management:global_resmgr",
72    "safwk:system_ability_fwk",
73    "samgr:samgr_proxy",
74  ]
75
76  resource_config_file = "${worksched_test_path}/resource/ohos_test.xml"
77
78  defines = [ "WORK_SCHEDULER_TEST" ]
79  if (bundle_active_enable) {
80    external_deps += [ "device_usage_statistics:usagestatsinner" ]
81    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
82  }
83  if (device_standby_enable) {
84    external_deps += [ "device_standby:standby_innerkits" ]
85    defines += [ "DEVICE_STANDBY_ENABLE" ]
86  }
87  if (resourceschedule_bgtaskmgr_enable) {
88    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
89    defines += [ "RESOURCESCHEDULE_BGTASKMGR_ENABLE" ]
90  }
91  if (powermgr_battery_manager_enable) {
92    external_deps += [ "battery_manager:batterysrv_client" ]
93    defines += [ "POWERMGR_BATTERY_MANAGER_ENABLE" ]
94  }
95  if (powermgr_thermal_manager_enable) {
96    external_deps += [ "thermal_manager:thermalsrv_client" ]
97    defines += [ "POWERMGR_THERMAL_MANAGER_ENABLE" ]
98  }
99  if (powermgr_power_manager_enable) {
100    external_deps += [ "power_manager:powermgr_client" ]
101    defines += [ "POWERMGR_POWER_MANAGER_ENABLE" ]
102  }
103  if (workscheduler_with_communication_netmanager_base_enable) {
104    defines += [ "COMMUNICATION_NETMANAGER_BASE_ENABLE" ]
105    external_deps += [ "netmanager_base:net_conn_manager_if" ]
106  }
107}
108
109###############################################################################
110group("fuzztest") {
111  testonly = true
112  deps = []
113  deps += [
114    # deps file
115    ":WorkSchedulerStopAndClearWorksFuzzTest",
116  ]
117}
118###############################################################################
119