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_hardwaredependence_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_hardwaredependence_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/hardwaredependence/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_hardwaredependence_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 "src/audio_librender_hardwaredependence_test.cpp", 65 ] 66 67 include_dirs = [ 68 "$hdf_audio_path/supportlibs/adm_adapter/include", 69 "$hdf_audio_path/supportlibs/interfaces/include", 70 "$hdf_audio_path/interfaces/include", 71 "$hdf_audio_path/hal/hdi_passthrough/include", 72 "$hdf_audio_test_path/common/lib_common/include", 73 "$hdf_audio_test_path/common/hdi_common/include", 74 "$hdf_audio_test_path/supportlibs/hardwaredependence/render/include", 75 "//third_party/googletest/googletest/include/gtest", 76 ] 77 78 deps = [ 79 "//third_party/googletest:gmock_main", 80 "//third_party/googletest:gtest_main", 81 ] 82 external_deps = [ "hdf_core:libhdf_utils" ] 83 if (enable_c_utils) { 84 external_deps += [ "c_utils:utils" ] 85 } 86 external_deps += [ "bounds_checking_function:libsec_shared" ] 87 defines = [] 88 if (enable_audio_adm_passthrough) { 89 defines += [ "AUDIO_ADM_SO" ] 90 } 91 if (enable_audio_adm_service) { 92 defines += [ "AUDIO_ADM_SERVICE" ] 93 } 94 } 95} 96