1# Copyright (c) 2025 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("CapturerManagerFuzzTest") { 20 module_out_path = "audio_framework/audio_framework_route" 21 fuzz_config_file = "../capturermanager_fuzzer" 22 23 include_dirs = [ 24 "../../../services/audio_policy/server/include/service", 25 "../../../services/audio_policy/server/include", 26 "../../../services/audio_service/common/include/limiter/", 27 "../../../services/audio_engine/manager/include", 28 "../../../services/audio_service/server/include", 29 ] 30 31 cflags = [ 32 "-g", 33 "-O0", 34 "-Wno-unused-variable", 35 "-fno-omit-frame-pointer", 36 "-fno-access-control", 37 ] 38 39 configs = [ 40 "../../../services/audio_policy:audio_policy_public_config", 41 "../../../services/audio_engine:audio_engine_node_config", 42 ] 43 44 sources = [ 45 "../../../services/audio_engine/node/src/hpae_source_process_cluster.cpp", 46 "hpae_capturer_manager_fuzzer.cpp", 47 ] 48 49 deps = [ 50 "../../../frameworks/native/audioutils:audio_utils", 51 "../../../frameworks/native/bluetoothclient:audio_bluetooth_client", 52 "../../../services/audio_policy:audio_policy_service_static", 53 "../../../services/audio_service:audio_common", 54 "../../../frameworks/native/audioclock:audio_clock", 55 "../../../services/audio_engine:audio_engine_manager", 56 "../../../services/audio_engine:audio_engine_node", 57 "../../../services/audio_engine:audio_engine_utils", 58 ] 59 60 external_deps = [ 61 "ability_base:want", 62 "ability_runtime:extension_manager", 63 "ability_runtime:wantagent_innerkits", 64 "access_token:libaccesstoken_sdk", 65 "access_token:libnativetoken_shared", 66 "access_token:libprivacy_sdk", 67 "access_token:libtokenid_sdk", 68 "access_token:libtokensetproc_shared", 69 "background_task_mgr:bgtaskmgr_innerkits", 70 "bounds_checking_function:libsec_shared", 71 "bundle_framework:appexecfwk_base", 72 "bundle_framework:appexecfwk_core", 73 "c_utils:utils", 74 "data_share:datashare_common", 75 "data_share:datashare_consumer", 76 "eventhandler:libeventhandler", 77 "hdf_core:libhdf_ipc_adapter", 78 "hdf_core:libhdi", 79 "hdf_core:libpub_utils", 80 "hicollie:libhicollie", 81 "hilog:libhilog", 82 "hisysevent:libhisysevent", 83 "hitrace:hitrace_meter", 84 "init:libbegetutil", 85 "ipc:ipc_single", 86 "kv_store:distributeddata_inner", 87 "media_foundation:media_monitor_client", 88 "media_foundation:media_monitor_common", 89 "os_account:os_account_innerkits", 90 "power_manager:powermgr_client", 91 "relational_store:native_appdatafwk", 92 "safwk:system_ability_fwk", 93 "samgr:samgr_proxy", 94 "bluetooth:btframework" 95 ] 96 if (sonic_enable == true) { 97 external_deps += [ "pulseaudio:sonic" ] 98 } 99 if (accessibility_enable == true) { 100 external_deps += [ 101 "accessibility:accessibility_common", 102 "accessibility:accessibilityconfig", 103 ] 104 } 105 106 defines = [] 107 if (use_libfuzzer || use_clang_coverage) { 108 defines += [ "TEST_COVERAGE" ] 109 } 110 if (audio_framework_feature_dtmf_tone) { 111 defines += [ "FEATURE_DTMF_TONE" ] 112 } 113 if (audio_framework_feature_input) { 114 defines += [ "FEATURE_MULTIMODALINPUT_INPUT" ] 115 } 116} 117 118group("fuzztest") { 119 testonly = true 120 deps = [ ":CapturerManagerFuzzTest" ] 121} 122