• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Build the unit tests for audio_utils
2
3package {
4    default_team: "trendy_team_android_media_audio_framework",
5    // http://go/android-license-faq
6    // A large-scale-change added 'default_applicable_licenses' to import
7    // the below license kinds from "system_media_license":
8    //   SPDX-license-identifier-Apache-2.0
9    default_applicable_licenses: ["system_media_license"],
10}
11
12cc_test {
13    name: "audio_commandthread_tests",
14    host_supported: true,
15    srcs: ["audio_commandthread_tests.cpp"],
16    shared_libs: [
17        "libbase",
18        "libbinder",
19    ],
20    header_libs: [
21        "libaudioutils_headers",
22    ],
23    cflags: [
24        "-Wall",
25        "-Werror",
26        "-Wthread-safety",
27    ],
28}
29
30cc_test {
31    name: "audio_deferredexecutor_tests",
32    host_supported: true,
33    srcs: ["audio_deferredexecutor_tests.cpp"],
34    shared_libs: [
35        "libbase",
36    ],
37    header_libs: [
38        "libaudioutils_headers",
39    ],
40    cflags: [
41        "-Wall",
42        "-Werror",
43        "-Wthread-safety",
44    ],
45}
46
47cc_test {
48    name: "audio_dsp_tests",
49    host_supported: true,
50    srcs: ["audio_dsp_tests.cpp"],
51    shared_libs: [
52        "libbase",
53        "liblog",
54    ],
55    header_libs: [
56        "libaudioutils_headers",
57    ],
58    cflags: [
59        "-Wall",
60        "-Werror",
61        "-Wthread-safety",
62    ],
63}
64
65cc_test {
66    name: "audio_float_tests",
67    host_supported: true,
68    srcs: ["audio_float_tests.cpp"],
69    shared_libs: [
70        "libbase",
71        "libbinder",
72    ],
73    header_libs: [
74        "libaudioutils_headers",
75    ],
76    cflags: [
77        "-Wall",
78        "-Werror",
79        "-Wthread-safety",
80    ],
81}
82
83cc_test {
84    name: "audio_linkedhashmap_tests",
85    host_supported: true,
86    srcs: ["audio_linkedhashmap_tests.cpp"],
87    shared_libs: [
88        "libbase",
89    ],
90    header_libs: [
91        "libaudioutils_headers",
92    ],
93    cflags: [
94        "-Wall",
95        "-Werror",
96        "-Wthread-safety",
97    ],
98}
99
100cc_defaults {
101    name: "audio_math_test_defaults",
102    host_supported: true,
103
104    srcs: [
105        "audio_math_tests.cpp",
106    ],
107
108    shared_libs: [
109        "libbase",
110        "liblog",
111        "libutils",
112    ],
113
114    static_libs: [
115        "libaudioutils",
116    ],
117
118    cflags: [
119        "-Wall",
120        "-Werror",
121        "-Wextra",
122    ],
123}
124
125cc_test {
126    name: "audio_fast_math_tests",
127    defaults: [
128        "audio_math_test_defaults",
129    ],
130    cflags: [
131        "-DFAST_MATH_ENABLED",
132        "-ffast-math",
133        "-fhonor-infinities",
134        "-fhonor-nans",
135    ],
136}
137
138cc_test {
139    name: "audio_math_tests",
140    defaults: [
141        "audio_math_test_defaults",
142    ],
143}
144
145cc_test {
146    name: "audio_mutex_tests",
147    host_supported: true,
148
149    srcs: [
150        "audio_mutex_tests.cpp",
151    ],
152
153    shared_libs: [
154        "libaudioutils",
155        "libbase",
156        "liblog",
157        "libutils",
158    ],
159
160    cflags: [
161        "-Wall",
162        "-Werror",
163        "-Wextra",
164        "-Wthread-safety",
165    ],
166}
167
168cc_test {
169    name: "audio_stringutils_tests",
170    host_supported: true,
171
172    srcs: [
173        "audio_stringutils_tests.cpp",
174    ],
175
176    shared_libs: [
177        "libbase",
178        "liblog",
179        "libutils",
180    ],
181
182    static_libs: [
183        "libaudioutils",
184    ],
185
186    cflags: [
187        "-Wall",
188        "-Werror",
189        "-Wextra",
190        "-Wthread-safety",
191    ],
192}
193
194cc_test {
195    name: "audio_thread_tests",
196
197    srcs: [
198        "audio_thread_tests.cpp",
199    ],
200
201    shared_libs: [
202        "libbase",
203        "liblog",
204        "libutils",
205    ],
206
207    static_libs: [
208        "libaudioutils",
209    ],
210
211    cflags: [
212        "-Wall",
213        "-Werror",
214        "-Wextra",
215        "-Wthread-safety",
216    ],
217}
218
219cc_test {
220    name: "audio_trace_tests",
221    host_supported: true,
222    srcs: ["audio_trace_tests.cpp"],
223    shared_libs: [
224        "libbase",
225        "libbinder",
226    ],
227    header_libs: [
228        "libaudioutils_headers",
229    ],
230    cflags: [
231        "-Wall",
232        "-Werror",
233        "-Wthread-safety",
234    ],
235}
236
237cc_test {
238    name: "audio_nnapi_tests",
239
240    srcs: [
241        "audio_nnapi2_tests.cpp",
242        "audio_nnapi_tests.cpp",
243    ],
244
245    header_libs: [
246        "libaudioutils_headers",
247    ],
248
249    shared_libs: [
250        "libandroid",
251        "libbase",
252        "liblog",
253        "libnativewindow",
254        "libneuralnetworks",
255    ],
256
257    cflags: [
258        "-Wall",
259        "-Werror",
260        "-Wextra",
261        "-Wno-deprecated-declarations",
262    ],
263}
264
265cc_test {
266    name: "audio_tflite_tests",
267
268    srcs: [
269        "audio_tflite_tests.cpp",
270    ],
271
272    header_libs: [
273        "flatbuffer_headers",
274        "tensorflow_headers",
275    ],
276
277    shared_libs: [
278        "libandroid",
279        "libbase",
280        "liblog",
281    ],
282
283    static_libs: [
284        "libgmock",
285        "libtflite_static",
286    ],
287
288    cflags: [
289        "-Wall",
290        "-Werror",
291        "-Wextra",
292    ],
293}
294
295cc_test {
296    name: "balance_tests",
297    host_supported: true,
298
299    srcs: [
300        "balance_tests.cpp",
301    ],
302
303    static_libs: [
304        "libaudioutils",
305    ],
306
307    cflags: [
308        "-Wall",
309        "-Werror",
310        "-Wextra",
311    ],
312}
313
314cc_binary {
315    name: "biquad_filter",
316    host_supported: true,
317
318    srcs: [
319        "biquad_filter.cpp",
320    ],
321
322    shared_libs: [
323        "libaudioutils",
324    ],
325
326    cflags: [
327        "-Wall",
328        "-Werror",
329        "-Wextra",
330    ],
331}
332
333cc_test {
334    name: "circular_buffer_tests",
335    host_supported: true,
336
337    srcs: [
338        "circular_buffer_tests.cpp",
339    ],
340
341    static_libs: [
342        "libaudioutils",
343    ],
344
345    cflags: [
346        "-Wall",
347        "-Werror",
348        "-Wextra",
349    ],
350}
351
352cc_test {
353    name: "mel_aggregator_tests",
354    host_supported: true,
355
356    srcs: [
357        "mel_aggregator_tests.cpp",
358    ],
359
360    shared_libs: [
361        "libaudioutils",
362        "liblog",
363        "libutils",
364    ],
365
366    static_libs: [
367        "libgmock",
368    ],
369
370    cflags: [
371        "-Wall",
372        "-Werror",
373        "-Wextra",
374        "-Wthread-safety",
375    ],
376}
377
378cc_test {
379    name: "mel_processor_tests",
380    host_supported: true,
381
382    srcs: [
383        "mel_processor_tests.cpp",
384    ],
385
386    shared_libs: [
387        "libaudioutils",
388        "liblog",
389        "libutils",
390    ],
391
392    static_libs: [
393        "libgmock",
394    ],
395
396    cflags: [
397        "-Wall",
398        "-Werror",
399        "-Wextra",
400        "-Wthread-safety",
401    ],
402}
403
404cc_test {
405    name: "biquad_filter_tests",
406    host_supported: true,
407
408    srcs: [
409        "biquad_filter_tests.cpp",
410    ],
411
412    header_libs: [
413        "libaudioutils_headers",
414    ],
415
416    static_libs: [
417        "libgmock",
418    ],
419
420    cflags: [
421        "-Wall",
422        "-Werror",
423        "-Wextra",
424    ],
425}
426
427cc_test {
428    name: "channelmix_tests",
429    host_supported: true,
430
431    shared_libs: [
432        "libcutils",
433        "liblog",
434    ],
435
436    static_libs: [
437        "libaudioutils",
438    ],
439
440    srcs: ["channelmix_tests.cpp"],
441    cflags: [
442        "-Wall",
443        "-Werror",
444        "-Wextra",
445    ],
446}
447
448cc_test {
449    name: "fdtostring_tests",
450    host_supported: true,
451
452    shared_libs: [
453        "libaudioutils",
454        "libcutils",
455        "liblog",
456        "libutils", //for systemTime
457    ],
458    srcs: ["fdtostring_tests.cpp"],
459    cflags: [
460        "-Wall",
461        "-Werror",
462        "-Wextra",
463    ],
464}
465
466cc_test {
467    name: "hal_smoothness_tests",
468    host_supported: true,
469
470    srcs: [
471        "hal_smoothness_tests.cpp",
472    ],
473
474    static_libs: [
475        "libaudioutils",
476        "liblog",
477    ],
478
479    cflags: [
480        "-Wall",
481        "-Werror",
482        "-Wextra",
483    ],
484}
485
486cc_test {
487    name: "intrinsic_tests",
488    host_supported: true,
489
490    srcs: [
491        "intrinsic_tests.cpp",
492    ],
493
494    header_libs: [
495        "libaudioutils_headers",
496    ],
497
498    cflags: [
499        "-Wall",
500        "-Werror",
501        "-Wextra",
502    ],
503}
504
505cc_test {
506    name: "primitives_tests",
507    host_supported: true,
508
509    shared_libs: [
510        "libcutils",
511        "liblog",
512    ],
513    srcs: ["primitives_tests.cpp"],
514    cflags: [
515        "-Wall",
516        "-Werror",
517    ],
518    target: {
519        android: {
520            shared_libs: ["libaudioutils"],
521        },
522        host: {
523            static_libs: ["libaudioutils"],
524        },
525    },
526}
527
528cc_binary {
529    name: "fifo_tests",
530    host_supported: true,
531    srcs: ["fifo_tests.cpp"],
532    shared_libs: ["libaudioutils"],
533    static_libs: ["libsndfile"],
534    cflags: [
535        "-Wall",
536        "-Werror",
537    ],
538}
539
540cc_binary {
541    name: "fifo_multiprocess",
542    host_supported: true,
543    srcs: ["fifo_multiprocess.cpp"],
544    shared_libs: [
545        "libaudioutils",
546        "libcutils",
547    ],
548    static_libs: ["libsndfile"],
549    cflags: [
550        "-Wall",
551        "-Werror",
552    ],
553}
554
555cc_binary_host {
556    name: "fifo_threads",
557    // TODO move getch.c and .h to a utility library
558    srcs: [
559        "fifo_threads.cpp",
560        "getch.c",
561    ],
562    static_libs: [
563        "libaudioutils",
564        "liblog",
565    ],
566    cflags: [
567        "-Wall",
568        "-Werror",
569    ],
570}
571
572cc_binary_host {
573    name: "limiter_tests",
574    srcs: ["limiter_tests.c"],
575    static_libs: ["libaudioutils"],
576    cflags: [
577        "-UNDEBUG",
578        "-Wall",
579        "-Werror",
580    ],
581}
582
583cc_test {
584    name: "power_tests",
585    host_supported: true,
586
587    shared_libs: [
588        "libcutils",
589        "liblog",
590    ],
591    srcs: ["power_tests.cpp"],
592    cflags: [
593        "-Wall",
594        "-Werror",
595        "-Wextra",
596    ],
597    target: {
598        android: {
599            shared_libs: ["libaudioutils"],
600        },
601        host: {
602            static_libs: ["libaudioutils"],
603        },
604    },
605}
606
607cc_test {
608    name: "run_remote_tests",
609    host_supported: true,
610
611    shared_libs: [
612        "libcutils",
613        "liblog",
614    ],
615
616    static_libs: [
617        "libaudioutils",
618    ],
619
620    srcs: ["run_remote_tests.cpp"],
621    cflags: [
622        "-Wall",
623        "-Werror",
624        "-Wextra",
625    ],
626}
627
628cc_test {
629    name: "errorlog_tests",
630    host_supported: true,
631
632    shared_libs: [
633        "libcutils",
634        "liblog",
635    ],
636    srcs: ["errorlog_tests.cpp"],
637    cflags: [
638        "-Wall",
639        "-Werror",
640        "-Wextra",
641    ],
642    target: {
643        android: {
644            shared_libs: ["libaudioutils"],
645        },
646        host: {
647            static_libs: ["libaudioutils"],
648        },
649    },
650}
651
652cc_test {
653    name: "metadata_tests",
654    host_supported: false,
655
656    shared_libs: [
657        "libcutils",
658        "liblog",
659    ],
660    srcs: ["metadata_tests.cpp"],
661    cflags: [
662        "-Wall",
663        "-Werror",
664        "-Wextra",
665    ],
666    target: {
667        android: {
668            shared_libs: ["libaudioutils"],
669        },
670        host: {
671            static_libs: ["libaudioutils"],
672        },
673    },
674}
675
676cc_binary {
677    name: "metadata_c_tests",
678    host_supported: true,
679    srcs: ["metadata_tests_c.c"],
680    cflags: [
681        "-Wall",
682        "-Werror",
683        "-Wextra",
684    ],
685    shared_libs: ["libaudioutils"],
686}
687
688cc_test {
689    name: "powerlog_tests",
690    host_supported: true,
691
692    shared_libs: [
693        "libcutils",
694        "liblog",
695    ],
696    srcs: ["powerlog_tests.cpp"],
697    cflags: [
698        "-Wall",
699        "-Werror",
700        "-Wextra",
701    ],
702    target: {
703        android: {
704            shared_libs: ["libaudioutils"],
705        },
706        host: {
707            static_libs: ["libaudioutils"],
708        },
709    },
710}
711
712cc_test {
713    name: "simplelog_tests",
714    host_supported: true,
715
716    shared_libs: [
717        "libcutils",
718        "liblog",
719    ],
720    srcs: ["simplelog_tests.cpp"],
721    cflags: [
722        "-Wall",
723        "-Werror",
724        "-Wextra",
725    ],
726    target: {
727        android: {
728            shared_libs: ["libaudioutils"],
729        },
730        host: {
731            static_libs: ["libaudioutils"],
732        },
733    },
734}
735
736cc_test {
737    name: "channels_tests",
738    host_supported: true,
739
740    shared_libs: [
741        "libcutils",
742        "liblog",
743    ],
744    srcs: ["channels_tests.cpp"],
745    cflags: [
746        "-Wall",
747        "-Werror",
748    ],
749    target: {
750        android: {
751            shared_libs: ["libaudioutils"],
752        },
753        host: {
754            static_libs: ["libaudioutils"],
755        },
756    },
757}
758
759cc_test {
760    name: "string_tests",
761    host_supported: true,
762
763    shared_libs: ["libaudioutils"],
764    srcs: ["string_tests.cpp"],
765    cflags: [
766        "-Wall",
767        "-Werror",
768    ],
769    target: {
770        host: {
771            shared_libs: ["libcutils"],
772        },
773    },
774}
775
776cc_test {
777    name: "format_tests",
778    host_supported: true,
779
780    shared_libs: [
781        "liblog",
782    ],
783    srcs: ["format_tests.cpp"],
784    cflags: [
785        "-Wall",
786        "-Werror",
787    ],
788    target: {
789        android: {
790            shared_libs: ["libaudioutils"],
791        },
792        host: {
793            static_libs: ["libaudioutils"],
794        },
795    },
796}
797
798cc_test {
799    name: "statistics_tests",
800    host_supported: true,
801
802    header_libs: ["libaudioutils_headers"],
803    srcs: ["statistics_tests.cpp"],
804    cflags: [
805        "-Wall",
806        "-Werror",
807        "-Wextra",
808    ],
809}
810
811cc_test {
812    name: "timestampverifier_tests",
813    host_supported: true,
814
815    header_libs: ["libaudioutils_headers"],
816    srcs: ["timestampverifier_tests.cpp"],
817    cflags: [
818        "-Wall",
819        "-Werror",
820        "-Wextra",
821    ],
822}
823
824cc_test {
825    name: "variadic_tests",
826    host_supported: true,
827
828    shared_libs: ["libaudioutils"],
829    srcs: ["variadic_tests.cpp"],
830    cflags: [
831        "-Wall",
832        "-Werror",
833        "-Wextra",
834    ],
835}
836
837cc_test {
838    name: "logplot_tests",
839    host_supported: true,
840
841    shared_libs: [
842        "libcutils",
843        "liblog",
844    ],
845    srcs: ["logplot_tests.cpp"],
846    cflags: [
847        "-Wall",
848        "-Werror",
849    ],
850    target: {
851        android: {
852            shared_libs: ["libaudioutils"],
853        },
854        host: {
855            static_libs: ["libaudioutils"],
856        },
857    },
858}
859
860cc_test {
861    name: "sample_tests",
862    host_supported: true,
863
864    shared_libs: [
865        "libcutils",
866        "liblog",
867    ],
868    srcs: ["sample_tests.cpp"],
869    cflags: [
870        "-Wall",
871        "-Werror",
872    ],
873    target: {
874        android: {
875            shared_libs: ["libaudioutils"],
876        },
877        host: {
878            static_libs: ["libaudioutils"],
879        },
880    },
881}
882
883cc_test {
884    name: "spatializer_utils_tests",
885    host_supported: true,
886
887    shared_libs: [
888        "libaudioutils",
889        "libcutils",
890        "liblog",
891    ],
892    srcs: ["spatializer_utils_tests.cpp"],
893    cflags: [
894        "-Wall",
895        "-Werror",
896    ],
897}
898
899cc_test {
900    name: "spdif_tests",
901    host_supported: true,
902
903    shared_libs: [
904        "libaudiospdif",
905        "libaudioutils",
906        "libcutils",
907        "liblog",
908    ],
909    srcs: ["spdif_tests.cpp"],
910    cflags: [
911        "-Wall",
912        "-Werror",
913    ],
914}
915