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("AdvancedNotificationServiceFuzzTest") { 21 module_out_path = service_fuzz_test_path 22 fuzz_config_file = 23 "${component_path}/test/fuzztest/advancednotificationservice_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 cflags = [ 34 "-g", 35 "-O0", 36 "-Wno-unused-variable", 37 "-fno-omit-frame-pointer", 38 ] 39 sources = [ "advancednotificationservice_fuzzer.cpp" ] 40 defines = [] 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 "bundle_framework:appexecfwk_base", 61 "bundle_framework:appexecfwk_core", 62 "c_utils:utils", 63 "ffrt:libffrt", 64 "hilog:libhilog", 65 "image_framework:image_native", 66 "ipc:ipc_single", 67 "kv_store:distributeddata_inner", 68 "relational_store:native_rdb", 69 ] 70 71 if (device_usage) { 72 external_deps += [ "device_usage_statistics:usagestatsinner" ] 73 defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ] 74 } 75 76 if (hisysevent_usage) { 77 cflags += [ "-DHAS_HISYSEVENT_PART" ] 78 external_deps += [ "hisysevent:libhisysevent" ] 79 } 80 81 if (standby_enable) { 82 external_deps += [ "device_standby:standby_innerkits" ] 83 defines += [ "DEVICE_STANDBY_ENABLE" ] 84 } 85 86 if (player_framework) { 87 external_deps += [ "player_framework:media_client" ] 88 defines += [ "PLAYER_FRAMEWORK_ENABLE" ] 89 } 90 91 if (ans_hitrace_usage) { 92 external_deps += [ "hitrace:hitrace_meter" ] 93 defines += [ "HITRACE_METER_ENABLE" ] 94 } 95 96 if (ans_config_policy_enable) { 97 external_deps += [ "config_policy:configpolicy_util" ] 98 defines += [ "CONFIG_POLICY_ENABLE" ] 99 } 100 101 if (screenlock_mgr_enable) { 102 external_deps += [ "screenlock_mgr:screenlock_client" ] 103 defines += [ "SCREENLOCK_MGR_ENABLE" ] 104 } 105 106 if (distributed_notification_service_feature_summary) { 107 defines += [ "ENABLE_ANS_EXT_WRAPPER" ] 108 } 109 110 if (telephony_cust) { 111 defines += [ "ENABLE_ANS_TELEPHONY_CUST_WRAPPER" ] 112 } 113 114 if (distributed_notification_service_feature_disable_fa_model) { 115 defines += [ "ANS_DISABLE_FA_MODEL" ] 116 } 117} 118 119############################################################################### 120group("fuzztest") { 121 testonly = true 122 deps = [ ":AdvancedNotificationServiceFuzzTest" ] 123} 124############################################################################### 125