1// Build the unit tests for audio_utils
2
3cc_test {
4    name: "primitives_tests",
5    host_supported: true,
6
7    shared_libs: [
8        "liblog",
9        "libcutils",
10    ],
11    srcs: ["primitives_tests.cpp"],
12    cflags: [
13        "-Werror",
14        "-Wall",
15    ],
16    target: {
17        android: {
18            shared_libs: ["libaudioutils"],
19        },
20        host: {
21            static_libs: ["libaudioutils"],
22        },
23    }
24}
25
26cc_binary {
27    name: "primitives_benchmark",
28    host_supported: true,
29    target: {
30        darwin: {
31            enabled: false,
32        },
33    },
34
35    srcs: ["primitives_benchmark.cpp"],
36    cflags: [
37        "-Werror",
38        "-Wall",
39    ],
40    static_libs: [
41        "libgoogle-benchmark",
42        "libaudioutils",
43    ],
44}
45
46cc_binary {
47    name: "fifo_tests",
48    host_supported: true,
49    srcs: ["fifo_tests.cpp"],
50    shared_libs: ["libaudioutils"],
51    static_libs: ["libsndfile"],
52    cflags: [
53        "-Werror",
54        "-Wall",
55    ],
56}
57
58cc_binary {
59    name: "fifo_multiprocess",
60    host_supported: false,
61    srcs: ["fifo_multiprocess.cpp"],
62    shared_libs: ["libaudioutils", "libcutils"],
63    static_libs: ["libsndfile"],
64    cflags: [
65        "-Werror",
66        "-Wall",
67    ],
68}
69
70cc_binary_host {
71    name: "fifo_threads",
72    // TODO move getch.c and .h to a utility library
73    srcs: [
74        "fifo_threads.cpp",
75        "getch.c",
76    ],
77    static_libs: [
78        "libaudioutils",
79        "liblog",
80    ],
81    cflags: [
82        "-Werror",
83        "-Wall",
84    ],
85}
86
87cc_binary_host {
88    name: "limiter_tests",
89    srcs: ["limiter_tests.c"],
90    static_libs: ["libaudioutils"],
91    cflags: [
92        "-Werror",
93        "-Wall",
94        "-UNDEBUG",
95    ],
96}
97
98cc_test {
99    name: "power_tests",
100    host_supported: true,
101
102    shared_libs: [
103        "libcutils",
104        "liblog",
105    ],
106    srcs: ["power_tests.cpp"],
107    cflags: [
108        "-Wall",
109        "-Werror",
110        "-Wextra",
111    ],
112    target: {
113        android: {
114            shared_libs: ["libaudioutils"],
115        },
116        host: {
117            static_libs: ["libaudioutils"],
118        },
119    }
120}
121
122cc_test {
123    name: "errorlog_tests",
124    host_supported: false,
125
126    shared_libs: [
127        "libcutils",
128        "liblog",
129    ],
130    srcs: ["errorlog_tests.cpp"],
131    cflags: [
132        "-Wall",
133        "-Werror",
134        "-Wextra",
135    ],
136    target: {
137        android: {
138            shared_libs: ["libaudioutils"],
139        },
140        host: {
141            static_libs: ["libaudioutils"],
142        },
143    }
144}
145
146cc_test {
147    name: "powerlog_tests",
148    host_supported: false,
149
150    shared_libs: [
151        "libcutils",
152        "liblog",
153    ],
154    srcs: ["powerlog_tests.cpp"],
155    cflags: [
156        "-Wall",
157        "-Werror",
158        "-Wextra",
159    ],
160    target: {
161        android: {
162            shared_libs: ["libaudioutils"],
163        },
164        host: {
165            static_libs: ["libaudioutils"],
166        },
167    }
168}
169
170cc_test {
171    name: "simplelog_tests",
172    host_supported: false,
173
174    shared_libs: [
175        "libcutils",
176        "liblog",
177    ],
178    srcs: ["simplelog_tests.cpp"],
179    cflags: [
180        "-Wall",
181        "-Werror",
182        "-Wextra",
183    ],
184    target: {
185        android: {
186            shared_libs: ["libaudioutils"],
187        },
188        host: {
189            static_libs: ["libaudioutils"],
190        },
191    }
192}
193
194cc_test {
195    name: "channels_tests",
196    host_supported: true,
197
198    shared_libs: [
199        "libcutils",
200        "liblog",
201    ],
202    srcs: ["channels_tests.cpp"],
203    cflags: [
204        "-Wall",
205        "-Werror",
206    ],
207    target: {
208        android: {
209            shared_libs: ["libaudioutils"],
210        },
211        host: {
212            static_libs: ["libaudioutils"],
213        },
214    }
215}
216
217cc_test {
218    name: "string_tests",
219    host_supported: false,
220
221    shared_libs: ["libaudioutils"],
222    srcs: ["string_tests.cpp"],
223    cflags: [
224        "-Wall",
225        "-Werror",
226    ],
227}
228
229cc_test {
230    name: "format_tests",
231    host_supported: true,
232
233    shared_libs: [
234        "liblog",
235    ],
236    srcs: ["format_tests.cpp"],
237    cflags: [
238        "-Werror",
239        "-Wall",
240    ],
241    target: {
242        android: {
243            shared_libs: ["libaudioutils"],
244        },
245        host: {
246            static_libs: ["libaudioutils"],
247        },
248    }
249}
250