1# Copyright (c) 2021-2022 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} else { 17 import("//build/test.gni") 18 import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 19} 20import("//drivers/peripheral/audio/audio.gni") 21 22if (defined(ohos_lite)) { 23 moduletest("hdf_audio_hdi_render_attr_test") { 24 sources = [ 25 "../../../common/hdi_common/src/audio_hdi_common.cpp", 26 "src/audio_hdirender_attr_test.cpp", 27 ] 28 29 include_dirs = [ 30 "//drivers/peripheral/audio/interfaces/include", 31 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 32 "//drivers/hdf_core/framework/include/core", 33 "//drivers/hdf_core/framework/include/utils", 34 "//drivers/hdf_core/framework/include/osal", 35 "//drivers/hdf_core/framework/utils/include", 36 "//drivers/hdf_core/framework/include", 37 "//drivers/hdf_core/framework/core/sec/include", 38 "//drivers/hdf_core/framework/core/shared/include", 39 "//drivers/hdf_core/framework/core/host/include", 40 "//drivers/hdf_core/framework/core/manager/include", 41 "//drivers/hdf_core/framework/core/common/include/host/", 42 "//third_party/bounds_checking_function/include", 43 "//drivers/hdf_core/adapter/khdf/liteos/osal/include", 44 "//drivers/hdf_core/adapter/uhdf2/shared/include", 45 "//drivers/hdf_core/adapter/uhdf2/include/hdi/", 46 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 47 "//third_party/googletest/googletest/include/gtest", 48 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 49 ] 50 deps = [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 51 } 52 53 moduletest("hdf_audio_hdi_render_control_test") { 54 sources = [ 55 "../../../common/hdi_common/src/audio_hdi_common.cpp", 56 "src/audio_hdirender_control_test.cpp", 57 ] 58 59 include_dirs = [ 60 "//drivers/peripheral/audio/interfaces/include", 61 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 62 "//drivers/hdf_core/framework/include/core", 63 "//drivers/hdf_core/framework/include/utils", 64 "//drivers/hdf_core/framework/include/osal", 65 "//drivers/hdf_core/framework/utils/include", 66 "//drivers/hdf_core/framework/include", 67 "//drivers/hdf_core/framework/core/sec/include", 68 "//drivers/hdf_core/framework/core/shared/include", 69 "//drivers/hdf_core/framework/core/host/include", 70 "//drivers/hdf_core/framework/core/manager/include", 71 "//drivers/hdf_core/framework/core/common/include/host/", 72 "//third_party/bounds_checking_function/include", 73 "//drivers/hdf_core/adapter/khdf/liteos/osal/include", 74 "//drivers/hdf_core/adapter/uhdf2/shared/include", 75 "//drivers/hdf_core/adapter/uhdf2/include/hdi/", 76 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 77 "//third_party/googletest/googletest/include/gtest", 78 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 79 ] 80 deps = [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 81 } 82 moduletest("hdf_audio_hdi_render_volume_test") { 83 sources = [ 84 "../../../common/hdi_common/src/audio_hdi_common.cpp", 85 "src/audio_hdirender_volume_test.cpp", 86 ] 87 88 include_dirs = [ 89 "//drivers/peripheral/audio/interfaces/include", 90 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 91 "//drivers/hdf_core/framework/include/core", 92 "//drivers/hdf_core/framework/include/utils", 93 "//drivers/hdf_core/framework/include/osal", 94 "//drivers/hdf_core/framework/utils/include", 95 "//drivers/hdf_core/framework/include", 96 "//drivers/hdf_core/framework/core/sec/include", 97 "//drivers/hdf_core/framework/core/shared/include", 98 "//drivers/hdf_core/framework/core/host/include", 99 "//drivers/hdf_core/framework/core/manager/include", 100 "//drivers/hdf_core/framework/core/common/include/host/", 101 "//third_party/bounds_checking_function/include", 102 "//drivers/hdf_core/adapter/khdf/liteos/osal/include", 103 "//drivers/hdf_core/adapter/uhdf2/shared/include", 104 "//drivers/hdf_core/adapter/uhdf2/include/hdi/", 105 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 106 "//third_party/googletest/googletest/include/gtest", 107 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 108 ] 109 deps = [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 110 } 111 112 moduletest("hdf_audio_hdi_render_scene_test") { 113 sources = [ 114 "../../../common/hdi_common/src/audio_hdi_common.cpp", 115 "src/audio_hdirender_scene_test.cpp", 116 ] 117 118 include_dirs = [ 119 "//drivers/peripheral/audio/interfaces/include", 120 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 121 "//drivers/hdf_core/framework/include/core", 122 "//drivers/hdf_core/framework/include/utils", 123 "//drivers/hdf_core/framework/include/osal", 124 "//drivers/hdf_core/framework/utils/include", 125 "//drivers/hdf_core/framework/include", 126 "//drivers/hdf_core/framework/core/sec/include", 127 "//drivers/hdf_core/framework/core/shared/include", 128 "//drivers/hdf_core/framework/core/host/include", 129 "//drivers/hdf_core/framework/core/manager/include", 130 "//drivers/hdf_core/framework/core/common/include/host/", 131 "//third_party/bounds_checking_function/include", 132 "//drivers/hdf_core/adapter/khdf/liteos/osal/include", 133 "//drivers/hdf_core/adapter/uhdf2/shared/include", 134 "//drivers/hdf_core/adapter/uhdf2/include/hdi/", 135 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 136 "//third_party/googletest/googletest/include/gtest", 137 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 138 ] 139 deps = [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 140 } 141 moduletest("hdf_audio_hdi_render_test") { 142 sources = [ 143 "../../../common/hdi_common/src/audio_hdi_common.cpp", 144 "src/audio_hdirender_test.cpp", 145 ] 146 147 include_dirs = [ 148 "//drivers/peripheral/audio/interfaces/include", 149 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 150 "//drivers/hdf_core/framework/include/core", 151 "//drivers/hdf_core/framework/include/utils", 152 "//drivers/hdf_core/framework/include/osal", 153 "//drivers/hdf_core/framework/utils/include", 154 "//drivers/hdf_core/framework/include", 155 "//drivers/hdf_core/framework/core/sec/include", 156 "//drivers/hdf_core/framework/core/shared/include", 157 "//drivers/hdf_core/framework/core/host/include", 158 "//drivers/hdf_core/framework/core/manager/include", 159 "//drivers/hdf_core/framework/core/common/include/host/", 160 "//third_party/bounds_checking_function/include", 161 "//drivers/hdf_core/adapter/khdf/liteos/osal/include", 162 "//drivers/hdf_core/adapter/uhdf2/shared/include", 163 "//drivers/hdf_core/adapter/uhdf2/include/hdi/", 164 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 165 "//third_party/googletest/googletest/include/gtest", 166 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 167 ] 168 deps = [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 169 } 170} else { 171 module_output_path = "drivers_peripheral_audio/audio" 172 173 ohos_systemtest("hdf_audio_hdi_render_attr_test") { 174 module_out_path = module_output_path 175 resource_config_file = 176 "//drivers/peripheral/audio/test/resource/ohos_test.xml" 177 sources = [ 178 "../../../common/hdi_common/src/audio_hdi_common.cpp", 179 "src/audio_hdirender_attr_test.cpp", 180 ] 181 182 include_dirs = [ 183 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 184 "//drivers/peripheral/audio/interfaces/include", 185 "//drivers/hdf_core/adapter/uhdf2/include/hdi", 186 "//drivers/hdf_core/adapter/uhdf2/shared/include", 187 "//drivers/hdf_core/framework/include/core", 188 "//drivers/hdf_core/framework/include/utils", 189 "//drivers/hdf_core/framework/include/osal", 190 "//drivers/hdf_core/framework/include", 191 "//third_party/bounds_checking_function/include", 192 "//drivers/hdf_core/framework/utils/include", 193 "//drivers/hdf_core/adapter/uhdf2/osal/include", 194 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 195 "//third_party/googletest/googletest/include/gtest", 196 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 197 ] 198 199 deps = [ 200 "//third_party/googletest:gmock_main", 201 "//third_party/googletest:gtest_main", 202 ] 203 defines = [] 204 if (enable_audio_adm_passthrough) { 205 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 206 defines += [ "AUDIO_ADM_SO" ] 207 } 208 if (enable_audio_adm_service) { 209 deps += 210 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 211 defines += [ "AUDIO_ADM_SERVICE" ] 212 } 213 if (!drivers_peripheral_audio_rich_device) { 214 defines += [ "FEATURE_SMALL_DEVICE" ] 215 } 216 } 217 218 ohos_systemtest("hdf_audio_hdi_render_control_test") { 219 module_out_path = module_output_path 220 resource_config_file = 221 "//drivers/peripheral/audio/test/resource/ohos_test.xml" 222 sources = [ 223 "../../../common/hdi_common/src/audio_hdi_common.cpp", 224 "src/audio_hdirender_control_test.cpp", 225 ] 226 227 include_dirs = [ 228 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 229 "//drivers/peripheral/audio/interfaces/include", 230 "//drivers/hdf_core/adapter/uhdf2/include/hdi", 231 "//drivers/hdf_core/adapter/uhdf2/shared/include", 232 "//drivers/hdf_core/framework/include/core", 233 "//drivers/hdf_core/framework/include/utils", 234 "//drivers/hdf_core/framework/include/osal", 235 "//drivers/hdf_core/framework/include", 236 "//third_party/bounds_checking_function/include", 237 "//drivers/hdf_core/framework/utils/include", 238 "//drivers/hdf_core/adapter/uhdf2/osal/include", 239 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 240 "//third_party/googletest/googletest/include/gtest", 241 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 242 ] 243 244 deps = [ 245 "//third_party/googletest:gmock_main", 246 "//third_party/googletest:gtest_main", 247 ] 248 defines = [] 249 if (enable_audio_adm_passthrough) { 250 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 251 defines += [ "AUDIO_ADM_SO" ] 252 } 253 if (enable_audio_adm_service) { 254 deps += 255 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 256 defines += [ "AUDIO_ADM_SERVICE" ] 257 } 258 if (!drivers_peripheral_audio_rich_device) { 259 defines += [ "FEATURE_SMALL_DEVICE" ] 260 } 261 } 262 263 ohos_systemtest("hdf_audio_hdi_render_volume_test") { 264 module_out_path = module_output_path 265 resource_config_file = 266 "//drivers/peripheral/audio/test/resource/ohos_test.xml" 267 sources = [ 268 "../../../common/hdi_common/src/audio_hdi_common.cpp", 269 "src/audio_hdirender_volume_test.cpp", 270 ] 271 272 include_dirs = [ 273 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 274 "//drivers/peripheral/audio/interfaces/include", 275 "//drivers/hdf_core/adapter/uhdf2/include/hdi", 276 "//drivers/hdf_core/adapter/uhdf2/shared/include", 277 "//drivers/hdf_core/framework/include/core", 278 "//drivers/hdf_core/framework/include/utils", 279 "//drivers/hdf_core/framework/include/osal", 280 "//drivers/hdf_core/framework/include", 281 "//third_party/bounds_checking_function/include", 282 "//drivers/hdf_core/framework/utils/include", 283 "//drivers/hdf_core/adapter/uhdf2/osal/include", 284 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 285 "//third_party/googletest/googletest/include/gtest", 286 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 287 ] 288 289 deps = [ 290 "//third_party/googletest:gmock_main", 291 "//third_party/googletest:gtest_main", 292 ] 293 defines = [] 294 if (enable_audio_adm_passthrough) { 295 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 296 defines += [ "AUDIO_ADM_SO" ] 297 } 298 if (enable_audio_adm_service) { 299 deps += 300 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 301 defines += [ "AUDIO_ADM_SERVICE" ] 302 } 303 if ("${product_name}" == "rk3568") { 304 defines += [ "PRODUCT_RK3568" ] 305 } 306 if (defined(drivers_peripheral_audio_alsa_lib) && 307 drivers_peripheral_audio_alsa_lib == true) { 308 defines += [ "ALSA_LIB_MODE" ] 309 } 310 if (!drivers_peripheral_audio_rich_device) { 311 defines += [ "FEATURE_SMALL_DEVICE" ] 312 } 313 } 314 315 ohos_systemtest("hdf_audio_hdi_render_scene_test") { 316 module_out_path = module_output_path 317 resource_config_file = 318 "//drivers/peripheral/audio/test/resource/ohos_test.xml" 319 sources = [ 320 "../../../common/hdi_common/src/audio_hdi_common.cpp", 321 "src/audio_hdirender_scene_test.cpp", 322 ] 323 324 include_dirs = [ 325 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 326 "//drivers/peripheral/audio/interfaces/include", 327 "//drivers/hdf_core/adapter/uhdf2/include/hdi", 328 "//drivers/hdf_core/adapter/uhdf2/shared/include", 329 "//drivers/hdf_core/framework/include/core", 330 "//drivers/hdf_core/framework/include/utils", 331 "//drivers/hdf_core/framework/include/osal", 332 "//drivers/hdf_core/framework/include", 333 "//third_party/bounds_checking_function/include", 334 "//drivers/hdf_core/framework/utils/include", 335 "//drivers/hdf_core/adapter/uhdf2/osal/include", 336 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 337 "//third_party/googletest/googletest/include/gtest", 338 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 339 ] 340 341 deps = [ 342 "//third_party/googletest:gmock_main", 343 "//third_party/googletest:gtest_main", 344 ] 345 defines = [] 346 if (enable_audio_adm_passthrough) { 347 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 348 defines += [ "AUDIO_ADM_SO" ] 349 } 350 if (enable_audio_adm_service) { 351 deps += 352 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 353 defines += [ "AUDIO_ADM_SERVICE" ] 354 } 355 if (defined(drivers_peripheral_audio_alsa_lib) && 356 drivers_peripheral_audio_alsa_lib == true) { 357 defines += [ "ALSA_LIB_MODE" ] 358 } 359 if (!drivers_peripheral_audio_rich_device) { 360 defines += [ "FEATURE_SMALL_DEVICE" ] 361 } 362 } 363 364 ohos_systemtest("hdf_audio_hdi_render_test") { 365 module_out_path = module_output_path 366 resource_config_file = 367 "//drivers/peripheral/audio/test/resource/ohos_test.xml" 368 sources = [ 369 "../../../common/hdi_common/src/audio_hdi_common.cpp", 370 "src/audio_hdirender_test.cpp", 371 ] 372 373 include_dirs = [ 374 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 375 "//drivers/peripheral/audio/interfaces/include", 376 "//drivers/hdf_core/adapter/uhdf2/include/hdi", 377 "//drivers/hdf_core/adapter/uhdf2/shared/include", 378 "//drivers/hdf_core/framework/include/core", 379 "//drivers/hdf_core/framework/include/utils", 380 "//drivers/hdf_core/framework/include/osal", 381 "//drivers/hdf_core/framework/include", 382 "//third_party/bounds_checking_function/include", 383 "//drivers/hdf_core/framework/utils/include", 384 "//drivers/hdf_core/adapter/uhdf2/osal/include", 385 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 386 "//third_party/googletest/googletest/include/gtest", 387 "//drivers/peripheral/audio/test/systemtest/hdi/common/render/include", 388 ] 389 390 deps = [ 391 "//third_party/googletest:gmock_main", 392 "//third_party/googletest:gtest_main", 393 ] 394 defines = [] 395 if (enable_audio_adm_passthrough) { 396 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 397 defines += [ "AUDIO_ADM_SO" ] 398 } 399 if (enable_audio_adm_service) { 400 deps += 401 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 402 defines += [ "AUDIO_ADM_SERVICE" ] 403 } 404 if ("${product_name}" == "rk3568") { 405 defines += [ "PRODUCT_RK3568" ] 406 } 407 if (defined(drivers_peripheral_audio_alsa_lib) && 408 drivers_peripheral_audio_alsa_lib == true) { 409 defines += [ "ALSA_LIB_MODE" ] 410 } 411 if (!drivers_peripheral_audio_rich_device) { 412 defines += [ "FEATURE_SMALL_DEVICE" ] 413 } 414 } 415} 416