• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2024 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")
17import("//foundation/resourceschedule/device_standby/standby_service.gni")
18module_output_path = "device_standby/device_standby"
19
20##############################fuzztest##########################################
21ohos_fuzztest("DeviceStandbyFuzzTest") {
22  module_out_path = module_output_path
23  fuzz_config_file =
24      "${standby_service_path}/test/fuzztest/devicestandby_fuzzer"
25
26  include_dirs = [
27    "${standby_service_path}/include",
28    "${standby_innerkits_path}:standby_innerkits",
29    "${standby_utils_common_path}:standby_utils_common",
30    "${standby_utils_policy_path}:standby_utils_policy",
31  ]
32
33  cflags = [
34    "-g",
35    "-O0",
36    "-Wno-unused-variable",
37    "-fno-omit-frame-pointer",
38  ]
39
40  cflags_cc = [
41    "-Dprivate=public",
42    "-Dprotected=public",
43  ]
44
45  deps = [
46    "${standby_innerkits_path}:standby_innerkits",
47    "${standby_service_frameworks_path}:standby_fwk",
48    "${standby_service_path}:standby_service_static",
49    "${standby_utils_common_path}:standby_utils_common",
50    "${standby_utils_policy_path}:standby_utils_policy",
51  ]
52
53  sources = [ "devicestandby_fuzzer.cpp" ]
54
55  external_deps = [
56    "ability_base:base",
57    "ability_base:want",
58    "ability_base:zuri",
59    "ability_runtime:app_manager",
60    "ability_runtime:wantagent_innerkits",
61    "bundle_framework:appexecfwk_base",
62    "c_utils:utils",
63    "common_event_service:cesfwk_innerkits",
64    "eventhandler:libeventhandler",
65    "hilog:libhilog",
66    "init:libbegetutil",
67    "ipc:ipc_single",
68    "resource_schedule_service:ressched_client",
69    "resource_schedule_service:resschedsvc",
70    "safwk:system_ability_fwk",
71    "samgr:samgr_proxy",
72    "time_service:time_client",
73  ]
74
75  defines = []
76  if (standby_power_manager_enable) {
77    external_deps += [ "power_manager:powermgr_client" ]
78    defines += [ "STANDBY_POWER_MANAGER_ENABLE" ]
79  }
80  if (device_standby_access_token_enable) {
81    external_deps += [
82      "access_token:libaccesstoken_sdk",
83      "access_token:libnativetoken",
84      "access_token:libtoken_setproc",
85      "access_token:libtokenid_sdk",
86    ]
87    defines += [ "DEVICE_STANDBY_ACCESS_TOKEN_ENABLE" ]
88  }
89}
90
91###############################################################################
92group("fuzztest") {
93  testonly = true
94  deps = []
95  deps += [
96    # deps file
97    ":DeviceStandbyFuzzTest",
98  ]
99}
100###############################################################################
101