• 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("AudioInterruptServiceMoreFuzzTest") {
22  module_out_path = "audio_framework/audio_framework_route"
23  fuzz_config_file = "../audiointerruptservicemore_fuzzer"
24
25  include_dirs = [
26    "../../../services/audio_engine/manager/include",
27    "../../../services/audio_policy/client/include",
28    "../../../services/audio_policy/server/include",
29    "../../../services/audio_policy/server/include/service",
30    "../../../services/audio_policy/server/include/service/manager",
31    "../../../services/audio_service/server/include",
32  ]
33
34  cflags = [
35    "-g",
36    "-O0",
37    "-Wno-unused-variable",
38    "-fno-omit-frame-pointer",
39  ]
40
41  cflags_cc = cflags
42  cflags_cc += [ "-fno-access-control" ]
43
44  configs = [ "../../../services/audio_policy:audio_policy_public_config" ]
45
46  sources = [ "audio_interrupt_service_more_fuzzer.cpp" ]
47
48  defines = []
49  if (audio_framework_feature_dtmf_tone) {
50    defines += [ "FEATURE_DTMF_TONE" ]
51  }
52  if (use_libfuzzer || use_clang_coverage) {
53    defines += [ "TEST_COVERAGE" ]
54  }
55
56  deps = [
57    "../../../services/audio_service/idl:audio_framework_interface",
58    "../../../frameworks/native/audioutils:audio_utils",
59    "../../../frameworks/native/hdiadapter_new:hdiadapter_new",
60    "../../../services/audio_engine:audio_engine_manager",
61    "../../../services/audio_policy:audio_policy_client_static",
62    "../../../services/audio_policy:audio_policy_service_static",
63  ]
64
65  external_deps = [
66    "ability_base:want",
67    "ability_runtime:extension_manager",
68    "ability_runtime:wantagent_innerkits",
69    "access_token:libaccesstoken_sdk",
70    "access_token:libnativetoken_shared",
71    "access_token:libtokensetproc_shared",
72    "background_task_mgr:bgtaskmgr_innerkits",
73    "bundle_framework:appexecfwk_base",
74    "bundle_framework:appexecfwk_core",
75    "c_utils:utils",
76    "data_share:datashare_common",
77    "data_share:datashare_consumer",
78    "hdf_core:libhdf_ipc_adapter",
79    "hdf_core:libhdi",
80    "hdf_core:libpub_utils",
81    "hilog:libhilog",
82    "ipc:ipc_single",
83    "kv_store:distributeddata_inner",
84    "media_foundation:media_monitor_client",
85    "media_foundation:media_monitor_common",
86    "os_account:os_account_innerkits",
87    "power_manager:powermgr_client",
88    "relational_store:native_appdatafwk",
89    "safwk:system_ability_fwk",
90    "samgr:samgr_proxy",
91  ]
92  if (accessibility_enable == true) {
93    external_deps += [
94      "accessibility:accessibility_common",
95      "accessibility:accessibilityconfig",
96    ]
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 (audio_framework_feature_support_os_account) {
106    defines += [ "SUPPORT_USER_ACCOUNT" ]
107  }
108
109  if (audio_framework_feature_dtmf_tone) {
110    defines += [ "FEATURE_DTMF_TONE" ]
111  }
112
113  if (audio_framework_config_policy_enable) {
114    defines += [ "USE_CONFIG_POLICY" ]
115    external_deps += [ "config_policy:configpolicy_util" ]
116  }
117
118  if (accessibility_enable == true) {
119    external_deps += [
120      "accessibility:accessibility_common",
121      "accessibility:accessibilityconfig",
122    ]
123  }
124
125  if (appgallery_part_enable == true) {
126    defines += [ "FEATURE_APPGALLERY" ]
127  }
128
129  if (bluetooth_part_enable == true) {
130    deps +=
131        [ "../../../frameworks/native/bluetoothclient:audio_bluetooth_client" ]
132    external_deps += [ "bluetooth:btframework" ]
133  }
134
135  if (audio_framework_feature_input) {
136    defines += [ "FEATURE_MULTIMODALINPUT_INPUT" ]
137    external_deps += [ "input:libmmi-client" ]
138  }
139
140  if (audio_framework_feature_device_manager) {
141    defines += [ "FEATURE_DEVICE_MANAGER" ]
142    external_deps += [ "device_manager:devicemanagersdk" ]
143  }
144}
145
146group("fuzztest") {
147  testonly = true
148  deps = [ ":AudioInterruptServiceMoreFuzzTest" ]
149}
150