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 import("//drivers/peripheral/audio/audio.gni") 17} else { 18 import("//build/test.gni") 19 import("//drivers/adapter/uhdf2/uhdf.gni") 20 import("//drivers/peripheral/audio/audio.gni") 21} 22 23if (defined(ohos_lite)) { 24 ###########################LITEOS########################### 25 ###########################hdf_audio_lib_capture_test########################### 26 unittest("hdf_audio_lib_capture_test") { 27 sources = [ "//drivers/peripheral/audio/test/unittest/lib/interface_lib_capture/src/audio_interface_lib_capture_test.cpp" ] 28 29 include_dirs = [ 30 "//drivers/peripheral/audio/test/unittest/lib/interface_lib_capture/include", 31 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 32 "//drivers/peripheral/audio/interfaces/include", 33 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 34 "//drivers/adapter/uhdf2/include/hdi", 35 "//drivers/adapter/uhdf2/shared/include", 36 "//drivers/framework/include/core", 37 "//drivers/framework/include/utils", 38 "//drivers/framework/include/osal", 39 "//drivers/framework/include", 40 "//third_party/bounds_checking_function/include", 41 "//drivers/framework/utils/include", 42 "//drivers/adapter/uhdf2/osal/include", 43 "//third_party/googletest/googletest/include/gtest", 44 ] 45 46 deps = [ 47 "//drivers/adapter/uhdf2/utils:libhdf_utils", 48 "//third_party/googletest:gmock_main", 49 "//third_party/googletest:gtest_main", 50 ] 51 52 if (!enable_audio_device_mpi) { 53 deps += [ "//drivers/peripheral/audio/supportlibs/adm_adapter:hdi_audio_interface_lib_capture" ] 54 } 55 56 cflags = [ 57 "-Wall", 58 "-Wextra", 59 "-Werror", 60 "-fsigned-char", 61 "-fno-common", 62 "-fno-strict-aliasing", 63 "-std=c++11", 64 ] 65 } 66} else { 67 ###########################unittest########################### 68 module_output_path = "hdf/audio/unittest/lib" 69 70 ###########################hdf_audio_lib_capture_test########################### 71 ohos_unittest("hdf_audio_lib_capture_test") { 72 module_out_path = module_output_path 73 sources = [ "//drivers/peripheral/audio/test/unittest/lib/interface_lib_capture/src/audio_interface_lib_capture_test.cpp" ] 74 75 include_dirs = [ 76 "//drivers/peripheral/audio/test/unittest/lib/interface_lib_capture/include", 77 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 78 "//drivers/peripheral/audio/interfaces/include", 79 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 80 "//third_party/bounds_checking_function/include", 81 "//third_party/googletest/googletest/include/gtest", 82 ] 83 84 deps = [ 85 "//third_party/googletest:gmock_main", 86 "//third_party/googletest:gtest_main", 87 ] 88 external_deps = [ "device_driver_framework:libhdf_utils" ] 89 if (!enable_audio_device_mpi) { 90 deps += [ "//drivers/peripheral/audio/supportlibs/adm_adapter:hdi_audio_interface_lib_capture" ] 91 } 92 93 cflags = [ 94 "-Wall", 95 "-Wextra", 96 "-Werror", 97 "-fsigned-char", 98 "-fno-common", 99 "-fno-strict-aliasing", 100 ] 101 } 102} 103