1# Copyright (c) 2022-2023 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/ohos_var.gni") 16import("//build/test.gni") 17import("../../../../../distributedaudio.gni") 18 19module_out_path = "distributed_audio/services/audiomanager/service_source_test" 20 21config("module_private_config") { 22 visibility = [ ":*" ] 23 24 include_dirs = [ 25 "${audio_control_path}/controlsource/include", 26 "${audio_hdi_proxy_path}/include", 27 "${audio_processor_path}/interface", 28 "${audio_transport_path}/interface", 29 "${audio_transport_path}/receiverengine/include", 30 "${audio_transport_path}/senderengine/include", 31 "${common_path}/include", 32 "${common_path}/dfx_utils/include", 33 "${distributedaudio_path}/audiohandler/include", 34 "${innerkits_path}/native_cpp/audio_sink/include", 35 "${innerkits_path}/native_cpp/audio_source/include", 36 "${interfaces_path}/inner_kits/native_cpp/audio_sink/include", 37 "${interfaces_path}/inner_kits/native_cpp/audio_source/include", 38 "${services_path}/audiomanager/managersink/include", 39 "${services_path}/audiomanager/managersource/include", 40 "${services_path}/audiomanager/servicesink/include", 41 "${services_path}/audiomanager/servicesource/include", 42 "${services_path}/audiomanager/test/unittest/managersink/include", 43 "${services_path}/audiomanager/test/unittest/servicesink/include", 44 "${services_path}/audiomanager/test/unittest/servicesource/include", 45 "${services_path}/common/audiodata/include", 46 "${services_path}/common/audioeventcallback", 47 "${services_path}/common/audioparam", 48 ] 49} 50 51## UnitTest daudio_source_service_test 52ohos_unittest("DaudioSourceServiceTest") { 53 module_out_path = module_out_path 54 55 sources = [ "${services_path}/audiomanager/test/unittest/servicesource/src/daudio_source_service_test.cpp" ] 56 57 configs = [ ":module_private_config" ] 58 59 deps = 60 [ "${services_path}/audiomanager/servicesource:distributed_audio_source" ] 61 62 external_deps = [ 63 "audio_framework:audio_capturer", 64 "audio_framework:audio_client", 65 "audio_framework:audio_renderer", 66 "cJSON:cjson", 67 "c_utils:utils", 68 "distributed_hardware_fwk:distributedhardwareutils", 69 "drivers_interface_distributed_audio:libdaudio_proxy_1.0", 70 "dsoftbus:softbus_client", 71 "googletest:gmock", 72 "hisysevent:libhisysevent", 73 "hitrace:hitrace_meter", 74 "ipc:ipc_core", 75 "safwk:system_ability_fwk", 76 "samgr:samgr_proxy", 77 ] 78} 79 80## UnitTest daudio_source_stub_test 81ohos_unittest("DaudioSourceStubTest") { 82 module_out_path = module_out_path 83 84 cflags = [ 85 "-g", 86 "-O0", 87 "-Wno-unused-variable", 88 "-fno-omit-frame-pointer", 89 "-Dprivate=public", 90 "-Dprotected=public", 91 ] 92 93 sources = [ "${services_path}/audiomanager/test/unittest/servicesource/src/daudio_source_stub_test.cpp" ] 94 95 configs = [ ":module_private_config" ] 96 97 deps = 98 [ "${services_path}/audiomanager/servicesource:distributed_audio_source" ] 99 100 external_deps = [ 101 "access_token:libaccesstoken_sdk", 102 "access_token:libtokenid_sdk", 103 "audio_framework:audio_capturer", 104 "audio_framework:audio_client", 105 "audio_framework:audio_renderer", 106 "cJSON:cjson", 107 "c_utils:utils", 108 "distributed_hardware_fwk:distributedhardwareutils", 109 "drivers_interface_distributed_audio:libdaudio_proxy_1.0", 110 "dsoftbus:softbus_client", 111 "googletest:gmock", 112 "hisysevent:libhisysevent", 113 "hitrace:hitrace_meter", 114 "ipc:ipc_core", 115 "safwk:system_ability_fwk", 116 "samgr:samgr_proxy", 117 ] 118} 119 120group("service_source_test") { 121 testonly = true 122 deps = [ 123 ":DaudioSourceServiceTest", 124 ":DaudioSourceStubTest", 125 ] 126} 127