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("../../../config.gni")
18
19ohos_fuzztest("AudioInterruptServiceFuzzTest") {
20  module_out_path = "audio_framework/audio_framework_route"
21  fuzz_config_file = "../audiointerruptservice_fuzzer"
22  pulseaudio_build_path = "//third_party/pulseaudio/ohosbuild"
23
24  include_dirs = [
25    "../../../services/audio_policy/server/include",
26    "../../../../../communication/bluetooth/interfaces/inner_api/include",
27    "../../../interfaces/inner_api/native/audiomanager/include",
28    "../../../frameworks/native/commcon/include",
29    "../../../interfaces/inner_api/native/audiocommon/include",
30    "../../../services/audio_policy/server/src/service/interrupt",
31    "../../../utils/system/safwk/native/include",
32    "../../../../communication/bluetooth/interfaces/inner_api/include",
33    "$pulseaudio_build_path/include",
34    "//third_party/pulseaudio/src",
35    "//third_party/pulseaudio/confgure/src",
36    "//third_party/pulseaudio/include",
37  ]
38
39  cflags = [
40    "-g",
41    "-O0",
42    "-fno-omit-frame-pointer",
43  ]
44
45  sources = [ "audio_interrupt_service_fuzzer.cpp" ]
46
47  deps = [ "../../../services/audio_policy:audio_policy_service" ]
48  external_deps = [
49    "ability_base:want",
50    "access_token:libaccesstoken_sdk",
51    "access_token:libtokensetproc_shared",
52    "bundle_framework:appexecfwk_base",
53    "bundle_framework:appexecfwk_core",
54    "c_utils:utils",
55    "data_share:datashare_common",
56    "data_share:datashare_consumer",
57    "hdf_core:libhdf_ipc_adapter",
58    "hdf_core:libhdi",
59    "hdf_core:libpub_utils",
60    "hilog:libhilog",
61    "ipc:ipc_single",
62    "kv_store:distributeddata_inner",
63    "os_account:os_account_innerkits",
64    "power_manager:powermgr_client",
65    "safwk:system_ability_fwk",
66  ]
67  if (accessibility_enable == true) {
68    external_deps += [
69      "accessibility:accessibility_common",
70      "accessibility:accessibilityconfig",
71    ]
72  }
73}
74
75group("fuzztest") {
76  testonly = true
77  deps = [ ":AudioInterruptServiceFuzzTest" ]
78}
79