1# Copyright (c) 2022-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("DistributedInputTransportBaseFuzzTest") { 22 module_out_path = fuzz_test_path 23 24 fuzz_config_file = "${distributedinput_path}/test/fuzztest/distributedinputtransportbase_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 = [ 47 "${distributedinput_path}/services/transportbase/src/distributed_input_transport_base.cpp", 48 "distributed_input_transport_base_fuzzer.cpp", 49 ] 50 51 deps = [ 52 "${dfx_utils_path}:libdinput_dfx_utils", 53 "${distributedinput_path}/services/transportbase:libdinput_trans_base", 54 "${services_source_path}/inputinject:libdinput_inject", 55 "${utils_path}:libdinput_utils", 56 ] 57 58 external_deps = [ 59 "c_utils:utils", 60 "distributed_hardware_fwk:distributed_av_sender", 61 "distributed_hardware_fwk:distributedhardwareutils", 62 "distributed_hardware_fwk:libdhfwk_sdk", 63 "dsoftbus:softbus_client", 64 "eventhandler:libeventhandler", 65 "hilog:libhilog", 66 "hitrace:hitrace_meter", 67 "ipc:ipc_core", 68 "json:nlohmann_json_static", 69 "libevdev:libevdev", 70 "safwk:system_ability_fwk", 71 ] 72 73 defines = [ 74 "HI_LOG_ENABLE", 75 "DH_LOG_TAG=\"DistributedInputTransportBaseFuzzTest\"", 76 "LOG_DOMAIN=0xD004120", 77 ] 78} 79 80############################################################################### 81group("fuzztest") { 82 testonly = true 83 84 deps = [ ":DistributedInputTransportBaseFuzzTest" ] 85} 86############################################################################### 87