• 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("../../../av_session.gni")
19import("../../../bluetooth_part.gni")
20import("../../../config.gni")
21
22ohos_fuzztest("AudioPolicyServiceSpatializationFuzzTest") {
23  module_out_path = "audio_framework/audio_framework_route"
24  fuzz_config_file = "../audiopolicyservicespatialization_fuzzer"
25
26  include_dirs = [
27    "../../../services/audio_policy/server/include",
28    "../../../services/audio_policy/server/include/service",
29    "../../../services/audio_policy/server/include/service/spatialization",
30    "../../../../../communication/bluetooth/interfaces/inner_api/include",
31  ]
32  cflags = [
33    "-g",
34    "-O0",
35    "-Wno-unused-variable",
36    "-fno-omit-frame-pointer",
37  ]
38
39  cflags_cc = cflags
40  cflags_cc += [ "-fno-access-control" ]
41
42  configs = [ "../../../services/audio_policy:audio_policy_public_config" ]
43
44  defines = []
45  if (audio_framework_feature_dtmf_tone) {
46    defines += [ "FEATURE_DTMF_TONE" ]
47  }
48
49  sources = [ "audio_policy_service_spatialization_fuzzer.cpp" ]
50
51  deps = [
52    "../../../services/audio_policy:audio_policy_service_static",
53    "../../../services/audio_service:audio_client",
54  ]
55
56  external_deps = [
57    "ability_base:want",
58    "ability_runtime:extension_manager",
59    "access_token:libaccesstoken_sdk",
60    "access_token:libnativetoken_shared",
61    "access_token:libtokensetproc_shared",
62    "bundle_framework:appexecfwk_base",
63    "bundle_framework:appexecfwk_core",
64    "c_utils:utils",
65    "data_share:datashare_common",
66    "data_share:datashare_consumer",
67    "hdf_core:libhdf_ipc_adapter",
68    "hdf_core:libhdi",
69    "hdf_core:libpub_utils",
70    "hilog:libhilog",
71    "ipc:ipc_single",
72    "kv_store:distributeddata_inner",
73    "media_foundation:media_monitor_client",
74    "media_foundation:media_monitor_common",
75    "os_account:os_account_innerkits",
76    "power_manager:powermgr_client",
77    "pulseaudio:pulse",
78    "relational_store:native_appdatafwk",
79    "safwk:system_ability_fwk",
80    "samgr:samgr_proxy",
81  ]
82  if (accessibility_enable == true) {
83    external_deps += [
84      "accessibility:accessibility_common",
85      "accessibility:accessibilityconfig",
86    ]
87  }
88
89  defines = []
90
91  if (audio_framework_feature_dtmf_tone) {
92    defines += [ "FEATURE_DTMF_TONE" ]
93  }
94
95  if (audio_framework_feature_support_os_account) {
96    defines += [ "SUPPORT_USER_ACCOUNT" ]
97  }
98
99  if (build_variant == "user") {
100    defines += [ "AUDIO_BUILD_VARIANT_USER" ]
101  } else if (build_variant == "root") {
102    defines += [ "AUDIO_BUILD_VARIANT_ROOT" ]
103  }
104
105  if (appgallery_part_enable == true) {
106    defines += [ "FEATURE_APPGALLERY" ]
107  }
108
109  if (bluetooth_part_enable == true) {
110    external_deps += [ "bluetooth:btframework" ]
111  }
112
113  if (audio_framework_feature_input) {
114    defines += [ "FEATURE_MULTIMODALINPUT_INPUT" ]
115    external_deps += [ "input:libmmi-client" ]
116  }
117
118  if (audio_framework_feature_device_manager) {
119    defines += [ "FEATURE_DEVICE_MANAGER" ]
120    external_deps += [ "device_manager:devicemanagersdk" ]
121  }
122
123  if (use_libfuzzer || use_clang_coverage) {
124    defines += [ "TEST_COVERAGE" ]
125  }
126}
127
128group("fuzztest") {
129  testonly = true
130  deps = [ ":AudioPolicyServiceSpatializationFuzzTest" ]
131}
132