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("DistributedInputKitFuzzTest") { 22 module_out_path = fuzz_test_path 23 24 fuzz_config_file = 25 "${distributedinput_path}/test/fuzztest/distributedinputkit_fuzzer" 26 27 include_dirs = [ 28 "${distributedinput_path}/interfaces/inner_kits/include", 29 "${distributedinput_path}/interfaces/ipc/include", 30 "${distributedinput_path}/services/source/sourcemanager/include", 31 "${distributedinput_path}/services/sink/sinkmanager/include", 32 "${distributedinput_path}/frameworks/include", 33 "${distributedinput_path}/sourcehandler/include", 34 "${distributedinput_path}/sinkhandler/include", 35 "${distributedinput_path}/inputdevicehandler/include", 36 "${service_common}/include", 37 "${common_path}/include", 38 "${utils_path}/include", 39 "${services_source_path}/inputinject/include", 40 "${distributedinput_path}/services/state/include", 41 ] 42 43 cflags = [ 44 "-g", 45 "-O0", 46 "-Wno-unused-variable", 47 "-fno-omit-frame-pointer", 48 ] 49 50 sources = [ "distributed_input_kit_fuzzer.cpp" ] 51 52 deps = [ "${distributedinput_path}/interfaces/inner_kits:libdinput_sdk" ] 53 54 external_deps = [ 55 "c_utils:utils", 56 "distributed_hardware_fwk:distributedhardwareutils", 57 "distributed_hardware_fwk:libdhfwk_sdk", 58 "eventhandler:libeventhandler", 59 "hilog:libhilog", 60 "ipc:ipc_core", 61 "json:nlohmann_json_static", 62 "libevdev:libevdev", 63 ] 64 65 defines = [ 66 "HI_LOG_ENABLE", 67 "DH_LOG_TAG=\"DistributedInputKitFuzzTest\"", 68 "LOG_DOMAIN=0xD004120", 69 ] 70} 71 72############################################################################### 73group("fuzztest") { 74 testonly = true 75 76 deps = [ ":DistributedInputKitFuzzTest" ] 77} 78############################################################################### 79