1# Copyright (c) 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.
13import("../../../device_status.gni")
14
15###############################hydra_fuzz#################################
16import("//build/config/features.gni")
17import("//build/test.gni")
18module_output_path = "${device_status_fuzz_output_path}"
19deps_ex = [
20  "ability_runtime:app_manager",
21  "access_token:libaccesstoken_sdk",
22  "cJSON:cjson",
23  "c_utils:utils",
24  "device_manager:devicemanagersdk",
25  "graphic_2d:libcomposer",
26  "graphic_2d:window_animation",
27  "graphic_2d:librender_service_client",
28  "hisysevent:libhisysevent",
29  "hitrace:hitrace_meter",
30  "hilog:libhilog",
31  "input:libmmi-client",
32  "window_manager:libdm",
33]
34
35###############################fuzztest#################################
36ohos_fuzztest("DsoftbusAdapterFuzzTest") {
37  module_out_path = module_output_path
38  fuzz_config_file =
39      "${device_status_root_path}/test/fuzztest/dsoftbusadapter_fuzzer"
40  include_dirs = [
41    "${device_status_root_path}/libs/interface",
42    "${device_status_service_path}/interaction/drag/include",
43    "${device_status_service_path}/communication/service/include",
44    "${device_status_utils_path}/include",
45  ]
46
47  cflags = [
48    "-g",
49    "-O0",
50    "-fno-omit-frame-pointer",
51    "-Dprivate=public",
52    "-Dprotected=public",
53  ]
54
55  sources = [ "dsoftbusadapter_fuzzer.cpp" ]
56
57  deps = [
58    "${device_status_interfaces_path}/innerkits:devicestatus_client",
59    "${device_status_root_path}/intention/adapters/dsoftbus_adapter:intention_dsoftbus_adapter",
60    "${device_status_root_path}/services:devicestatus_static_service",
61    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
62    "${device_status_utils_path}:devicestatus_util",
63  ]
64
65  external_deps = deps_ex
66}
67
68group("fuzztest") {
69  testonly = true
70  deps = []
71  deps += [ ":DsoftbusAdapterFuzzTest" ]
72}
73