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