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