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_hdi_capture_test########################### 26 unittest("hdf_audio_hdi_capture_test") { 27 sources = [ 28 "//drivers/peripheral/audio/test/unittest/hdi/capture/src/audio_capture_test.cpp", 29 "//drivers/peripheral/audio/test/unittest/hdi/common/src/audio_common_test.cpp", 30 ] 31 32 include_dirs = [ 33 "//drivers/peripheral/audio/test/unittest/hdi/adapter/include", 34 "//drivers/peripheral/audio/test/unittest/hdi/common/include", 35 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 36 "//drivers/peripheral/audio/interfaces/include", 37 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 38 "//drivers/adapter/uhdf2/include/hdi", 39 "//drivers/adapter/uhdf2/shared/include", 40 "//drivers/framework/include/core", 41 "//drivers/framework/include/utils", 42 "//drivers/framework/include/osal", 43 "//drivers/framework/include", 44 "//third_party/bounds_checking_function/include", 45 "//drivers/framework/utils/include", 46 "//drivers/adapter/uhdf2/osal/include", 47 "//third_party/googletest/googletest/include/gtest", 48 ] 49 50 deps = [ 51 "//drivers/adapter/uhdf2/utils:libhdf_utils", 52 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio_common", 53 "//third_party/googletest:gmock_main", 54 "//third_party/googletest:gtest_main", 55 ] 56 57 if (!defined(enable_audio_user_mode) || !enable_audio_user_mode) { 58 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 59 } else { 60 deps += [ "//device/soc/${product_company}/common/hal/media:hdi_audio" ] 61 } 62 63 cflags = [ 64 "-Wall", 65 "-Wextra", 66 "-Werror", 67 "-fsigned-char", 68 "-fno-common", 69 "-fno-strict-aliasing", 70 "-std=c++11", 71 ] 72 } 73} else { 74 ###########################unittest########################### 75 module_output_path = "hdf/audio/unittest/hal" 76 77 ###########################hdf_audio_hdi_capture_test########################### 78 ohos_unittest("hdf_audio_hdi_capture_test") { 79 module_out_path = module_output_path 80 sources = [ 81 "//drivers/peripheral/audio/test/unittest/hdi/capture/src/audio_capture_test.cpp", 82 "//drivers/peripheral/audio/test/unittest/hdi/common/src/audio_common_test.cpp", 83 ] 84 85 include_dirs = [ 86 "//drivers/peripheral/audio/test/unittest/hdi/capture/include", 87 "//drivers/peripheral/audio/test/unittest/hdi/common/include", 88 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 89 "//drivers/peripheral/audio/interfaces/include", 90 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 91 "//third_party/bounds_checking_function/include", 92 "//third_party/googletest/googletest/include/gtest", 93 ] 94 95 deps = [ 96 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio_common", 97 "//third_party/googletest:gmock_main", 98 "//third_party/googletest:gtest_main", 99 ] 100 if (!defined(enable_audio_user_mode) || !enable_audio_user_mode) { 101 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 102 external_deps = [ "device_driver_framework:libhdf_utils" ] 103 } else { 104 deps += [ "//device/soc/${product_company}/common/hal/media:hdi_audio" ] 105 } 106 cflags = [ 107 "-Wall", 108 "-Wextra", 109 "-Werror", 110 "-fsigned-char", 111 "-fno-common", 112 "-fno-strict-aliasing", 113 ] 114 } 115} 116