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 = "./../../../.." 15 16if (defined(ohos_lite)) { 17 import("//build/lite/config/test.gni") 18 import("$hdf_audio_path/audio.gni") 19} else { 20 import("//build/test.gni") 21 22 import("$hdf_audio_path/audio.gni") 23} 24 25if (defined(ohos_lite)) { 26 ###########################LITEOS########################### 27 ###########################hdf_audio_lib_capture_test########################### 28 unittest("hdf_audio_lib_capture_test") { 29 sources = [ "./src/audio_adm_if_lib_capture_test.cpp" ] 30 31 include_dirs = [ 32 "$hdf_audio_path/hal/hdi_passthrough/include", 33 "$hdf_audio_path/interfaces/include", 34 "$hdf_audio_path/supportlibs/adm_adapter/include", 35 "$hdf_audio_path/supportlibs/interfaces/include", 36 "//third_party/bounds_checking_function/include", 37 "//third_party/googletest/googletest/include/gtest", 38 ] 39 40 public_deps = [ 41 "$hdf_audio_path/hdi_service/supportlibs:audio_capture_adapter", 42 "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", 43 "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", 44 "//third_party/googletest:gmock_main", 45 "//third_party/googletest:gtest_main", 46 ] 47 } 48} else { 49 ###########################unittest########################### 50 module_output_path = "hdf/audio" 51 52 ###########################hdf_audio_lib_capture_test########################### 53 ohos_unittest("hdf_audio_lib_capture_test") { 54 module_out_path = module_output_path 55 sources = [] 56 include_dirs = [] 57 if (drivers_peripheral_audio_feature_alsa_lib) { 58 sources += [ "./src/audio_alsa_if_lib_capture_test.cpp" ] 59 include_dirs += [ 60 "$hdf_audio_path/supportlibs/alsa_adapter/include", 61 "//third_party/alsa-lib/include", 62 ] 63 } else { 64 sources += [ "./src/audio_adm_if_lib_capture_test.cpp" ] 65 include_dirs += [ "$hdf_audio_path/supportlibs/adm_adapter/include" ] 66 } 67 68 include_dirs += [ 69 "$hdf_audio_path/hal/hdi_passthrough/include", 70 "$hdf_audio_path/interfaces/include", 71 "$hdf_audio_path/supportlibs/interfaces/include", 72 "//third_party/bounds_checking_function/include", 73 "//third_party/googletest/googletest/include/gtest", 74 ] 75 76 deps = [ 77 "$hdf_audio_path/hdi_service/supportlibs:audio_capture_adapter", 78 "//third_party/googletest:gmock_main", 79 "//third_party/googletest:gtest_main", 80 ] 81 82 if (is_standard_system) { 83 external_deps = [ 84 "c_utils:utils", 85 "hdf_core:libhdf_utils", 86 "hilog:libhilog", 87 ] 88 } 89 } 90} 91