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
14import("//build/test.gni")
15import("../../../powermgr.gni")
16
17module_output_path = "power_manager/power_manager"
18
19##############################fuzztest##########################################
20ohos_fuzztest("AsyncShutdownCallbackFuzzTest") {
21  module_out_path = module_output_path
22  fuzz_config_file =
23      "${powermgr_root_path}/test/fuzztest/asyncshutdowncallback_fuzzer"
24
25  include_dirs = [
26    "${powermgr_service_path}/native/src/hibernate",
27    "${powermgr_service_path}/native/src/runninglock",
28    "${powermgr_service_path}/native/src/shutdown",
29    "${powermgr_service_path}/native/src/suspend",
30    "${powermgr_service_path}/native/src/wakeup",
31    "${powermgr_service_path}/native/src/screenoffpre",
32    "../power_utils",
33  ]
34
35  if (power_manager_feature_wakeup_action) {
36    include_dirs += [ "${powermgr_service_path}/native/src/wakeup_action" ]
37  }
38
39  configs = [
40    "${powermgr_utils_path}:coverage_flags",
41    "${powermgr_utils_path}:utils_config",
42  ]
43
44  cflags = [
45    "-g",
46    "-O0",
47    "-Wno-unused-variable",
48    "-fno-omit-frame-pointer",
49  ]
50  sources = [
51    "../power_utils/power_fuzzer.cpp",
52    "./asyncshutdowncallback_fuzzer_test.cpp",
53  ]
54  deps = [
55    "${powermgr_service_path}:powermgr_stub",
56    "${powermgr_service_path}:powermgrservice",
57    "${powermgr_service_path}/native/src/actions:powermgr_actions",
58    "//third_party/jsoncpp:jsoncpp",
59  ]
60
61  external_deps = [
62    "ability_runtime:ability_manager",
63    "c_utils:utils",
64    "ffrt:libffrt",
65    "hilog:libhilog",
66    "hisysevent:libhisysevent",
67    "input:libmmi-client",
68    "ipc:ipc_core",
69    "power_manager:power_ffrt",
70  ]
71  if (has_sensors_sensor_part) {
72    external_deps += [ "sensor:sensor_interface_native" ]
73  }
74}
75