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 "${component_path}/test/fuzztest/fuzz_common_base", 27 "${component_path}/services/ans/include", 28 "${core_path}/common/include", 29 "${core_path}/include", 30 "${inner_api_path}", 31 "${ffrt_path}/interfaces/kits", 32 ] 33 34 cflags = [ 35 "-g", 36 "-O0", 37 "-Wno-unused-variable", 38 "-fno-omit-frame-pointer", 39 ] 40 sources = [ "ansmanagerstubannex_fuzzer.cpp" ] 41 defines = [] 42 deps = [ 43 "${component_path}/test/fuzztest/fuzz_common_base:fuzz_common_base", 44 "${frameworks_module_ans_path}:ans_innerkits", 45 "${services_path}/ans:libans", 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 external_deps = [ 58 "ability_base:want", 59 "ability_base:zuri", 60 "c_utils:utils", 61 "ffrt:libffrt", 62 "hilog:libhilog", 63 "image_framework:image_native", 64 "ipc:ipc_single", 65 "kv_store:distributeddata_inner", 66 "relational_store:native_rdb", 67 ] 68 69 if (device_usage) { 70 external_deps += [ "device_usage_statistics:usagestatsinner" ] 71 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 72 } 73 74 if (hisysevent_usage) { 75 cflags += [ "-DHAS_HISYSEVENT_PART" ] 76 external_deps += [ "hisysevent:libhisysevent" ] 77 } 78 79 if (standby_enable) { 80 external_deps += [ "device_standby:standby_innerkits" ] 81 defines += [ "DEVICE_STANDBY_ENABLE" ] 82 } 83 84 if (player_framework) { 85 external_deps += [ "player_framework:media_client" ] 86 defines += [ "PLAYER_FRAMEWORK_ENABLE" ] 87 } 88 89 if (ans_hitrace_usage) { 90 external_deps += [ "hitrace:hitrace_meter" ] 91 defines += [ "HITRACE_METER_ENABLE" ] 92 } 93 94 if (ans_config_policy_enable) { 95 external_deps += [ "config_policy:configpolicy_util" ] 96 defines += [ "CONFIG_POLICY_ENABLE" ] 97 } 98 99 if (screenlock_mgr_enable) { 100 external_deps += [ "screenlock_mgr:screenlock_client" ] 101 defines += [ "SCREENLOCK_MGR_ENABLE" ] 102 } 103 104 if (distributed_notification_service_feature_summary) { 105 defines += [ "ENABLE_ANS_EXT_WRAPPER" ] 106 } 107 108 if (telephony_cust) { 109 defines += [ "ENABLE_ANS_TELEPHONY_CUST_WRAPPER" ] 110 } 111 112 if (distributed_notification_service_feature_disable_fa_model) { 113 defines += [ "ANS_DISABLE_FA_MODEL" ] 114 } 115} 116 117############################################################################### 118group("fuzztest") { 119 testonly = true 120 deps = [ ":AnsManagerStubAnnexFuzzTest" ] 121} 122############################################################################### 123