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