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