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_render_test########################### 26 unittest("hdf_audio_hdi_render_test") { 27 sources = [ 28 "//drivers/peripheral/audio/test/unittest/hdi/common/src/audio_common_test.cpp", 29 "//drivers/peripheral/audio/test/unittest/hdi/render/src/audio_render_test.cpp", 30 ] 31 32 include_dirs = [ 33 "//drivers/peripheral/audio/test/unittest/hdi/render/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 if (!defined(enable_audio_user_mode) || !enable_audio_user_mode) { 57 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 58 } else { 59 deps += [ "//device/soc/${product_company}/common/hal/media:hdi_audio" ] 60 } 61 cflags = [ 62 "-Wall", 63 "-Wextra", 64 "-Werror", 65 "-fsigned-char", 66 "-fno-common", 67 "-fno-strict-aliasing", 68 "-std=c++11", 69 ] 70 } 71} else { 72 ###########################unittest########################### 73 module_output_path = "hdf/audio/unittest/hal" 74 75 ###########################hdf_audio_hdi_render_test########################### 76 ohos_unittest("hdf_audio_hdi_render_test") { 77 module_out_path = module_output_path 78 sources = [ 79 "//drivers/peripheral/audio/test/unittest/hdi/common/src/audio_common_test.cpp", 80 "//drivers/peripheral/audio/test/unittest/hdi/render/src/audio_render_test.cpp", 81 ] 82 83 include_dirs = [ 84 "//drivers/peripheral/audio/test/unittest/hdi/render/include", 85 "//drivers/peripheral/audio/test/unittest/hdi/common/include", 86 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 87 "//drivers/peripheral/audio/interfaces/include", 88 "//drivers/peripheral/audio/supportlibs/adm_adapter/include", 89 "//third_party/bounds_checking_function/include", 90 "//third_party/googletest/googletest/include/gtest", 91 ] 92 93 deps = [ 94 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio_common", 95 "//third_party/googletest:gmock_main", 96 "//third_party/googletest:gtest_main", 97 ] 98 if (!defined(enable_audio_user_mode) || !enable_audio_user_mode) { 99 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 100 external_deps = [ "device_driver_framework:libhdf_utils" ] 101 } else { 102 deps += [ "//device/soc/${product_company}/common/hal/media:hdi_audio" ] 103 } 104 105 cflags = [ 106 "-Wall", 107 "-Wextra", 108 "-Werror", 109 "-fsigned-char", 110 "-fno-common", 111 "-fno-strict-aliasing", 112 ] 113 } 114} 115