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 14hdf_audio_path = "./../../../../.." 15hdf_audio_test_path = "./../../.." 16 17if (defined(ohos_lite)) { 18 import("//build/lite/config/test.gni") 19} else { 20 import("//build/test.gni") 21} 22import("$hdf_audio_path/audio.gni") 23 24if (defined(ohos_lite)) { 25 moduletest("hdf_audio_lib_render_test") { 26 if (defined(enable_liteos_test_bin) && enable_liteos_test_bin == true) { 27 output_extension = "bin" 28 output_dir = "$root_out_dir/test/moduletest/hdf" 29 } 30 31 sources = [ 32 "$hdf_audio_test_path/common/hdi_common/src/audio_hdi_common.cpp", 33 "$hdf_audio_test_path/common/lib_common/src/audio_lib_common.cpp", 34 "src/audio_librender_test.cpp", 35 ] 36 37 include_dirs = [ 38 "$hdf_audio_path/supportlibs/adm_adapter/include", 39 "$hdf_audio_path/supportlibs/interfaces/include", 40 "$hdf_audio_path/hal/hdi_passthrough/include", 41 "$hdf_audio_path/interfaces/include", 42 "//third_party/bounds_checking_function/include", 43 "$hdf_audio_test_path/common/lib_common/include", 44 "$hdf_audio_test_path/common/hdi_common/include", 45 "$hdf_audio_test_path/supportlibs/common/render/include", 46 "//third_party/googletest/googletest/include/gtest", 47 ] 48 49 public_deps = [ 50 "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", 51 "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", 52 "//third_party/bounds_checking_function:libsec_shared", 53 ] 54 } 55} else { 56 module_output_path = "drivers_peripheral_audio/audio" 57 58 ohos_systemtest("hdf_audio_lib_render_test") { 59 module_out_path = module_output_path 60 resource_config_file = "./../../../../resource/ohos_test.xml" 61 sources = [ 62 "$hdf_audio_test_path/common/hdi_common/src/audio_hdi_common.cpp", 63 "$hdf_audio_test_path/common/lib_common/src/audio_lib_common.cpp", 64 ] 65 if (defined(drivers_peripheral_audio_feature_alsa_lib) && 66 drivers_peripheral_audio_feature_alsa_lib == true) { 67 sources += [ "src/audio_alsa_librender_test.cpp" ] 68 } else { 69 sources += [ "src/audio_librender_test.cpp" ] 70 } 71 include_dirs = [ 72 "$hdf_audio_path/supportlibs/adm_adapter/include", 73 "$hdf_audio_path/supportlibs/interfaces/include", 74 "$hdf_audio_path/interfaces/include", 75 "$hdf_audio_path/hal/hdi_passthrough/include", 76 "$hdf_audio_test_path/common/lib_common/include", 77 "$hdf_audio_test_path/common/hdi_common/include", 78 "$hdf_audio_test_path/supportlibs/common/render/include", 79 ] 80 deps = [ 81 "//third_party/bounds_checking_function:libsec_shared", 82 "//third_party/googletest:gmock_main", 83 "//third_party/googletest:gtest_main", 84 ] 85 external_deps = [ 86 "c_utils:utils", 87 "hdf_core:libhdf_utils", 88 ] 89 defines = [] 90 if (enable_audio_adm_passthrough) { 91 defines += [ "AUDIO_ADM_SO" ] 92 } 93 if (enable_audio_adm_service) { 94 defines += [ "AUDIO_ADM_SERVICE" ] 95 } 96 } 97} 98