• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2023 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    "include",
29    "${distributedinput_path}/interfaces/inner_kits/include",
30    "${distributedinput_path}/interfaces/ipc/include",
31    "${distributedinput_path}/services/source/sourcemanager/include",
32    "${distributedinput_path}/services/sink/sinkmanager/include",
33    "${distributedinput_path}/frameworks/include",
34    "${distributedinput_path}/sourcehandler/include",
35    "${distributedinput_path}/sinkhandler/include",
36    "${distributedinput_path}/inputdevicehandler/include",
37    "${service_common}/include",
38    "${common_path}/include",
39    "${fwk_common_path}/log/include",
40    "${fwk_common_path}/utils/include",
41    "//third_party/json/include",
42    "${utils_path}/include",
43    "${fwk_interfaces_path}/include",
44    "${fwk_interfaces_path}/include/ipc",
45    "${services_source_path}/inputinject/include",
46    "${distributedinput_path}/services/state/include",
47  ]
48
49  cflags = [
50    "-g",
51    "-O0",
52    "-Wno-unused-variable",
53    "-fno-omit-frame-pointer",
54  ]
55
56  sources = [ "distributed_input_kit_fuzzer.cpp" ]
57
58  deps = [
59    "${distributedinput_path}/interfaces/inner_kits:libdinput_sdk",
60    "//third_party/libevdev:libevdev",
61  ]
62
63  external_deps = [
64    "c_utils:utils",
65    "eventhandler:libeventhandler",
66    "ipc:ipc_core",
67  ]
68
69  defines = [
70    "HI_LOG_ENABLE",
71    "DH_LOG_TAG=\"DistributedInputKitFuzzTest\"",
72    "LOG_DOMAIN=0xD004120",
73  ]
74}
75
76###############################################################################
77group("fuzztest") {
78  testonly = true
79
80  deps = [ ":DistributedInputKitFuzzTest" ]
81}
82###############################################################################
83