• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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(
18    "//foundation/distributedhardware/distributed_input/distributedinput.gni")
19
20##############################fuzztest##########################################
21ohos_fuzztest("DinputPermissionCheckFuzzTest") {
22  module_out_path = fuzz_test_path
23
24  fuzz_config_file = "${distributedinput_path}/test/fuzztest/dinputpermissioncheck_fuzzer"
25
26  include_dirs = [
27    "${services_source_path}/transport/include",
28    "${distributedinput_path}/services/transportbase/include",
29    "${common_path}/include",
30    "${service_common}/include",
31    "${services_source_path}/inputinject/include",
32    "${services_source_path}/transport/include",
33    "${dfx_utils_path}/include",
34    "${utils_path}/include",
35    "${frameworks_path}/include",
36    "${distributedinput_path}/inputdevicehandler/include",
37  ]
38
39  cflags = [
40    "-g",
41    "-O0",
42    "-Wno-unused-variable",
43    "-fno-omit-frame-pointer",
44  ]
45
46  sources = [ "dinput_permission_check_fuzzer.cpp" ]
47
48  deps = [
49    "${dfx_utils_path}:libdinput_dfx_utils",
50    "${distributedinput_path}/services/transportbase:libdinput_trans_base",
51    "${services_source_path}/inputinject:libdinput_inject",
52    "${utils_path}:libdinput_utils",
53  ]
54
55  external_deps = [
56    "c_utils:utils",
57    "device_manager:devicemanagersdk",
58    "distributed_hardware_fwk:distributed_av_sender",
59    "distributed_hardware_fwk:distributedhardwareutils",
60    "distributed_hardware_fwk:libdhfwk_sdk",
61    "dsoftbus:softbus_client",
62    "eventhandler:libeventhandler",
63    "hilog:libhilog",
64    "hitrace:hitrace_meter",
65    "ipc:ipc_core",
66    "json:nlohmann_json_static",
67    "libevdev:libevdev",
68    "os_account:libaccountkits",
69    "os_account:os_account_innerkits",
70    "safwk:system_ability_fwk",
71    "samgr:samgr_proxy",
72  ]
73
74  defines = [
75    "HI_LOG_ENABLE",
76    "DH_LOG_TAG=\"DinputPermissionCheckFuzzTest\"",
77    "LOG_DOMAIN=0xD004120",
78    "private=public",
79  ]
80
81  if (check_same_account) {
82    defines += [ "SUPPORT_SAME_ACCOUNT" ]
83  }
84}
85
86###############################################################################
87group("fuzztest") {
88  testonly = true
89
90  deps = [ ":DinputPermissionCheckFuzzTest" ]
91}
92###############################################################################
93