1# Copyright (c) 2023 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/ohos.gni")
17import("//build/test.gni")
18import("../../../cgroup_sched.gni")
19module_output_path = "resource_schedule_service/resource_schedule_service"
20
21##############################fuzztest##########################################
22ohos_fuzztest("CgroupSchedFuzzTest") {
23  module_out_path = module_output_path
24  fuzz_config_file = "${cgroup_sched_path}/test/fuzztest/cgroupsched_fuzzer"
25
26  include_dirs = [
27    "${cgroup_sched_framework}/sched_controller/include",
28    "${cgroup_sched_interfaces}/innerkits/ressched_client/include",
29    "${cgroup_sched_common}/include",
30    "${cgroup_sched_framework}/utils/include",
31  ]
32
33  cflags = [
34    "-g",
35    "-O0",
36    "-Wno-unused-variable",
37    "-fno-omit-frame-pointer",
38    "-Dprivate=public",
39    "-Dprotected=public",
40  ]
41
42  sources = [ "cgroupsched_fuzzer.cpp" ]
43
44  deps = [ "${cgroup_sched_framework}:cgroup_sched" ]
45
46  external_deps = [
47    "ability_runtime:app_manager",
48    "ability_runtime:wantagent_innerkits",
49    "c_utils:utils",
50    "common_event_service:cesfwk_innerkits",
51    "eventhandler:libeventhandler",
52    "ffrt:libffrt",
53    "hilog:libhilog",
54    "hisysevent:libhisysevent",
55    "hitrace:hitrace_meter",
56    "ipc:ipc_single",
57    "samgr:samgr_proxy",
58    "window_manager:libwm",
59  ]
60
61  if (has_bg_task_mgr) {
62    defines = [ "CONFIG_BGTASK_MGR" ]
63    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
64  }
65
66  part_name = "resource_schedule_service"
67  subsystem_name = "resourceschedule"
68}
69
70###############################################################################
71group("fuzztest") {
72  testonly = true
73  deps = []
74  deps += [
75    # deps file
76    ":CgroupSchedFuzzTest",
77  ]
78}
79###############################################################################
80