1f857971dSopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd.
2f857971dSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3f857971dSopenharmony_ci# you may not use this file except in compliance with the License.
4f857971dSopenharmony_ci# You may obtain a copy of the License at
5f857971dSopenharmony_ci#
6f857971dSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7f857971dSopenharmony_ci#
8f857971dSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9f857971dSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10f857971dSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11f857971dSopenharmony_ci# See the License for the specific language governing permissions and
12f857971dSopenharmony_ci# limitations under the License.
13f857971dSopenharmony_ciimport("../../../device_status.gni")
14f857971dSopenharmony_ci
15f857971dSopenharmony_ci###############################hydra_fuzz#################################
16f857971dSopenharmony_ciimport("//build/config/features.gni")
17f857971dSopenharmony_ciimport("//build/test.gni")
18f857971dSopenharmony_cimodule_output_path = "${device_status_fuzz_output_path}"
19f857971dSopenharmony_cideps_ex = [
20f857971dSopenharmony_ci  "ability_runtime:app_manager",
21f857971dSopenharmony_ci  "device_manager:devicemanagersdk",
22f857971dSopenharmony_ci  "access_token:libaccesstoken_sdk",
23f857971dSopenharmony_ci  "cJSON:cjson",
24f857971dSopenharmony_ci  "c_utils:utils",
25f857971dSopenharmony_ci  "graphic_2d:libcomposer",
26f857971dSopenharmony_ci  "graphic_2d:window_animation",
27f857971dSopenharmony_ci  "graphic_2d:librender_service_client",
28f857971dSopenharmony_ci  "hisysevent:libhisysevent",
29f857971dSopenharmony_ci  "hitrace:hitrace_meter",
30f857971dSopenharmony_ci  "hilog:libhilog",
31f857971dSopenharmony_ci  "input:libmmi-client",
32f857971dSopenharmony_ci  "image_framework:image_native",
33f857971dSopenharmony_ci  "window_manager:libwm",
34f857971dSopenharmony_ci  "window_manager:libdm",
35f857971dSopenharmony_ci]
36f857971dSopenharmony_ci
37f857971dSopenharmony_ci###############################fuzztest#################################
38f857971dSopenharmony_ciohos_fuzztest("MsdpDeviceManagerFuzzTest") {
39f857971dSopenharmony_ci  module_out_path = module_output_path
40f857971dSopenharmony_ci  fuzz_config_file =
41f857971dSopenharmony_ci      "${device_status_root_path}/test/fuzztest/msdpdevicemanager_fuzzer"
42f857971dSopenharmony_ci  include_dirs = [
43f857971dSopenharmony_ci    "${device_status_root_path}/libs/interface",
44f857971dSopenharmony_ci    "${device_status_service_path}/interaction/drag/include",
45f857971dSopenharmony_ci    "${device_status_service_path}/communication/service/include",
46f857971dSopenharmony_ci    "${device_status_utils_path}/include",
47f857971dSopenharmony_ci  ]
48f857971dSopenharmony_ci
49f857971dSopenharmony_ci  cflags = [
50f857971dSopenharmony_ci    "-g",
51f857971dSopenharmony_ci    "-O0",
52f857971dSopenharmony_ci    "-fno-omit-frame-pointer",
53f857971dSopenharmony_ci    "-Dprivate=public",
54f857971dSopenharmony_ci    "-Dprotected=public",
55f857971dSopenharmony_ci  ]
56f857971dSopenharmony_ci
57f857971dSopenharmony_ci  sources = [ "msdpdevicemanager_fuzzer.cpp" ]
58f857971dSopenharmony_ci
59f857971dSopenharmony_ci  deps = [
60f857971dSopenharmony_ci    "${device_status_interfaces_path}/innerkits:devicestatus_client",
61f857971dSopenharmony_ci    "${device_status_root_path}/intention/adapters/ddm_adapter:intention_ddm_adapter",
62f857971dSopenharmony_ci    "${device_status_root_path}/intention/cooperate/plugin:intention_cooperate",
63f857971dSopenharmony_ci    "${device_status_root_path}/intention/ipc/tunnel:intention_tunnel_client",
64f857971dSopenharmony_ci    "${device_status_root_path}/services:devicestatus_static_service",
65f857971dSopenharmony_ci    "${device_status_root_path}/utils/ipc:devicestatus_ipc",
66f857971dSopenharmony_ci    "${device_status_utils_path}:devicestatus_util",
67f857971dSopenharmony_ci  ]
68f857971dSopenharmony_ci
69f857971dSopenharmony_ci  external_deps = deps_ex
70f857971dSopenharmony_ci}
71f857971dSopenharmony_ci
72f857971dSopenharmony_cigroup("fuzztest") {
73f857971dSopenharmony_ci  testonly = true
74f857971dSopenharmony_ci  deps = []
75f857971dSopenharmony_ci  deps += [ ":MsdpDeviceManagerFuzzTest" ]
76f857971dSopenharmony_ci}
77