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