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("DistributedInputSinkTransportFuzzTest") {
22  module_out_path = fuzz_test_path
23
24  fuzz_config_file = "${distributedinput_path}/test/fuzztest/distributedinputsinktransport_fuzzer"
25
26  include_dirs = [
27    "${services_sink_path}/transport/include",
28    "${distributedinput_path}/services/transportbase/include",
29    "${common_path}/include",
30    "${frameworks_path}/include",
31    "${service_common}/include",
32    "${dfx_utils_path}/include",
33    "${utils_path}/include",
34  ]
35
36  cflags = [
37    "-g",
38    "-O0",
39    "-Wno-unused-variable",
40    "-fno-omit-frame-pointer",
41  ]
42  sources = [
43    "${services_sink_path}/transport/src/distributed_input_sink_switch.cpp",
44    "${services_sink_path}/transport/src/distributed_input_sink_transport.cpp",
45    "distributed_input_sink_transport_fuzzer.cpp",
46  ]
47
48  deps = [
49    "${dfx_utils_path}:libdinput_dfx_utils",
50    "${distributedinput_path}/services/transportbase:libdinput_trans_base",
51    "${utils_path}:libdinput_utils",
52  ]
53
54  external_deps = [
55    "c_utils:utils",
56    "distributed_hardware_fwk:distributed_av_sender",
57    "distributed_hardware_fwk:distributedhardwareutils",
58    "distributed_hardware_fwk:libdhfwk_sdk",
59    "dsoftbus:softbus_client",
60    "eventhandler:libeventhandler",
61    "hicollie:libhicollie",
62    "hilog:libhilog",
63    "ipc:ipc_core",
64    "json:nlohmann_json_static",
65    "libevdev:libevdev",
66    "safwk:system_ability_fwk",
67  ]
68
69  defines = [
70    "HI_LOG_ENABLE",
71    "DH_LOG_TAG=\"DistributedInputSinkTransportFuzzTest\"",
72    "LOG_DOMAIN=0xD004120",
73  ]
74}
75
76###############################################################################
77group("fuzztest") {
78  testonly = true
79
80  deps = [ ":DistributedInputSinkTransportFuzzTest" ]
81}
82###############################################################################
83