1686862fbSopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd.
2686862fbSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3686862fbSopenharmony_ci# you may not use this file except in compliance with the License.
4686862fbSopenharmony_ci# You may obtain a copy of the License at
5686862fbSopenharmony_ci#
6686862fbSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7686862fbSopenharmony_ci#
8686862fbSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9686862fbSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10686862fbSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11686862fbSopenharmony_ci# See the License for the specific language governing permissions and
12686862fbSopenharmony_ci# limitations under the License.
13686862fbSopenharmony_ci
14686862fbSopenharmony_ci#####################hydra-fuzz###################
15686862fbSopenharmony_ciimport("//build/config/features.gni")
16686862fbSopenharmony_ciimport("//build/ohos.gni")
17686862fbSopenharmony_ciimport("//build/test.gni")
18686862fbSopenharmony_ciimport("//foundation/ability/dmsfwk/dmsfwk.gni")
19686862fbSopenharmony_ciohos_fuzztest("SoftbusAdapterFuzzTest") {
20686862fbSopenharmony_ci  module_out_path = module_output_path
21686862fbSopenharmony_ci
22686862fbSopenharmony_ci  visibility = [ ":*" ]
23686862fbSopenharmony_ci  include_dirs = [
24686862fbSopenharmony_ci    "${dms_path}/common/include/",
25686862fbSopenharmony_ci    "${dms_path}/interfaces/innerkits/common/include/",
26686862fbSopenharmony_ci    "${dms_path}/services/dtbschedmgr/include/",
27686862fbSopenharmony_ci    "${dms_path}/services/dtbschedmgr/include/collaborate/",
28686862fbSopenharmony_ci    "${dms_path}/services/dtbschedmgr/include/mission",
29686862fbSopenharmony_ci    "${dms_path}/services/dtbschedmgr/include/softbus_adapter",
30686862fbSopenharmony_ci    "${dms_path}/services/dtbschedmgr/include/softbus_adapter/transport",
31686862fbSopenharmony_ci    "${dms_path}/test/fuzztest/softbusadapter_fuzzer",
32686862fbSopenharmony_ci  ]
33686862fbSopenharmony_ci
34686862fbSopenharmony_ci  fuzz_config_file = "${dms_path}/test/fuzztest/softbusadapter_fuzzer"
35686862fbSopenharmony_ci
36686862fbSopenharmony_ci  configs = [ "${dms_path}/services/dtbschedmgr/test/resource:coverage_flags" ]
37686862fbSopenharmony_ci
38686862fbSopenharmony_ci  cflags = [
39686862fbSopenharmony_ci    "-g",
40686862fbSopenharmony_ci    "-O0",
41686862fbSopenharmony_ci    "-Wno-unused-variable",
42686862fbSopenharmony_ci    "-fno-omit-frame-pointer",
43686862fbSopenharmony_ci    "-Dprivate=public",
44686862fbSopenharmony_ci  ]
45686862fbSopenharmony_ci
46686862fbSopenharmony_ci  sources = [ "softbusadapter_fuzzer.cpp" ]
47686862fbSopenharmony_ci
48686862fbSopenharmony_ci  deps = [ "${dms_path}/services/dtbschedmgr:distributedschedsvr" ]
49686862fbSopenharmony_ci
50686862fbSopenharmony_ci  defines = []
51686862fbSopenharmony_ci  if (dmsfwk_mission_manager) {
52686862fbSopenharmony_ci    defines += [ "SUPPORT_DISTRIBUTED_MISSION_MANAGER" ]
53686862fbSopenharmony_ci  }
54686862fbSopenharmony_ci
55686862fbSopenharmony_ci  external_deps = [
56686862fbSopenharmony_ci    "ability_base:base",
57686862fbSopenharmony_ci    "ability_base:want",
58686862fbSopenharmony_ci    "ability_base:zuri",
59686862fbSopenharmony_ci    "ability_runtime:ability_manager",
60686862fbSopenharmony_ci    "ability_runtime:app_manager",
61686862fbSopenharmony_ci    "ability_runtime:dataobs_manager",
62686862fbSopenharmony_ci    "ability_runtime:mission_info",
63686862fbSopenharmony_ci    "access_token:libaccesstoken_sdk",
64686862fbSopenharmony_ci    "access_token:libnativetoken_shared",
65686862fbSopenharmony_ci    "access_token:libtokensetproc_shared",
66686862fbSopenharmony_ci    "bundle_framework:appexecfwk_base",
67686862fbSopenharmony_ci    "bundle_framework:appexecfwk_core",
68686862fbSopenharmony_ci    "cJSON:cjson",
69686862fbSopenharmony_ci    "c_utils:utils",
70686862fbSopenharmony_ci    "data_share:datashare_consumer",
71686862fbSopenharmony_ci    "device_auth:deviceauth_sdk",
72686862fbSopenharmony_ci    "device_info_manager:distributed_device_profile_common",
73686862fbSopenharmony_ci    "device_info_manager:distributed_device_profile_sdk",
74686862fbSopenharmony_ci    "device_manager:devicemanagersdk",
75686862fbSopenharmony_ci    "device_security_level:dslm_sdk",
76686862fbSopenharmony_ci    "distributed_bundle_framework:dbms_fwk",
77686862fbSopenharmony_ci    "dsoftbus:softbus_client",
78686862fbSopenharmony_ci    "eventhandler:libeventhandler",
79686862fbSopenharmony_ci    "hilog:libhilog",
80686862fbSopenharmony_ci    "hisysevent:libhisysevent",
81686862fbSopenharmony_ci    "hitrace:hitrace_meter",
82686862fbSopenharmony_ci    "hitrace:libhitracechain",
83686862fbSopenharmony_ci    "init:libbegetutil",
84686862fbSopenharmony_ci    "ipc:ipc_core",
85686862fbSopenharmony_ci    "kv_store:distributeddata_inner",
86686862fbSopenharmony_ci    "safwk:system_ability_fwk",
87686862fbSopenharmony_ci    "samgr:samgr_proxy",
88686862fbSopenharmony_ci  ]
89686862fbSopenharmony_ci}
90686862fbSopenharmony_ci
91686862fbSopenharmony_cigroup("fuzztest") {
92686862fbSopenharmony_ci  testonly = true
93686862fbSopenharmony_ci  deps = [ ":SoftbusAdapterFuzzTest" ]
94686862fbSopenharmony_ci}
95