• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("GetStateFuzzTest") {
21  module_out_path = module_output_path
22  fuzz_config_file = "${powermgr_root_path}/test/fuzztest/getstate_fuzzer"
23
24  include_dirs = [
25    "${powermgr_service_path}/native/src/shutdown",
26    "${powermgr_service_path}/native/src/suspend",
27    "${powermgr_service_path}/native/src/wakeup",
28    "../power_utils",
29  ]
30
31  if (power_manager_feature_wakeup_action) {
32    include_dirs += [ "${powermgr_service_path}/native/src/wakeup_action" ]
33  }
34
35  configs = [
36    "${powermgr_utils_path}:coverage_flags",
37    "${powermgr_utils_path}:utils_config",
38  ]
39
40  cflags = [
41    "-g",
42    "-O0",
43    "-Wno-unused-variable",
44    "-fno-omit-frame-pointer",
45  ]
46  sources = [
47    "../power_utils/power_fuzzer.cpp",
48    "./getstate_fuzzer_test.cpp",
49  ]
50  deps = [
51    "${powermgr_service_path}:powermgr_stub",
52    "${powermgr_service_path}:powermgrservice",
53    "${powermgr_service_path}/native/src/actions:powermgr_actions",
54    "//third_party/jsoncpp:jsoncpp",
55  ]
56
57  external_deps = [
58    "ability_runtime:ability_manager",
59    "c_utils:utils",
60    "ffrt:libffrt",
61    "hilog:libhilog",
62    "input:libmmi-client",
63    "ipc:ipc_core",
64    "power_manager:power_ffrt",
65    "sensor:sensor_interface_native",
66  ]
67}
68