1package {
2    default_team: "trendy_team_media_framework_audio",
3    // See: http://go/android-license-faq
4    // A large-scale-change added 'default_applicable_licenses' to import
5    // all of the 'license_kinds' from "frameworks_av_license"
6    // to get the below license kinds:
7    //   SPDX-license-identifier-Apache-2.0
8    default_applicable_licenses: ["frameworks_av_license"],
9}
10
11cc_defaults {
12    name: "libaaudio_tests_defaults",
13    cflags: [
14        "-Wall",
15        "-Werror",
16    ],
17
18    sanitize: {
19        integer_overflow: true,
20        misc_undefined: ["bounds"],
21    },
22}
23
24cc_test {
25    name: "test_aaudio_marshalling",
26    defaults: ["libaaudio_tests_defaults"],
27    srcs: ["test_marshalling.cpp"],
28    shared_libs: [
29        "aaudio-aidl-cpp",
30        "libaaudio_internal",
31        "libbinder",
32        "libcutils",
33        "libutils",
34        "shared-file-region-aidl-cpp",
35    ],
36}
37
38cc_test {
39    name: "test_clock_model",
40    defaults: ["libaaudio_tests_defaults"],
41    srcs: ["test_clock_model.cpp"],
42    shared_libs: [
43        "libaaudio_internal",
44        "libaudioutils",
45        "libcutils",
46        "libutils",
47    ],
48}
49
50cc_test {
51    name: "test_block_adapter",
52    defaults: ["libaaudio_tests_defaults"],
53    srcs: ["test_block_adapter.cpp"],
54    shared_libs: ["libaaudio_internal"],
55}
56
57cc_binary {
58    name: "test_timestamps",
59    defaults: ["libaaudio_tests_defaults"],
60    srcs: ["test_timestamps.cpp"],
61    header_libs: ["libaaudio_example_utils"],
62    shared_libs: ["libaaudio"],
63}
64
65cc_test {
66    name: "test_open_params",
67    defaults: ["libaaudio_tests_defaults"],
68    srcs: ["test_open_params.cpp"],
69    shared_libs: ["libaaudio"],
70}
71
72cc_binary {
73    name: "test_no_close",
74    defaults: ["libaaudio_tests_defaults"],
75    srcs: ["test_no_close.cpp"],
76    shared_libs: ["libaaudio"],
77}
78
79cc_binary {
80    name: "test_aaudio_recovery",
81    defaults: ["libaaudio_tests_defaults"],
82    srcs: ["test_recovery.cpp"],
83    shared_libs: ["libaaudio"],
84}
85
86cc_binary {
87    name: "test_n_streams",
88    defaults: ["libaaudio_tests_defaults"],
89    srcs: ["test_n_streams.cpp"],
90    shared_libs: ["libaaudio"],
91}
92
93cc_binary {
94    name: "test_bad_disconnect",
95    defaults: ["libaaudio_tests_defaults"],
96    srcs: ["test_bad_disconnect.cpp"],
97    shared_libs: ["libaaudio"],
98}
99
100cc_test {
101    name: "test_various",
102    defaults: ["libaaudio_tests_defaults"],
103    srcs: ["test_various.cpp"],
104    shared_libs: ["libaaudio"],
105}
106
107cc_test {
108    name: "test_session_id",
109    defaults: ["libaaudio_tests_defaults"],
110    srcs: ["test_session_id.cpp"],
111    shared_libs: ["libaaudio"],
112}
113
114cc_binary {
115    name: "test_aaudio_monkey",
116    defaults: ["libaaudio_tests_defaults"],
117    srcs: ["test_aaudio_monkey.cpp"],
118    header_libs: ["libaaudio_example_utils"],
119    shared_libs: ["libaaudio"],
120}
121
122cc_test {
123    name: "test_attributes",
124    defaults: ["libaaudio_tests_defaults"],
125    srcs: ["test_attributes.cpp"],
126    shared_libs: ["libaaudio"],
127}
128
129cc_test {
130    name: "test_interference",
131    defaults: ["libaaudio_tests_defaults"],
132    srcs: ["test_interference.cpp"],
133    shared_libs: ["libaaudio"],
134}
135
136cc_test {
137    name: "test_atomic_fifo",
138    defaults: ["libaaudio_tests_defaults"],
139    srcs: ["test_atomic_fifo.cpp"],
140    shared_libs: ["libaaudio_internal"],
141}
142
143cc_test {
144    name: "test_flowgraph",
145    defaults: ["libaaudio_tests_defaults"],
146    srcs: ["test_flowgraph.cpp"],
147    shared_libs: [
148        "libaaudio_internal",
149        "libaudioutils",
150        "libbinder",
151        "libcutils",
152        "libutils",
153    ],
154}
155
156cc_test {
157    name: "test_monotonic_counter",
158    defaults: ["libaaudio_tests_defaults"],
159    srcs: ["test_monotonic_counter.cpp"],
160    shared_libs: [
161        "libaaudio_internal",
162        "libbinder",
163        "libcutils",
164        "libutils",
165    ],
166}
167
168cc_binary {
169    name: "test_return_stop",
170    defaults: ["libaaudio_tests_defaults"],
171    srcs: ["test_return_stop.cpp"],
172    shared_libs: ["libaaudio"],
173}
174
175cc_test {
176    name: "test_callback_race",
177    defaults: ["libaaudio_tests_defaults"],
178    srcs: ["test_callback_race.cpp"],
179    shared_libs: ["libaaudio"],
180}
181
182cc_test {
183    name: "test_full_queue",
184    defaults: ["libaaudio_tests_defaults"],
185    srcs: ["test_full_queue.cpp"],
186    shared_libs: [
187        "libaaudio",
188        "liblog",
189    ],
190}
191
192cc_test {
193    name: "test_histogram",
194    defaults: ["libaaudio_tests_defaults"],
195    srcs: ["test_histogram.cpp"],
196    shared_libs: [
197        "libaudioutils",
198        "libcutils",
199        "libutils",
200    ],
201}
202
203cc_binary {
204    name: "test_steal_exclusive",
205    defaults: ["libaaudio_tests_defaults"],
206    srcs: ["test_steal_exclusive.cpp"],
207    shared_libs: [
208        "libaaudio",
209        "libbinder",
210        "libcutils",
211        "liblog",
212        "libutils",
213    ],
214}
215
216cc_binary {
217    name: "test_disconnect_race",
218    defaults: ["libaaudio_tests_defaults"],
219    srcs: ["test_disconnect_race.cpp"],
220    shared_libs: ["libaaudio"],
221}
222
223cc_test {
224    name: "aaudio_test_mmap_path",
225    defaults: [
226        "libaaudio_tests_defaults",
227    ],
228    srcs: ["test_mmap_path.cpp"],
229    shared_libs: [
230        "libaaudio",
231        "libaaudio_internal",
232        "libaudioclient",
233        "liblog",
234    ],
235}
236
237cc_test {
238    name: "test_resampler",
239    defaults: ["libaaudio_tests_defaults"],
240    srcs: ["test_resampler.cpp"],
241    shared_libs: [
242        "libaaudio_internal",
243    ],
244}
245
246cc_binary {
247    name: "test_idle_disconnected_shared_stream",
248    defaults: ["libaaudio_tests_defaults"],
249    srcs: ["test_idle_disconnected_shared_stream.cpp"],
250    shared_libs: ["libaaudio"],
251}
252
253cc_test {
254    name: "test_multiple_close_simultaneously",
255    defaults: [
256        "latest_android_media_audio_common_types_cpp_shared",
257        "libaaudio_tests_defaults",
258    ],
259    srcs: ["test_multiple_close_simultaneously.cpp"],
260    shared_libs: [
261        "aaudio-aidl-cpp",
262        "framework-permission-aidl-cpp",
263        "libaaudio",
264        "libbinder",
265        "liblog",
266        "libutils",
267    ],
268    // This test will run 1 minute to ensure there is no crash happen.
269    // In that case, set the timeout as 2 minutes to allow the test to complete.
270    test_options: {
271        test_runner_options: [
272            {
273                name: "native-test-timeout",
274                value: "2m",
275            },
276        ],
277    },
278}
279