1# Copyright (c) 2022 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("//base/notification/distributed_notification_service/notification.gni") 16import("//build/config/features.gni") 17import("//build/test.gni") 18 19##############################fuzztest########################################## 20ohos_fuzztest("AnsManagerStubAnnexFuzzTest") { 21 module_out_path = service_fuzz_test_path 22 fuzz_config_file = 23 "${component_path}/test/fuzztest/ansmanagerstubannex_fuzzer" 24 25 include_dirs = [ 26 "${services_path}/ans/include", 27 "${core_path}/include", 28 ] 29 30 cflags = [ 31 "-g", 32 "-O0", 33 "-Wno-unused-variable", 34 "-fno-omit-frame-pointer", 35 ] 36 sources = [ "ansmanagerstubannex_fuzzer.cpp" ] 37 defines = [] 38 deps = [ 39 "${component_path}/test/fuzztest/fuzz_common_base:fuzz_common_base", 40 "${frameworks_module_ans_path}:ans_innerkits", 41 "${services_path}/ans:ans_service_sources", 42 "//third_party/icu/icu4c:shared_icuuc", 43 "//third_party/libxml2:libxml2", 44 ] 45 46 if (distributed_notification_supported) { 47 defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] 48 deps += [ "${services_path}/distributed:libans_distributed" ] 49 include_dirs += [ "${services_path}/distributed/include" ] 50 } 51 52 if (notification_smart_reminder_supported) { 53 defines += [ "NOTIFICATION_SMART_REMINDER_SUPPORTED" ] 54 } 55 56 external_deps = [ 57 "ability_base:configuration", 58 "ability_runtime:ability_manager", 59 "ability_runtime:app_manager", 60 "ability_runtime:appkit_native", 61 "ability_runtime:dataobs_manager", 62 "ability_runtime:extension_manager", 63 "ability_runtime:wantagent_innerkits", 64 "access_token:libaccesstoken_sdk", 65 "access_token:libtokenid_sdk", 66 "bundle_framework:appexecfwk_base", 67 "bundle_framework:appexecfwk_core", 68 "c_utils:utils", 69 "common_event_service:cesfwk_innerkits", 70 "config_policy:configpolicy_util", 71 "data_share:datashare_common", 72 "data_share:datashare_consumer", 73 "data_share:datashare_permission", 74 "device_manager:devicemanagersdk", 75 "ffrt:libffrt", 76 "hilog:libhilog", 77 "i18n:intl_util", 78 "image_framework:image_native", 79 "init:libbegetutil", 80 "kv_store:distributeddata_inner", 81 "openssl:libcrypto_shared", 82 "os_account:os_account_innerkits", 83 "relational_store:native_rdb", 84 "resource_management:global_resmgr", 85 "time_service:time_client", 86 ] 87 external_deps += component_external_deps 88 89 if (device_usage) { 90 external_deps += [ "device_usage_statistics:usagestatsinner" ] 91 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 92 } 93 94 if (hisysevent_usage) { 95 cflags += [ "-DHAS_HISYSEVENT_PART" ] 96 external_deps += [ "hisysevent:libhisysevent" ] 97 } 98 99 if (standby_enable) { 100 external_deps += [ "device_standby:standby_innerkits" ] 101 defines += [ "DEVICE_STANDBY_ENABLE" ] 102 } 103 104 if (player_framework) { 105 external_deps += [ "player_framework:media_client" ] 106 defines += [ "PLAYER_FRAMEWORK_ENABLE" ] 107 } 108 109 if (ans_hitrace_usage) { 110 external_deps += [ "hitrace:hitrace_meter" ] 111 defines += [ "HITRACE_METER_ENABLE" ] 112 } 113 114 if (ans_config_policy_enable) { 115 external_deps += [ "config_policy:configpolicy_util" ] 116 defines += [ "CONFIG_POLICY_ENABLE" ] 117 } 118 119 if (screenlock_mgr_enable) { 120 external_deps += [ "screenlock_mgr:screenlock_client" ] 121 defines += [ "SCREENLOCK_MGR_ENABLE" ] 122 } 123 124 if (distributed_notification_service_feature_summary || 125 distributed_notification_service_feature_additional_control) { 126 defines += [ "ENABLE_ANS_EXT_WRAPPER" ] 127 } 128 129 if (distributed_notification_service_feature_additional_control) { 130 defines += [ "ENABLE_ANS_ADDITIONAL_CONTROL" ] 131 } 132 133 if (distributed_notification_service_feature_summary) { 134 defines += [ "ENABLE_ANS_AGGREGATION" ] 135 } 136 137 if (telephony_cust) { 138 defines += [ "ENABLE_ANS_TELEPHONY_CUST_WRAPPER" ] 139 } 140 141 if (distributed_notification_service_feature_disable_fa_model) { 142 defines += [ "ANS_DISABLE_FA_MODEL" ] 143 } 144} 145 146############################################################################### 147group("fuzztest") { 148 testonly = true 149 deps = [ ":AnsManagerStubAnnexFuzzTest" ] 150} 151############################################################################### 152