1// Build the unit tests for audio_utils
2
3package {
4    // http://go/android-license-faq
5    // A large-scale-change added 'default_applicable_licenses' to import
6    // the below license kinds from "system_media_license":
7    //   SPDX-license-identifier-Apache-2.0
8    default_applicable_licenses: ["system_media_license"],
9}
10
11cc_test {
12    name: "balance_tests",
13    host_supported: true,
14
15    srcs: [
16        "balance_tests.cpp",
17    ],
18
19    static_libs: [
20        "libaudioutils",
21    ],
22
23    cflags: [
24        "-Wall",
25        "-Werror",
26        "-Wextra",
27    ],
28}
29
30cc_binary {
31    name: "biquad_filter",
32    host_supported: true,
33
34    srcs: [
35        "biquad_filter.cpp"
36    ],
37
38    shared_libs: [
39        "libaudioutils",
40    ],
41
42    cflags: [
43        "-Wall",
44        "-Werror",
45        "-Wextra",
46    ],
47}
48
49cc_test {
50    name: "biquad_filter_tests",
51    host_supported: true,
52
53    srcs: [
54        "biquad_filter_tests.cpp",
55    ],
56
57    header_libs: [
58        "libaudioutils_headers",
59    ],
60
61    static_libs: [
62        "libgmock",
63    ],
64
65    cflags: [
66        "-Wall",
67        "-Werror",
68        "-Wextra",
69    ],
70}
71
72cc_test {
73    name: "channelmix_tests",
74    host_supported: true,
75
76    shared_libs: [
77        "libcutils",
78        "liblog",
79    ],
80
81    static_libs: [
82        "libaudioutils",
83    ],
84
85    srcs: ["channelmix_tests.cpp"],
86    cflags: [
87        "-Wall",
88        "-Werror",
89        "-Wextra",
90    ],
91}
92
93cc_test {
94    name: "fdtostring_tests",
95    host_supported: true,
96
97    shared_libs: [
98        "libaudioutils",
99        "libcutils",
100        "liblog",
101        "libutils", //for systemTime
102    ],
103    srcs: ["fdtostring_tests.cpp"],
104    cflags: [
105        "-Wall",
106        "-Werror",
107        "-Wextra",
108    ],
109}
110
111cc_test {
112    name: "intrinsic_tests",
113    host_supported: true,
114
115    srcs: [
116        "intrinsic_tests.cpp",
117    ],
118
119    header_libs: [
120        "libaudioutils_headers",
121    ],
122
123    cflags: [
124        "-Wall",
125        "-Werror",
126        "-Wextra",
127    ],
128}
129
130cc_test {
131    name: "primitives_tests",
132    host_supported: true,
133
134    shared_libs: [
135        "liblog",
136        "libcutils",
137    ],
138    srcs: ["primitives_tests.cpp"],
139    cflags: [
140        "-Werror",
141        "-Wall",
142    ],
143    target: {
144        android: {
145            shared_libs: ["libaudioutils"],
146        },
147        host: {
148            static_libs: ["libaudioutils"],
149        },
150    }
151}
152
153cc_binary {
154    name: "fifo_tests",
155    host_supported: true,
156    srcs: ["fifo_tests.cpp"],
157    shared_libs: ["libaudioutils"],
158    static_libs: ["libsndfile"],
159    cflags: [
160        "-Werror",
161        "-Wall",
162    ],
163}
164
165cc_binary {
166    name: "fifo_multiprocess",
167    host_supported: true,
168    srcs: ["fifo_multiprocess.cpp"],
169    shared_libs: ["libaudioutils", "libcutils"],
170    static_libs: ["libsndfile"],
171    cflags: [
172        "-Werror",
173        "-Wall",
174    ],
175}
176
177cc_binary_host {
178    name: "fifo_threads",
179    // TODO move getch.c and .h to a utility library
180    srcs: [
181        "fifo_threads.cpp",
182        "getch.c",
183    ],
184    static_libs: [
185        "libaudioutils",
186        "liblog",
187    ],
188    cflags: [
189        "-Werror",
190        "-Wall",
191    ],
192}
193
194cc_binary_host {
195    name: "limiter_tests",
196    srcs: ["limiter_tests.c"],
197    static_libs: ["libaudioutils"],
198    cflags: [
199        "-Werror",
200        "-Wall",
201        "-UNDEBUG",
202    ],
203}
204
205cc_test {
206    name: "power_tests",
207    host_supported: true,
208
209    shared_libs: [
210        "libcutils",
211        "liblog",
212    ],
213    srcs: ["power_tests.cpp"],
214    cflags: [
215        "-Wall",
216        "-Werror",
217        "-Wextra",
218    ],
219    target: {
220        android: {
221            shared_libs: ["libaudioutils"],
222        },
223        host: {
224            static_libs: ["libaudioutils"],
225        },
226    }
227}
228
229cc_test {
230    name: "errorlog_tests",
231    host_supported: true,
232
233    shared_libs: [
234        "libcutils",
235        "liblog",
236    ],
237    srcs: ["errorlog_tests.cpp"],
238    cflags: [
239        "-Wall",
240        "-Werror",
241        "-Wextra",
242    ],
243    target: {
244        android: {
245            shared_libs: ["libaudioutils"],
246        },
247        host: {
248            static_libs: ["libaudioutils"],
249        },
250    }
251}
252
253cc_test {
254    name: "metadata_tests",
255    host_supported: false,
256
257    shared_libs: [
258        "libcutils",
259        "liblog",
260    ],
261    srcs: ["metadata_tests.cpp"],
262    cflags: [
263        "-Wall",
264        "-Werror",
265        "-Wextra",
266    ],
267    target: {
268        android: {
269            shared_libs: ["libaudioutils"],
270        },
271        host: {
272            static_libs: ["libaudioutils"],
273        },
274    }
275}
276
277cc_binary {
278    name: "metadata_c_tests",
279    host_supported: true,
280    srcs: ["metadata_tests_c.c"],
281    cflags: [
282        "-Wall",
283        "-Werror",
284        "-Wextra",
285    ],
286    shared_libs: ["libaudioutils"],
287}
288
289cc_test {
290    name: "powerlog_tests",
291    host_supported: true,
292
293    shared_libs: [
294        "libcutils",
295        "liblog",
296    ],
297    srcs: ["powerlog_tests.cpp"],
298    cflags: [
299        "-Wall",
300        "-Werror",
301        "-Wextra",
302    ],
303    target: {
304        android: {
305            shared_libs: ["libaudioutils"],
306        },
307        host: {
308            static_libs: ["libaudioutils"],
309        },
310    }
311}
312
313cc_test {
314    name: "simplelog_tests",
315    host_supported: true,
316
317    shared_libs: [
318        "libcutils",
319        "liblog",
320    ],
321    srcs: ["simplelog_tests.cpp"],
322    cflags: [
323        "-Wall",
324        "-Werror",
325        "-Wextra",
326    ],
327    target: {
328        android: {
329            shared_libs: ["libaudioutils"],
330        },
331        host: {
332            static_libs: ["libaudioutils"],
333        },
334    }
335}
336
337cc_test {
338    name: "channels_tests",
339    host_supported: true,
340
341    shared_libs: [
342        "libcutils",
343        "liblog",
344    ],
345    srcs: ["channels_tests.cpp"],
346    cflags: [
347        "-Wall",
348        "-Werror",
349    ],
350    target: {
351        android: {
352            shared_libs: ["libaudioutils"],
353        },
354        host: {
355            static_libs: ["libaudioutils"],
356        },
357    }
358}
359
360cc_test {
361    name: "string_tests",
362    host_supported: true,
363
364    shared_libs: ["libaudioutils"],
365    srcs: ["string_tests.cpp"],
366    cflags: [
367        "-Wall",
368        "-Werror",
369    ],
370    target: {
371        host: {
372            shared_libs: ["libcutils"],
373        },
374    }
375}
376
377cc_test {
378    name: "format_tests",
379    host_supported: true,
380
381    shared_libs: [
382        "liblog",
383    ],
384    srcs: ["format_tests.cpp"],
385    cflags: [
386        "-Werror",
387        "-Wall",
388    ],
389    target: {
390        android: {
391            shared_libs: ["libaudioutils"],
392        },
393        host: {
394            static_libs: ["libaudioutils"],
395        },
396    }
397}
398
399cc_test {
400    name: "statistics_tests",
401    host_supported: true,
402
403    header_libs: ["libaudioutils_headers"],
404    srcs: ["statistics_tests.cpp"],
405    cflags: [
406        "-Wall",
407        "-Werror",
408        "-Wextra",
409    ],
410}
411
412cc_test {
413    name: "timestampverifier_tests",
414    host_supported: true,
415
416    header_libs: ["libaudioutils_headers"],
417    srcs: ["timestampverifier_tests.cpp"],
418    cflags: [
419        "-Wall",
420        "-Werror",
421        "-Wextra",
422    ],
423}
424
425cc_test {
426    name: "variadic_tests",
427    host_supported: true,
428
429    shared_libs: ["libaudioutils"],
430    srcs: ["variadic_tests.cpp"],
431    cflags: [
432        "-Wall",
433        "-Werror",
434        "-Wextra",
435    ],
436}
437
438cc_test {
439    name: "logplot_tests",
440    host_supported: true,
441
442    shared_libs: [
443        "liblog",
444        "libcutils",
445    ],
446    srcs: ["logplot_tests.cpp"],
447    gtest:false,
448    cflags: [
449        "-Werror",
450        "-Wall",
451    ],
452    target: {
453        android: {
454            shared_libs: ["libaudioutils"],
455        },
456        host: {
457            static_libs: ["libaudioutils"],
458        },
459    }
460}
461
462cc_test {
463    name: "sample_tests",
464    host_supported: true,
465
466    shared_libs: [
467        "liblog",
468        "libcutils",
469    ],
470    srcs: ["sample_tests.cpp"],
471    cflags: [
472        "-Werror",
473        "-Wall",
474    ],
475    target: {
476        android: {
477            shared_libs: ["libaudioutils"],
478        },
479        host: {
480            static_libs: ["libaudioutils"],
481        },
482    }
483}
484
485cc_test {
486    name: "spdif_tests",
487    host_supported: true,
488
489    shared_libs: [
490        "libaudioutils",
491        "libaudiospdif",
492        "liblog",
493        "libcutils",
494    ],
495    srcs: ["spdif_tests.cpp"],
496    cflags: [
497        "-Werror",
498        "-Wall",
499    ],
500}
501