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 import("//drivers/peripheral/audio/audio.gni") 20} 21 22if (defined(ohos_lite)) { 23 moduletest("hdf_audio_hdi_render_reliability_test") { 24 sources = [ 25 "../../common/hdi_common/src/audio_hdi_common.cpp", 26 "src/audio_hdirender_reliability_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/hdireliability/include", 49 ] 50 51 deps = [ 52 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", 53 "//third_party/bounds_checking_function:libsec_shared", 54 ] 55 } 56 moduletest("hdf_audio_hdi_capture_reliability_test") { 57 sources = [ 58 "../../common/hdi_common/src/audio_hdi_common.cpp", 59 "src/audio_hdicapture_reliability_test.cpp", 60 ] 61 62 include_dirs = [ 63 "//drivers/peripheral/audio/interfaces/include", 64 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 65 "//drivers/hdf_core/framework/include/core", 66 "//drivers/hdf_core/framework/include/utils", 67 "//drivers/hdf_core/framework/include/osal", 68 "//drivers/hdf_core/framework/utils/include", 69 "//drivers/hdf_core/framework/include", 70 "//drivers/hdf_core/framework/core/sec/include", 71 "//drivers/hdf_core/framework/core/shared/include", 72 "//drivers/hdf_core/framework/core/host/include", 73 "//drivers/hdf_core/framework/core/manager/include", 74 "//drivers/hdf_core/framework/core/common/include/host/", 75 "//third_party/bounds_checking_function/include", 76 "//drivers/hdf_core/adapter/khdf/liteos/osal/include", 77 "//drivers/hdf_core/adapter/uhdf2/shared/include", 78 "//drivers/hdf_core/adapter/uhdf2/include/hdi/", 79 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 80 "//third_party/googletest/googletest/include/gtest", 81 "//drivers/peripheral/audio/test/systemtest/hdi/hdireliability/include", 82 ] 83 84 deps = [ 85 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", 86 "//third_party/bounds_checking_function:libsec_shared", 87 ] 88 } 89 90 moduletest("hdf_audio_hdi_capture_control_reliability_test") { 91 sources = [ 92 "../../common/hdi_common/src/audio_hdi_common.cpp", 93 "src/audio_hdicapture_control_reliability_test.cpp", 94 ] 95 96 include_dirs = [ 97 "//drivers/peripheral/audio/interfaces/include", 98 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 99 "//drivers/hdf_core/framework/include/core", 100 "//drivers/hdf_core/framework/include/utils", 101 "//drivers/hdf_core/framework/include/osal", 102 "//drivers/hdf_core/framework/utils/include", 103 "//drivers/hdf_core/framework/include", 104 "//drivers/hdf_core/framework/core/sec/include", 105 "//drivers/hdf_core/framework/core/shared/include", 106 "//drivers/hdf_core/framework/core/host/include", 107 "//drivers/hdf_core/framework/core/manager/include", 108 "//drivers/hdf_core/framework/core/common/include/host/", 109 "//third_party/bounds_checking_function/include", 110 "//drivers/hdf_core/adapter/khdf/liteos/osal/include", 111 "//drivers/hdf_core/adapter/uhdf2/shared/include", 112 "//drivers/hdf_core/adapter/uhdf2/include/hdi/", 113 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 114 "//third_party/googletest/googletest/include/gtest", 115 "//drivers/peripheral/audio/test/systemtest/hdi/hdireliability/include", 116 ] 117 118 deps = [ 119 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", 120 "//third_party/bounds_checking_function:libsec_shared", 121 ] 122 } 123 124 moduletest("hdf_audio_hdi_render_control_reliability_test") { 125 sources = [ 126 "../../common/hdi_common/src/audio_hdi_common.cpp", 127 "src/audio_hdirender_control_reliability_test.cpp", 128 ] 129 130 include_dirs = [ 131 "//drivers/peripheral/audio/interfaces/include", 132 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 133 "//drivers/hdf_core/framework/include/core", 134 "//drivers/hdf_core/framework/include/utils", 135 "//drivers/hdf_core/framework/include/osal", 136 "//drivers/hdf_core/framework/utils/include", 137 "//drivers/hdf_core/framework/include", 138 "//drivers/hdf_core/framework/core/sec/include", 139 "//drivers/hdf_core/framework/core/shared/include", 140 "//drivers/hdf_core/framework/core/host/include", 141 "//drivers/hdf_core/framework/core/manager/include", 142 "//drivers/hdf_core/framework/core/common/include/host/", 143 "//third_party/bounds_checking_function/include", 144 "//drivers/hdf_core/adapter/khdf/liteos/osal/include", 145 "//drivers/hdf_core/adapter/uhdf2/shared/include", 146 "//drivers/hdf_core/adapter/uhdf2/include/hdi/", 147 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 148 "//third_party/googletest/googletest/include/gtest", 149 "//drivers/peripheral/audio/test/systemtest/hdi/hdireliability/include", 150 ] 151 152 deps = [ 153 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", 154 "//third_party/bounds_checking_function:libsec_shared", 155 ] 156 } 157} else { 158 module_output_path = "drivers_peripheral_audio/audio" 159 160 ohos_systemtest("hdf_audio_hdi_render_reliability_test") { 161 module_out_path = module_output_path 162 resource_config_file = 163 "//drivers/peripheral/audio/test/resource/ohos_test.xml" 164 sources = [ 165 "../../common/hdi_common/src/audio_hdi_common.cpp", 166 "src/audio_hdirender_reliability_test.cpp", 167 ] 168 169 include_dirs = [ 170 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 171 "//drivers/peripheral/audio/interfaces/include", 172 "//third_party/bounds_checking_function/include", 173 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 174 "//third_party/googletest/googletest/include/gtest", 175 "//drivers/peripheral/audio/test/systemtest/hdi/hdireliability/include", 176 ] 177 deps = [ 178 "//third_party/googletest:gmock_main", 179 "//third_party/googletest:gtest_main", 180 ] 181 external_deps = [ 182 "c_utils:utils", 183 "hdf_core:libhdf_utils", 184 ] 185 defines = [] 186 if (enable_audio_adm_passthrough) { 187 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 188 defines += [ "AUDIO_ADM_SO" ] 189 } 190 if (enable_audio_adm_service) { 191 deps += 192 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 193 defines += [ "AUDIO_ADM_SERVICE" ] 194 } 195 if (!drivers_peripheral_audio_rich_device) { 196 defines += [ "FEATURE_SMALL_DEVICE" ] 197 } 198 } 199 200 ohos_systemtest("hdf_audio_hdi_capture_reliability_test") { 201 module_out_path = module_output_path 202 sources = [ 203 "../../common/hdi_common/src/audio_hdi_common.cpp", 204 "src/audio_hdicapture_reliability_test.cpp", 205 ] 206 207 include_dirs = [ 208 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 209 "//drivers/peripheral/audio/interfaces/include", 210 "//third_party/bounds_checking_function/include", 211 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 212 "//third_party/googletest/googletest/include/gtest", 213 "//drivers/peripheral/audio/test/systemtest/hdi/hdireliability/include", 214 ] 215 deps = [ 216 "//third_party/googletest:gmock_main", 217 "//third_party/googletest:gtest_main", 218 ] 219 external_deps = [ 220 "c_utils:utils", 221 "hdf_core:libhdf_utils", 222 ] 223 defines = [] 224 if (enable_audio_adm_passthrough) { 225 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 226 defines += [ "AUDIO_ADM_SO" ] 227 } 228 if (enable_audio_adm_service) { 229 deps += 230 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 231 defines += [ "AUDIO_ADM_SERVICE" ] 232 } 233 if (!drivers_peripheral_audio_rich_device) { 234 defines += [ "FEATURE_SMALL_DEVICE" ] 235 } 236 } 237 238 ohos_systemtest("hdf_audio_hdi_capture_control_reliability_test") { 239 module_out_path = module_output_path 240 sources = [ 241 "../../common/hdi_common/src/audio_hdi_common.cpp", 242 "src/audio_hdicapture_control_reliability_test.cpp", 243 ] 244 245 include_dirs = [ 246 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 247 "//drivers/peripheral/audio/interfaces/include", 248 "//third_party/bounds_checking_function/include", 249 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 250 "//third_party/googletest/googletest/include/gtest", 251 "//drivers/peripheral/audio/test/systemtest/hdi/hdireliability/include", 252 ] 253 deps = [ 254 "//third_party/googletest:gmock_main", 255 "//third_party/googletest:gtest_main", 256 ] 257 external_deps = [ 258 "c_utils:utils", 259 "hdf_core:libhdf_utils", 260 ] 261 defines = [] 262 if (enable_audio_adm_passthrough) { 263 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 264 defines += [ "AUDIO_ADM_SO" ] 265 } 266 if (enable_audio_adm_service) { 267 deps += 268 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 269 defines += [ "AUDIO_ADM_SERVICE" ] 270 } 271 if (!drivers_peripheral_audio_rich_device) { 272 defines += [ "FEATURE_SMALL_DEVICE" ] 273 } 274 } 275 276 ohos_systemtest("hdf_audio_hdi_render_control_reliability_test") { 277 module_out_path = module_output_path 278 resource_config_file = 279 "//drivers/peripheral/audio/test/resource/ohos_test.xml" 280 sources = [ 281 "../../common/hdi_common/src/audio_hdi_common.cpp", 282 "src/audio_hdirender_control_reliability_test.cpp", 283 ] 284 285 include_dirs = [ 286 "//drivers/peripheral/audio/hal/hdi_passthrough/include", 287 "//drivers/peripheral/audio/interfaces/include", 288 "//third_party/bounds_checking_function/include", 289 "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include", 290 "//third_party/googletest/googletest/include/gtest", 291 "//drivers/peripheral/audio/test/systemtest/hdi/hdireliability/include", 292 ] 293 deps = [ 294 "//third_party/googletest:gmock_main", 295 "//third_party/googletest:gtest_main", 296 ] 297 external_deps = [ 298 "c_utils:utils", 299 "hdf_core:libhdf_utils", 300 ] 301 defines = [] 302 if (enable_audio_adm_passthrough) { 303 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 304 defines += [ "AUDIO_ADM_SO" ] 305 } 306 if (enable_audio_adm_service) { 307 deps += 308 [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ] 309 defines += [ "AUDIO_ADM_SERVICE" ] 310 } 311 if (!drivers_peripheral_audio_rich_device) { 312 defines += [ "FEATURE_SMALL_DEVICE" ] 313 } 314 } 315} 316group("hdi_reliability") { 317 if (!defined(ohos_lite)) { 318 testonly = true 319 } 320 deps = [ 321 ":hdf_audio_hdi_capture_control_reliability_test", 322 ":hdf_audio_hdi_capture_reliability_test", 323 ":hdf_audio_hdi_render_control_reliability_test", 324 ":hdf_audio_hdi_render_reliability_test", 325 ] 326} 327