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