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