• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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
14import("//build/config/features.gni")
15import("//build/test.gni")
16import("../../../accessibility.gni")
17import("../../../appgallery.gni")
18import("../../../bluetooth_part.gni")
19import("../../../config.gni")
20
21ohos_fuzztest("AudioPolicyMoreFuzzTest") {
22  module_out_path = "audio_framework/audio_framework_route"
23  fuzz_config_file = "../audiopolicymore_fuzzer"
24
25  include_dirs = [
26    "../../../services/audio_policy/client/include",
27    "../../../services/audio_policy/server/include",
28    "../../../../../communication/bluetooth/interfaces/inner_api/include",
29    "../../../interfaces/inner_api/native/audiomanager/include",
30    "../../../frameworks/native/commcon/include",
31    "../../../interfaces/inner_api/native/audiocommon/include",
32    "../../../services/audio_policy/server/src/service/interrupt",
33    "../../../utils/system/safwk/native/include",
34    "../../../../communication/bluetooth/interfaces/inner_api/include",
35  ]
36
37  cflags = [
38    "-g",
39    "-O0",
40    "-fno-omit-frame-pointer",
41  ]
42  configs = [ "../../../services/audio_policy:audio_policy_public_config" ]
43  cflags_cc = cflags
44  cflags_cc += [ "-fno-access-control" ]
45
46  sources = [ "audio_policy_more_fuzzer.cpp" ]
47
48  deps = [
49    "../../../frameworks/native/audioutils:audio_utils",
50    "../../../services/audio_policy:audio_policy_client_static",
51    "../../../services/audio_policy:audio_policy_service_static",
52  ]
53  external_deps = [
54    "ability_base:session_info",
55    "ability_base:want",
56    "ability_base:zuri",
57    "ability_runtime:ability_connect_callback_stub",
58    "ability_runtime:ability_context_native",
59    "ability_runtime:ability_manager",
60    "ability_runtime:app_context",
61    "ability_runtime:dataobs_manager",
62    "ability_runtime:extension_manager",
63    "access_token:libaccesstoken_sdk",
64    "access_token:libnativetoken_shared",
65    "access_token:libprivacy_sdk",
66    "access_token:libtokenid_sdk",
67    "access_token:libtokensetproc_shared",
68    "bounds_checking_function:libsec_shared",
69    "bundle_framework:appexecfwk_base",
70    "bundle_framework:appexecfwk_base",
71    "bundle_framework:appexecfwk_core",
72    "bundle_framework:appexecfwk_core",
73    "c_utils:utils",
74    "c_utils:utils",
75    "data_share:datashare_common",
76    "data_share:datashare_common",
77    "data_share:datashare_consumer",
78    "data_share:datashare_consumer",
79    "drivers_interface_audio:libaudio_proxy_4.0",
80    "eventhandler:libeventhandler",
81    "hdf_core:libhdf_host",
82    "hdf_core:libhdf_ipc_adapter",
83    "hdf_core:libhdf_ipc_adapter",
84    "hdf_core:libhdf_utils",
85    "hdf_core:libhdi",
86    "hdf_core:libhdi",
87    "hdf_core:libpub_utils",
88    "hdf_core:libpub_utils",
89    "hilog:libhilog",
90    "hilog:libhilog",
91    "hisysevent:libhisysevent",
92    "init:libbegetutil",
93    "ipc:ipc_single",
94    "ipc:ipc_single",
95    "kv_store:distributeddata_inner",
96    "kv_store:distributeddata_inner",
97    "media_foundation:media_monitor_client",
98    "media_foundation:media_monitor_common",
99    "os_account:os_account_innerkits",
100    "os_account:os_account_innerkits",
101    "power_manager:power_setting",
102    "power_manager:powermgr_client",
103    "power_manager:powermgr_client",
104    "pulseaudio:pulse",
105    "pulseaudio:pulse",
106    "safwk:system_ability_fwk",
107    "safwk:system_ability_fwk",
108    "samgr:samgr_proxy",
109  ]
110  if (accessibility_enable == true) {
111    external_deps += [
112      "accessibility:accessibility_common",
113      "accessibility:accessibilityconfig",
114    ]
115  }
116
117  defines = []
118  if (audio_framework_feature_wired_audio) {
119    defines += [ "AUDIO_WIRED_DETECT" ]
120  }
121
122  if (build_variant == "user") {
123    defines += [ "AUDIO_BUILD_VARIANT_USER" ]
124  } else if (build_variant == "root") {
125    defines += [ "AUDIO_BUILD_VARIANT_ROOT" ]
126  }
127
128  if (audio_framework_feature_support_os_account) {
129    defines += [ "SUPPORT_USER_ACCOUNT" ]
130  }
131
132  if (audio_framework_feature_dtmf_tone) {
133    defines += [ "FEATURE_DTMF_TONE" ]
134  }
135
136  if (audio_framework_config_policy_enable) {
137    defines += [ "USE_CONFIG_POLICY" ]
138    external_deps += [ "config_policy:configpolicy_util" ]
139  }
140
141  if (appgallery_part_enable == true) {
142    defines += [ "FEATURE_APPGALLERY" ]
143  }
144
145  if (bluetooth_part_enable == true) {
146    deps +=
147        [ "../../../frameworks/native/bluetoothclient:audio_bluetooth_client" ]
148    external_deps += [ "bluetooth:btframework" ]
149  }
150
151  if (audio_framework_feature_input) {
152    defines += [ "FEATURE_MULTIMODALINPUT_INPUT" ]
153    external_deps += [ "input:libmmi-client" ]
154  }
155
156  if (audio_framework_feature_device_manager) {
157    defines += [ "FEATURE_DEVICE_MANAGER" ]
158    external_deps += [ "device_manager:devicemanagersdk" ]
159  }
160
161  if (use_libfuzzer || use_clang_coverage) {
162    defines += [ "TEST_COVERAGE" ]
163  }
164}
165
166group("fuzztest") {
167  testonly = true
168  deps = [ ":AudioPolicyMoreFuzzTest" ]
169}
170