• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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
14import("//build/test.gni")
15import("../../../../displaymgr.gni")
16
17module_output_path = "display_manager/display_state_manager"
18
19##############################fuzztest##########################################
20ohos_fuzztest("SetMaxBrightnessFuzzTest") {
21  module_out_path = module_output_path
22  fuzz_config_file =
23      "${displaymgr_root_path}/test/fuzztest/setmaxbrightness_fuzzer"
24
25  include_dirs = [
26    "./",
27    "${displaymgr_root_path}/service/native/include",
28    "${displaymgr_root_path}/service/zidl/include",
29    "${displaymgr_inner_api}/native/include",
30    "../display_utils",
31  ]
32
33  configs = [
34    "${displaymgr_utils_path}:utils_config",
35    "${displaymgr_utils_path}:coverage_flags",
36    "${brightnessmgr_root_path}:brightness_manager_config",
37  ]
38
39  deps = [ "${brightnessmgr_root_path}:brightness_manager" ]
40
41  cflags = [
42    "-g",
43    "-O0",
44    "-Wno-unused-variable",
45    "-fno-omit-frame-pointer",
46  ]
47  sources = [
48    "${displaymgr_root_path}/service/native/src/display_auto_brightness.cpp",
49    "${displaymgr_root_path}/service/native/src/display_common_event_mgr.cpp",
50    "${displaymgr_root_path}/service/native/src/display_param_helper.cpp",
51    "${displaymgr_root_path}/service/native/src/display_power_mgr_service.cpp",
52    "${displaymgr_root_path}/service/native/src/display_setting_helper.cpp",
53    "${displaymgr_root_path}/service/native/src/display_system_ability.cpp",
54    "${displaymgr_root_path}/service/native/src/gradual_animator.cpp",
55    "${displaymgr_root_path}/service/native/src/screen_action.cpp",
56    "${displaymgr_root_path}/service/native/src/screen_controller.cpp",
57    "${displaymgr_root_path}/service/zidl/src/display_power_callback_proxy.cpp",
58    "${displaymgr_root_path}/service/zidl/src/display_power_mgr_stub.cpp",
59    "../display_utils/display_fuzzer.cpp",
60    "./setmaxbrightness_fuzzer_test.cpp",
61  ]
62
63  external_deps = [ "power_manager:power_permission" ]
64  external_deps += [
65    "ability_base:base",
66    "ability_base:want",
67    "ability_runtime:ability_manager",
68    "c_utils:utils",
69    "common_event_service:cesfwk_innerkits",
70    "data_share:datashare_common",
71    "data_share:datashare_consumer",
72    "display_manager:displaymgr",
73    "eventhandler:libeventhandler",
74    "ffrt:libffrt",
75    "hicollie:libhicollie",
76    "hilog:libhilog",
77    "hisysevent:libhisysevent",
78    "image_framework:image_native",
79    "ipc:ipc_core",
80    "power_manager:power_ffrt",
81    "power_manager:power_setting",
82    "power_manager:power_sysparam",
83    "power_manager:powermgr_client",
84    "safwk:system_ability_fwk",
85    "samgr:samgr_proxy",
86    "window_manager:libdm_lite",
87  ]
88
89  defines = []
90  if (has_sensors_sensor_part) {
91    external_deps += [ "sensor:sensor_interface_native" ]
92    defines += [ "ENABLE_SENSOR_PART" ]
93  }
94  if (use_clang_coverage) {
95    defines += [ "FUZZ_COV_TEST" ]
96  }
97}
98