1# Copyright (c) 2024-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/ohos.gni") 15import("//build/test.gni") 16import("../../../../accessibility.gni") 17import("../../../../appgallery.gni") 18import("../../../../bluetooth_part.gni") 19import("../../../../config.gni") 20 21module_output_path = 22 "audio_framework/audio_framework_policy/service/audio_policy" 23 24ohos_unittest("audio_zone_client_unit_test") { 25 module_out_path = module_output_path 26 27 include_dirs = [ 28 "./test/audio_zone_client_unit_test/include", 29 "../stub/include", 30 "../../../audio_policy/server/include", 31 "../../../audio_policy/server/domain/zone/include", 32 "../../../audio_policy/server/src", 33 "../../../audio_policy/server/src/interface", 34 "../../../audio_policy/server/infra/async_action_handler/include", 35 "../../../audio_policy/server/domain/interrupt/include", 36 "../../../audio_policy/server/src/service/service", 37 "../../../audio_policy/client/include", 38 "../../../audio_policy/client/src", 39 "../../../audio_policy/client/proxy", 40 "../../../audio_policy/common/include", 41 "../../../../frameworks/native/audiopolicy/include", 42 ] 43 44 cflags = [ 45 "-Wall", 46 "-Werror", 47 "-Wno-macro-redefined", 48 ] 49 50 cflags_cc = cflags 51 cflags_cc += [ "-fno-access-control" ] 52 53 sanitize = { 54 cfi = true 55 cfi_cross_dso = true 56 boundary_sanitize = true 57 debug = false 58 integer_overflow = true 59 ubsan = true 60 } 61 62 external_deps = [ 63 "ability_base:session_info", 64 "ability_base:want", 65 "ability_base:zuri", 66 "ability_runtime:ability_connect_callback_stub", 67 "ability_runtime:ability_context_native", 68 "ability_runtime:app_context", 69 "ability_runtime:dataobs_manager", 70 "ability_runtime:extension_manager", 71 "access_token:libaccesstoken_sdk", 72 "access_token:libnativetoken_shared", 73 "access_token:libprivacy_sdk", 74 "access_token:libtokenid_sdk", 75 "access_token:libtokensetproc_shared", 76 "bounds_checking_function:libsec_shared", 77 "bundle_framework:appexecfwk_base", 78 "bundle_framework:appexecfwk_core", 79 "c_utils:utils", 80 "data_share:datashare_common", 81 "data_share:datashare_consumer", 82 "drivers_interface_audio:libaudio_proxy_5.0", 83 "eventhandler:libeventhandler", 84 "hdf_core:libhdf_host", 85 "hdf_core:libhdf_ipc_adapter", 86 "hdf_core:libhdf_utils", 87 "hdf_core:libhdi", 88 "hdf_core:libpub_utils", 89 "hilog:libhilog", 90 "hisysevent:libhisysevent", 91 "init:libbegetutil", 92 "ipc:ipc_single", 93 "kv_store:distributeddata_inner", 94 "media_foundation:media_monitor_client", 95 "media_foundation:media_monitor_common", 96 "os_account:os_account_innerkits", 97 "power_manager:power_setting", 98 "power_manager:powermgr_client", 99 "pulseaudio:pulse", 100 "safwk:system_ability_fwk", 101 "samgr:samgr_proxy", 102 "accessibility:accessibility_common", 103 "accessibility:accessibilityconfig", 104 "ability_runtime:wantagent_innerkits", 105 ] 106 107 sources = [ 108 "./test/audio_zone_client_unit_test/src/audio_zone_client_unit_test.cpp", 109 "../stub/src/audio_zone_client.cpp", 110 "../../../audio_policy/server/domain/zone/src/audio_zone_service.cpp", 111 "../service/src/audio_policy_manager.cpp", 112 "../service/src/audio_policy_manager_zone.cpp", 113 "./src/audio_policy_client_stub_impl.cpp", 114 ] 115 116 deps = [ 117 "../../../../services/audio_service/idl:audio_framework_interface", 118 "../../../audio_policy:audio_policy_service_static", 119 ] 120 121 configs = [ 122 "../../../../services/audio_policy:audio_policy_public_config", 123 "../../../../services/audio_policy:audio_policy_client_config", 124 ] 125 126 if (bluetooth_part_enable == true) { 127 deps += 128 [ "../../../../frameworks/native/bluetoothclient:audio_bluetooth_client" ] 129 external_deps += [ "bluetooth:btframework" ] 130 } 131}