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("BundleManagerCallBackStubFuzzTest") {
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}/test/fuzztest/bundlemanagercallbackstub_fuzzer",
29686862fbSopenharmony_ci    "${dms_path}/test/fuzztest/util",
30686862fbSopenharmony_ci  ]
31686862fbSopenharmony_ci
32686862fbSopenharmony_ci  fuzz_config_file =
33686862fbSopenharmony_ci      "${dms_path}/test/fuzztest/bundlemanagercallbackstub_fuzzer"
34686862fbSopenharmony_ci
35686862fbSopenharmony_ci  configs = [ "${dms_path}/services/dtbschedmgr/test/resource:coverage_flags" ]
36686862fbSopenharmony_ci
37686862fbSopenharmony_ci  cflags = [
38686862fbSopenharmony_ci    "-g",
39686862fbSopenharmony_ci    "-O0",
40686862fbSopenharmony_ci    "-Wno-unused-variable",
41686862fbSopenharmony_ci    "-fno-omit-frame-pointer",
42686862fbSopenharmony_ci    "-Dprivate=public",
43686862fbSopenharmony_ci  ]
44686862fbSopenharmony_ci
45686862fbSopenharmony_ci  sources = [
46686862fbSopenharmony_ci    "${dms_path}/test/fuzztest/util/mock_fuzz_util.cpp",
47686862fbSopenharmony_ci    "bundlemanagercallbackstub_fuzzer.cpp",
48686862fbSopenharmony_ci  ]
49686862fbSopenharmony_ci
50686862fbSopenharmony_ci  deps = [ "${dms_path}/services/dtbschedmgr:distributedschedsvr" ]
51686862fbSopenharmony_ci
52686862fbSopenharmony_ci  defines = []
53686862fbSopenharmony_ci  if (dmsfwk_mission_manager) {
54686862fbSopenharmony_ci    defines += [ "SUPPORT_DISTRIBUTED_MISSION_MANAGER" ]
55686862fbSopenharmony_ci  }
56686862fbSopenharmony_ci
57686862fbSopenharmony_ci  external_deps = [
58686862fbSopenharmony_ci    "ability_base:base",
59686862fbSopenharmony_ci    "ability_base:want",
60686862fbSopenharmony_ci    "ability_base:zuri",
61686862fbSopenharmony_ci    "ability_runtime:ability_manager",
62686862fbSopenharmony_ci    "ability_runtime:app_manager",
63686862fbSopenharmony_ci    "ability_runtime:dataobs_manager",
64686862fbSopenharmony_ci    "ability_runtime:mission_info",
65686862fbSopenharmony_ci    "access_token:libaccesstoken_sdk",
66686862fbSopenharmony_ci    "access_token:libnativetoken_shared",
67686862fbSopenharmony_ci    "access_token:libtokensetproc_shared",
68686862fbSopenharmony_ci    "bundle_framework:appexecfwk_base",
69686862fbSopenharmony_ci    "bundle_framework:appexecfwk_core",
70686862fbSopenharmony_ci    "cJSON:cjson",
71686862fbSopenharmony_ci    "c_utils:utils",
72686862fbSopenharmony_ci    "data_share:datashare_consumer",
73686862fbSopenharmony_ci    "device_auth:deviceauth_sdk",
74686862fbSopenharmony_ci    "device_info_manager:distributed_device_profile_common",
75686862fbSopenharmony_ci    "device_info_manager:distributed_device_profile_sdk",
76686862fbSopenharmony_ci    "device_manager:devicemanagersdk",
77686862fbSopenharmony_ci    "device_security_level:dslm_sdk",
78686862fbSopenharmony_ci    "distributed_bundle_framework:dbms_fwk",
79686862fbSopenharmony_ci    "dsoftbus:softbus_client",
80686862fbSopenharmony_ci    "eventhandler:libeventhandler",
81686862fbSopenharmony_ci    "hilog:libhilog",
82686862fbSopenharmony_ci    "hisysevent:libhisysevent",
83686862fbSopenharmony_ci    "hitrace:hitrace_meter",
84686862fbSopenharmony_ci    "hitrace:libhitracechain",
85686862fbSopenharmony_ci    "init:libbegetutil",
86686862fbSopenharmony_ci    "ipc:ipc_core",
87686862fbSopenharmony_ci    "kv_store:distributeddata_inner",
88686862fbSopenharmony_ci    "safwk:system_ability_fwk",
89686862fbSopenharmony_ci    "samgr:samgr_proxy",
90686862fbSopenharmony_ci  ]
91686862fbSopenharmony_ci}
92686862fbSopenharmony_ci
93686862fbSopenharmony_cigroup("fuzztest") {
94686862fbSopenharmony_ci  testonly = true
95686862fbSopenharmony_ci  deps = [ ":BundleManagerCallBackStubFuzzTest" ]
96686862fbSopenharmony_ci}
97