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 include_dirs = [ 24 "${component_path}/test/fuzztest/fuzz_common_base", 25 "${services_path}/ans/include", 26 "${core_path}/include" 27 ] 28 cflags = [ 29 "-g", 30 "-O0", 31 "-Wno-unused-variable", 32 "-fno-omit-frame-pointer", 33 ] 34 sources = [ "ansmanagerstub_fuzzer.cpp" ] 35 36 deps = [ 37 "${component_path}/test/fuzztest/fuzz_common_base:fuzz_common_base", 38 "${frameworks_module_ans_path}:ans_innerkits", 39 "${services_path}/ans:ans_service_sources", 40 ] 41 42 external_deps = [ 43 "ability_base:want", 44 "ability_base:zuri", 45 "c_utils:utils", 46 "ffrt:libffrt", 47 "hilog:libhilog", 48 "kv_store:distributeddata_inner", 49 "image_framework:image_native", 50 "ipc:ipc_single", 51 "relational_store:native_rdb", 52 ] 53 54 defines = [] 55 56 if (is_double_framework) { 57 cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ] 58 } 59 60 if (distributed_notification_supported) { 61 defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ] 62 deps += [ "${services_path}/distributed:libans_distributed" ] 63 include_dirs += [ "${services_path}/distributed/include" ] 64 } 65 66 if (notification_smart_reminder_supported) { 67 defines += [ "NOTIFICATION_SMART_REMINDER_SUPPORTED" ] 68 } 69 70 if (player_framework) { 71 external_deps += [ "player_framework:media_client" ] 72 defines += [ "PLAYER_FRAMEWORK_ENABLE" ] 73 } 74 75 if (ans_hitrace_usage) { 76 external_deps += [ "hitrace:hitrace_meter" ] 77 defines += [ "HITRACE_METER_ENABLE" ] 78 } 79 80 if (ans_config_policy_enable) { 81 external_deps += [ "config_policy:configpolicy_util" ] 82 defines += [ "CONFIG_POLICY_ENABLE" ] 83 } 84 85 if (screenlock_mgr_enable) { 86 external_deps += [ "screenlock_mgr:screenlock_client" ] 87 defines += [ "SCREENLOCK_MGR_ENABLE" ] 88 } 89 90 if (distributed_notification_service_feature_additional_control) { 91 defines += [ "ENABLE_ANS_EXT_WRAPPER" ] 92 } 93 94 if (distributed_notification_service_feature_additional_control) { 95 defines += [ "ENABLE_ANS_ADDITIONAL_CONTROL" ] 96 } 97 98 if (distributed_notification_service_feature_summary) { 99 defines += [ "ENABLE_ANS_AGGREGATION" ] 100 } 101 102 if (telephony_cust) { 103 defines += [ "ENABLE_ANS_TELEPHONY_CUST_WRAPPER" ] 104 } 105 106 if (distributed_notification_service_feature_disable_fa_model) { 107 defines += [ "ANS_DISABLE_FA_MODEL" ] 108 } 109} 110 111############################################################################### 112group("fuzztest") { 113 testonly = true 114 deps = [ ":AnsManagerStubFuzzTest" ] 115} 116############################################################################### 117