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/ohos.gni") 16import("//build/test.gni") 17import("../../../accessibility.gni") 18import("../../../config.gni") 19import("../../../sensor.gni") 20 21ohos_fuzztest("AudioEffectEnhanceFuzzTest") { 22 module_out_path = "audio_framework/audio_framework_route" 23 fuzz_config_file = "../audioeffectenhance_fuzzer" 24 25 include_dirs = [ 26 "../../../frameworks/native/audioeffect/include", 27 "../../../services/audio_policy/server/include/service", 28 "../../../services/audio_policy/server/include", 29 ] 30 cflags = [ 31 "-g", 32 "-O0", 33 "-Wno-unused-variable", 34 "-fno-omit-frame-pointer", 35 "-fno-access-control", 36 ] 37 38 if (sensor_enable == true) { 39 cflags += [ "-DSENSOR_ENABLE" ] 40 } 41 configs = [ "../../../services/audio_policy:audio_policy_public_config" ] 42 43 sources = [ "audio_effect_enhance_fuzzer.cpp" ] 44 45 deps = [ 46 "../../../frameworks/native/audioeffect:audio_effect_static", 47 "../../../frameworks/native/bluetoothclient:audio_bluetooth_client", 48 "../../../services/audio_policy:audio_policy_service", 49 ] 50 51 external_deps = [ 52 "ability_base:want", 53 "ability_runtime:extension_manager", 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 "bounds_checking_function:libsec_shared", 60 "bundle_framework:appexecfwk_base", 61 "bundle_framework:appexecfwk_core", 62 "c_utils:utils", 63 "data_share:datashare_common", 64 "data_share:datashare_consumer", 65 "drivers_interface_audio:libeffect_proxy_1.0", 66 "eventhandler:libeventhandler", 67 "hdf_core:libhdf_ipc_adapter", 68 "hdf_core:libhdf_utils", 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 defines = [] 87 if (!audio_framework_feature_new_engine_flag) { 88 external_deps += [ "pulseaudio:pulse" ] 89 defines += [ "SUPPORT_OLD_ENGINE" ] 90 } 91 if (sensor_enable == true) { 92 external_deps += [ "sensor:sensor_interface_native" ] 93 } 94 if (accessibility_enable == true) { 95 external_deps += [ 96 "accessibility:accessibility_common", 97 "accessibility:accessibilityconfig", 98 ] 99 } 100 if (use_libfuzzer || use_clang_coverage) { 101 defines += [ "TEST_COVERAGE" ] 102 } 103} 104 105group("fuzztest") { 106 testonly = true 107 deps = [ ":AudioEffectEnhanceFuzzTest" ] 108} 109