12d4d9a4dSopenharmony_ci# Copyright (c) 2022-2024 Huawei Device Co., Ltd.
22d4d9a4dSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
32d4d9a4dSopenharmony_ci# you may not use this file except in compliance with the License.
42d4d9a4dSopenharmony_ci# You may obtain a copy of the License at
52d4d9a4dSopenharmony_ci#
62d4d9a4dSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
72d4d9a4dSopenharmony_ci#
82d4d9a4dSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
92d4d9a4dSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
102d4d9a4dSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112d4d9a4dSopenharmony_ci# See the License for the specific language governing permissions and
122d4d9a4dSopenharmony_ci# limitations under the License.
132d4d9a4dSopenharmony_ci
142d4d9a4dSopenharmony_ci#####################hydra-fuzz###################
152d4d9a4dSopenharmony_ciimport("//build/config/features.gni")
162d4d9a4dSopenharmony_ciimport("//build/test.gni")
172d4d9a4dSopenharmony_ciimport(
182d4d9a4dSopenharmony_ci    "//foundation/distributedhardware/distributed_input/distributedinput.gni")
192d4d9a4dSopenharmony_ci
202d4d9a4dSopenharmony_ci##############################fuzztest##########################################
212d4d9a4dSopenharmony_ciohos_fuzztest("DistributedInputTransportBaseFuzzTest") {
222d4d9a4dSopenharmony_ci  module_out_path = fuzz_test_path
232d4d9a4dSopenharmony_ci
242d4d9a4dSopenharmony_ci  fuzz_config_file = "${distributedinput_path}/test/fuzztest/distributedinputtransportbase_fuzzer"
252d4d9a4dSopenharmony_ci
262d4d9a4dSopenharmony_ci  include_dirs = [
272d4d9a4dSopenharmony_ci    "${services_source_path}/transport/include",
282d4d9a4dSopenharmony_ci    "${distributedinput_path}/services/transportbase/include",
292d4d9a4dSopenharmony_ci    "${common_path}/include",
302d4d9a4dSopenharmony_ci    "${service_common}/include",
312d4d9a4dSopenharmony_ci    "${services_source_path}/inputinject/include",
322d4d9a4dSopenharmony_ci    "${services_source_path}/transport/include",
332d4d9a4dSopenharmony_ci    "${dfx_utils_path}/include",
342d4d9a4dSopenharmony_ci    "${utils_path}/include",
352d4d9a4dSopenharmony_ci    "${frameworks_path}/include",
362d4d9a4dSopenharmony_ci    "${distributedinput_path}/inputdevicehandler/include",
372d4d9a4dSopenharmony_ci  ]
382d4d9a4dSopenharmony_ci
392d4d9a4dSopenharmony_ci  cflags = [
402d4d9a4dSopenharmony_ci    "-g",
412d4d9a4dSopenharmony_ci    "-O0",
422d4d9a4dSopenharmony_ci    "-Wno-unused-variable",
432d4d9a4dSopenharmony_ci    "-fno-omit-frame-pointer",
442d4d9a4dSopenharmony_ci  ]
452d4d9a4dSopenharmony_ci
462d4d9a4dSopenharmony_ci  sources = [
472d4d9a4dSopenharmony_ci    "${distributedinput_path}/services/transportbase/src/distributed_input_transport_base.cpp",
482d4d9a4dSopenharmony_ci    "distributed_input_transport_base_fuzzer.cpp",
492d4d9a4dSopenharmony_ci  ]
502d4d9a4dSopenharmony_ci
512d4d9a4dSopenharmony_ci  deps = [
522d4d9a4dSopenharmony_ci    "${dfx_utils_path}:libdinput_dfx_utils",
532d4d9a4dSopenharmony_ci    "${distributedinput_path}/services/transportbase:libdinput_trans_base",
542d4d9a4dSopenharmony_ci    "${services_source_path}/inputinject:libdinput_inject",
552d4d9a4dSopenharmony_ci    "${utils_path}:libdinput_utils",
562d4d9a4dSopenharmony_ci  ]
572d4d9a4dSopenharmony_ci
582d4d9a4dSopenharmony_ci  external_deps = [
592d4d9a4dSopenharmony_ci    "c_utils:utils",
602d4d9a4dSopenharmony_ci    "distributed_hardware_fwk:distributed_av_sender",
612d4d9a4dSopenharmony_ci    "distributed_hardware_fwk:distributedhardwareutils",
622d4d9a4dSopenharmony_ci    "distributed_hardware_fwk:libdhfwk_sdk",
632d4d9a4dSopenharmony_ci    "dsoftbus:softbus_client",
642d4d9a4dSopenharmony_ci    "eventhandler:libeventhandler",
652d4d9a4dSopenharmony_ci    "hilog:libhilog",
662d4d9a4dSopenharmony_ci    "hitrace:hitrace_meter",
672d4d9a4dSopenharmony_ci    "ipc:ipc_core",
682d4d9a4dSopenharmony_ci    "json:nlohmann_json_static",
692d4d9a4dSopenharmony_ci    "libevdev:libevdev",
702d4d9a4dSopenharmony_ci    "safwk:system_ability_fwk",
712d4d9a4dSopenharmony_ci  ]
722d4d9a4dSopenharmony_ci
732d4d9a4dSopenharmony_ci  defines = [
742d4d9a4dSopenharmony_ci    "HI_LOG_ENABLE",
752d4d9a4dSopenharmony_ci    "DH_LOG_TAG=\"DistributedInputTransportBaseFuzzTest\"",
762d4d9a4dSopenharmony_ci    "LOG_DOMAIN=0xD004120",
772d4d9a4dSopenharmony_ci  ]
782d4d9a4dSopenharmony_ci}
792d4d9a4dSopenharmony_ci
802d4d9a4dSopenharmony_ci###############################################################################
812d4d9a4dSopenharmony_cigroup("fuzztest") {
822d4d9a4dSopenharmony_ci  testonly = true
832d4d9a4dSopenharmony_ci
842d4d9a4dSopenharmony_ci  deps = [ ":DistributedInputTransportBaseFuzzTest" ]
852d4d9a4dSopenharmony_ci}
862d4d9a4dSopenharmony_ci###############################################################################
87