1# Copyright (c) 2021-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(
18    "//foundation/distributedhardware/distributed_input/distributedinput.gni")
19
20##############################fuzztest##########################################
21ohos_fuzztest("DistributedInputSourceTransportFuzzTest") {
22  module_out_path = fuzz_test_path
23
24  fuzz_config_file = "${distributedinput_path}/test/fuzztest/distributedinputsourcetransport_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    "${distributedinput_path}/services/state/include",
38  ]
39
40  cflags = [
41    "-g",
42    "-O0",
43    "-Wno-unused-variable",
44    "-fno-omit-frame-pointer",
45  ]
46
47  sources = [
48    "${services_source_path}/transport/src/distributed_input_source_transport.cpp",
49    "distributed_input_source_transport_fuzzer.cpp",
50  ]
51
52  deps = [
53    "${dfx_utils_path}:libdinput_dfx_utils",
54    "${distributedinput_path}/services/transportbase:libdinput_trans_base",
55    "${services_source_path}/inputinject:libdinput_inject",
56    "${utils_path}:libdinput_utils",
57  ]
58
59  external_deps = [
60    "c_utils:utils",
61    "distributed_hardware_fwk:distributed_av_sender",
62    "distributed_hardware_fwk:distributedhardwareutils",
63    "distributed_hardware_fwk:libdhfwk_sdk",
64    "dsoftbus:softbus_client",
65    "eventhandler:libeventhandler",
66    "hilog:libhilog",
67    "hitrace:hitrace_meter",
68    "ipc:ipc_core",
69    "json:nlohmann_json_static",
70    "libevdev:libevdev",
71    "safwk:system_ability_fwk",
72  ]
73
74  defines = [
75    "HI_LOG_ENABLE",
76    "DH_LOG_TAG=\"DistributedInputSourceTransportFuzzTest\"",
77    "LOG_DOMAIN=0xD004120",
78  ]
79}
80
81###############################################################################
82group("fuzztest") {
83  testonly = true
84
85  deps = [ ":DistributedInputSourceTransportFuzzTest" ]
86}
87###############################################################################
88