• 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  ]
42
43  if (is_double_framework) {
44    cflags += [ "-DCONFIG_DUAL_FRAMEWORK" ]
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:configuration",
59    "ability_runtime:ability_manager",
60    "ability_runtime:app_manager",
61    "ability_runtime:appkit_native",
62    "ability_runtime:dataobs_manager",
63    "ability_runtime:extension_manager",
64    "ability_runtime:wantagent_innerkits",
65    "access_token:libaccesstoken_sdk",
66    "access_token:libtokenid_sdk",
67    "bundle_framework:appexecfwk_base",
68    "bundle_framework:appexecfwk_core",
69    "c_utils:utils",
70    "common_event_service:cesfwk_innerkits",
71    "config_policy:configpolicy_util",
72    "data_share:datashare_common",
73    "data_share:datashare_consumer",
74    "data_share:datashare_permission",
75    "device_manager:devicemanagersdk",
76    "ffrt:libffrt",
77    "hilog:libhilog",
78    "i18n:intl_util",
79    "icu:shared_icuuc",
80    "image_framework:image_native",
81    "init:libbegetutil",
82    "kv_store:distributeddata_inner",
83    "libxml2:libxml2",
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_additional_control) {
128    defines += [ "ENABLE_ANS_EXT_WRAPPER" ]
129  }
130
131  if (distributed_notification_service_feature_additional_control) {
132    defines += [ "ENABLE_ANS_ADDITIONAL_CONTROL" ]
133  }
134
135  if (distributed_notification_service_feature_summary) {
136    defines += [ "ENABLE_ANS_AGGREGATION" ]
137  }
138
139  if (telephony_cust) {
140    defines += [ "ENABLE_ANS_TELEPHONY_CUST_WRAPPER" ]
141  }
142
143  if (distributed_notification_service_feature_disable_fa_model) {
144    defines += [ "ANS_DISABLE_FA_MODEL" ]
145  }
146}
147
148###############################################################################
149group("fuzztest") {
150  testonly = true
151  deps = [ ":AdvancedNotificationServiceFuzzTest" ]
152}
153###############################################################################
154