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