1# Copyright (c) 2021 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 14if (defined(ohos_lite)) { 15 import("//build/lite/config/test.gni") 16} else { 17 import("//build/test.gni") 18 import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 19} 20import("//drivers/peripheral/audio/audio.gni") 21 22if (defined(ohos_lite)) { 23 moduletest("hdf_audio_smartpa_test") { 24 sources = [ 25 "../../common/adm_common/src/audio_adm_common.cpp", 26 "../../common/hdi_common/src/audio_hdi_common.cpp", 27 "../../common/lib_common/src/audio_lib_common.cpp", 28 "src/audio_smartpa_test.cpp", 29 ] 30 31 include_dirs = [ 32 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 33 "//drivers/peripheral/audio/supportlibs/interfaces/include", 34 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 35 "//drivers/peripheral/audio/interfaces/include", 36 "//drivers/hdf_core/adapter/uhdf2/include/hdi", 37 "//drivers/hdf_core/adapter/uhdf2/shared/include", 38 "//drivers/hdf_core/framework/include/core", 39 "//drivers/hdf_core/framework/include/utils", 40 "//drivers/hdf_core/framework/include/osal", 41 "//drivers/hdf_core/framework/include", 42 "//third_party/bounds_checking_function/include", 43 "//drivers/hdf_core/framework/utils/include", 44 "//drivers/hdf_core/adapter/uhdf2/osal/include", 45 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 46 "//drivers/peripheral/audio/test/systemtest/audio_function/audio_smartpa/include", 47 "//drivers/peripheral/audio/test/systemtest/common/lib_common/include", 48 "//drivers/peripheral/audio/test/systemtest/common/adm_common/include", 49 "//drivers/peripheral/audio/test/systemtest/adm_interface_lib/render/include", 50 "//drivers/peripheral/audio/test/systemtest/adm/audio_adm_interface/include", 51 "//third_party/googletest/googletest/include/gtest", 52 ] 53 54 deps = [ 55 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 56 "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", 57 "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", 58 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", 59 "//third_party/bounds_checking_function:libsec_shared", 60 ] 61 } 62} else { 63 module_output_path = "drivers_peripheral_audio/audio" 64 65 ohos_systemtest("hdf_audio_smartpa_test") { 66 module_out_path = module_output_path 67 resource_config_file = 68 "//drivers/peripheral/audio/test/resource/ohos_test.xml" 69 sources = [ 70 "../../common/adm_common/src/audio_adm_common.cpp", 71 "../../common/hdi_common/src/audio_hdi_common.cpp", 72 "../../common/lib_common/src/audio_lib_common.cpp", 73 "src/audio_smartpa_test.cpp", 74 ] 75 76 include_dirs = [ 77 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 78 "//drivers/peripheral/audio/supportlibs/interfaces/include", 79 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 80 "//drivers/peripheral/audio/interfaces/include", 81 "//third_party/bounds_checking_function/include", 82 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 83 "//drivers/peripheral/audio/test/systemtest/audio_function/audio_smartpa/include", 84 "//drivers/peripheral/audio/test/systemtest/common/lib_common/include", 85 "//drivers/peripheral/audio/test/systemtest/common/adm_common/include", 86 "//drivers/peripheral/audio/test/systemtest/adm_interface_lib/render/include", 87 "//drivers/peripheral/audio/test/systemtest/adm/audio_adm_interface/include", 88 "//third_party/googletest/googletest/include/gtest", 89 ] 90 91 deps = [ 92 "//third_party/googletest:gmock_main", 93 "//third_party/googletest:gtest_main", 94 ] 95 external_deps = [ 96 "c_utils:utils", 97 "hdf_core:libhdf_host", 98 "hdf_core:libhdf_ipc_adapter", 99 "hdf_core:libhdf_utils", 100 "hdf_core:libhdi", 101 ] 102 defines = [] 103 if (enable_audio_adm_passthrough) { 104 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 105 defines += [ "AUDIO_ADM_SO" ] 106 } 107 if (enable_audio_adm_service) { 108 deps += 109 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 110 defines += [ "AUDIO_ADM_SERVICE" ] 111 } 112 } 113} 114