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("AnsManagerStubFuzzTest") { 21 module_out_path = service_fuzz_test_path 22 fuzz_config_file = "${component_path}/test/fuzztest/ansmanagerstub_fuzzer" 23 24 include_dirs = [ 25 "${component_path}/test/fuzztest/fuzz_common_base", 26 "${component_path}/services/ans/include", 27 "${core_path}/common/include", 28 "${core_path}/include", 29 "${inner_api_path}", 30 "${ffrt_path}/interfaces/kits", 31 ] 32 defines = [] 33 cflags = [ 34 "-g", 35 "-O0", 36 "-Wno-unused-variable", 37 "-fno-omit-frame-pointer", 38 ] 39 sources = [ "ansmanagerstub_fuzzer.cpp" ] 40 41 deps = [ 42 "${component_path}/test/fuzztest/fuzz_common_base:fuzz_common_base", 43 "${frameworks_module_ans_path}:ans_innerkits", 44 "${services_path}/ans:libans", 45 ] 46 47 if (distributed_notification_supported) { 48 defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] 49 deps += [ "${services_path}/distributed:libans_distributed" ] 50 include_dirs += [ "${services_path}/distributed/include" ] 51 } 52 53 if (notification_smart_reminder_supported) { 54 defines += [ "NOTIFICATION_SMART_REMINDER_SUPPORTED" ] 55 } 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 = [ ":AnsManagerStubFuzzTest" ] 121} 122############################################################################### 123