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: "fdtostring_tests",
74    host_supported: true,
75
76    shared_libs: [
77        "libaudioutils",
78        "libcutils",
79        "liblog",
80        "libutils", //for systemTime
81    ],
82    srcs: ["fdtostring_tests.cpp"],
83    cflags: [
84        "-Wall",
85        "-Werror",
86        "-Wextra",
87    ],
88}
89
90cc_test {
91    name: "intrinsic_tests",
92    host_supported: true,
93
94    srcs: [
95        "intrinsic_tests.cpp",
96    ],
97
98    header_libs: [
99        "libaudioutils_headers",
100    ],
101
102    cflags: [
103        "-Wall",
104        "-Werror",
105        "-Wextra",
106    ],
107}
108
109cc_test {
110    name: "primitives_tests",
111    host_supported: true,
112
113    shared_libs: [
114        "liblog",
115        "libcutils",
116    ],
117    srcs: ["primitives_tests.cpp"],
118    cflags: [
119        "-Werror",
120        "-Wall",
121    ],
122    target: {
123        android: {
124            shared_libs: ["libaudioutils"],
125        },
126        host: {
127            static_libs: ["libaudioutils"],
128        },
129    }
130}
131
132cc_binary {
133    name: "fifo_tests",
134    host_supported: true,
135    srcs: ["fifo_tests.cpp"],
136    shared_libs: ["libaudioutils"],
137    static_libs: ["libsndfile"],
138    cflags: [
139        "-Werror",
140        "-Wall",
141    ],
142}
143
144cc_binary {
145    name: "fifo_multiprocess",
146    host_supported: true,
147    srcs: ["fifo_multiprocess.cpp"],
148    shared_libs: ["libaudioutils", "libcutils"],
149    static_libs: ["libsndfile"],
150    cflags: [
151        "-Werror",
152        "-Wall",
153    ],
154}
155
156cc_binary_host {
157    name: "fifo_threads",
158    // TODO move getch.c and .h to a utility library
159    srcs: [
160        "fifo_threads.cpp",
161        "getch.c",
162    ],
163    static_libs: [
164        "libaudioutils",
165        "liblog",
166    ],
167    cflags: [
168        "-Werror",
169        "-Wall",
170    ],
171}
172
173cc_binary_host {
174    name: "limiter_tests",
175    srcs: ["limiter_tests.c"],
176    static_libs: ["libaudioutils"],
177    cflags: [
178        "-Werror",
179        "-Wall",
180        "-UNDEBUG",
181    ],
182}
183
184cc_test {
185    name: "power_tests",
186    host_supported: true,
187
188    shared_libs: [
189        "libcutils",
190        "liblog",
191    ],
192    srcs: ["power_tests.cpp"],
193    cflags: [
194        "-Wall",
195        "-Werror",
196        "-Wextra",
197    ],
198    target: {
199        android: {
200            shared_libs: ["libaudioutils"],
201        },
202        host: {
203            static_libs: ["libaudioutils"],
204        },
205    }
206}
207
208cc_test {
209    name: "errorlog_tests",
210    host_supported: true,
211
212    shared_libs: [
213        "libcutils",
214        "liblog",
215    ],
216    srcs: ["errorlog_tests.cpp"],
217    cflags: [
218        "-Wall",
219        "-Werror",
220        "-Wextra",
221    ],
222    target: {
223        android: {
224            shared_libs: ["libaudioutils"],
225        },
226        host: {
227            static_libs: ["libaudioutils"],
228        },
229    }
230}
231
232cc_test {
233    name: "metadata_tests",
234    host_supported: false,
235
236    shared_libs: [
237        "libcutils",
238        "liblog",
239    ],
240    srcs: ["metadata_tests.cpp"],
241    cflags: [
242        "-Wall",
243        "-Werror",
244        "-Wextra",
245    ],
246    target: {
247        android: {
248            shared_libs: ["libaudioutils"],
249        },
250        host: {
251            static_libs: ["libaudioutils"],
252        },
253    }
254}
255
256cc_binary {
257    name: "metadata_c_tests",
258    host_supported: true,
259    srcs: ["metadata_tests_c.c"],
260    cflags: [
261        "-Wall",
262        "-Werror",
263        "-Wextra",
264    ],
265    shared_libs: ["libaudioutils"],
266}
267
268cc_test {
269    name: "powerlog_tests",
270    host_supported: true,
271
272    shared_libs: [
273        "libcutils",
274        "liblog",
275    ],
276    srcs: ["powerlog_tests.cpp"],
277    cflags: [
278        "-Wall",
279        "-Werror",
280        "-Wextra",
281    ],
282    target: {
283        android: {
284            shared_libs: ["libaudioutils"],
285        },
286        host: {
287            static_libs: ["libaudioutils"],
288        },
289    }
290}
291
292cc_test {
293    name: "simplelog_tests",
294    host_supported: true,
295
296    shared_libs: [
297        "libcutils",
298        "liblog",
299    ],
300    srcs: ["simplelog_tests.cpp"],
301    cflags: [
302        "-Wall",
303        "-Werror",
304        "-Wextra",
305    ],
306    target: {
307        android: {
308            shared_libs: ["libaudioutils"],
309        },
310        host: {
311            static_libs: ["libaudioutils"],
312        },
313    }
314}
315
316cc_test {
317    name: "channels_tests",
318    host_supported: true,
319
320    shared_libs: [
321        "libcutils",
322        "liblog",
323    ],
324    srcs: ["channels_tests.cpp"],
325    cflags: [
326        "-Wall",
327        "-Werror",
328    ],
329    target: {
330        android: {
331            shared_libs: ["libaudioutils"],
332        },
333        host: {
334            static_libs: ["libaudioutils"],
335        },
336    }
337}
338
339cc_test {
340    name: "string_tests",
341    host_supported: true,
342
343    shared_libs: ["libaudioutils"],
344    srcs: ["string_tests.cpp"],
345    cflags: [
346        "-Wall",
347        "-Werror",
348    ],
349    target: {
350        host: {
351            shared_libs: ["libcutils"],
352        },
353    }
354}
355
356cc_test {
357    name: "format_tests",
358    host_supported: true,
359
360    shared_libs: [
361        "liblog",
362    ],
363    srcs: ["format_tests.cpp"],
364    cflags: [
365        "-Werror",
366        "-Wall",
367    ],
368    target: {
369        android: {
370            shared_libs: ["libaudioutils"],
371        },
372        host: {
373            static_libs: ["libaudioutils"],
374        },
375    }
376}
377
378cc_test {
379    name: "statistics_tests",
380    host_supported: true,
381
382    header_libs: ["libaudioutils_headers"],
383    srcs: ["statistics_tests.cpp"],
384    cflags: [
385        "-Wall",
386        "-Werror",
387        "-Wextra",
388    ],
389}
390
391cc_test {
392    name: "timestampverifier_tests",
393    host_supported: true,
394
395    header_libs: ["libaudioutils_headers"],
396    srcs: ["timestampverifier_tests.cpp"],
397    cflags: [
398        "-Wall",
399        "-Werror",
400        "-Wextra",
401    ],
402}
403
404cc_test {
405    name: "variadic_tests",
406    host_supported: true,
407
408    shared_libs: ["libaudioutils"],
409    srcs: ["variadic_tests.cpp"],
410    cflags: [
411        "-Wall",
412        "-Werror",
413        "-Wextra",
414    ],
415}
416
417cc_test {
418    name: "logplot_tests",
419    host_supported: true,
420
421    shared_libs: [
422        "liblog",
423        "libcutils",
424    ],
425    srcs: ["logplot_tests.cpp"],
426    gtest:false,
427    cflags: [
428        "-Werror",
429        "-Wall",
430    ],
431    target: {
432        android: {
433            shared_libs: ["libaudioutils"],
434        },
435        host: {
436            static_libs: ["libaudioutils"],
437        },
438    }
439}
440
441cc_test {
442    name: "sample_tests",
443    host_supported: true,
444
445    shared_libs: [
446        "liblog",
447        "libcutils",
448    ],
449    srcs: ["sample_tests.cpp"],
450    cflags: [
451        "-Werror",
452        "-Wall",
453    ],
454    target: {
455        android: {
456            shared_libs: ["libaudioutils"],
457        },
458        host: {
459            static_libs: ["libaudioutils"],
460        },
461    }
462}
463
464cc_test {
465    name: "spdif_tests",
466    host_supported: true,
467
468    shared_libs: [
469        "libaudioutils",
470        "libaudiospdif",
471        "liblog",
472        "libcutils",
473    ],
474    srcs: ["spdif_tests.cpp"],
475    cflags: [
476        "-Werror",
477        "-Wall",
478    ],
479}
480