blob: 9b587bb680e9bb0fee944dafb21ce78add19890f [file] [log] [blame]
Dan Willemsen59e086f2016-07-25 17:13:45 -07001//
2// Copyright (C) 2014 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Bob Badour3c538232021-02-12 21:26:48 -080017package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "frameworks_native_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["frameworks_native_license"],
24}
25
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070026cc_defaults {
27 name: "binder_test_defaults",
28 cflags: [
29 "-Wall",
30 "-Werror",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070031 ],
32}
33
Dan Willemsen59e086f2016-07-25 17:13:45 -070034cc_test {
Hsin-Yi Chen69295752017-06-07 18:05:05 +080035 name: "binderDriverInterfaceTest_IPC_32",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070036 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -070037 srcs: ["binderDriverInterfaceTest.cpp"],
Yifan Hong4e419d82021-04-26 11:32:56 -070038 header_libs: ["libbinder_headers"],
Hsin-Yi Chen69295752017-06-07 18:05:05 +080039 compile_multilib: "32",
Steven Morelandea7659e2022-02-03 00:04:06 +000040 multilib: {
41 lib32: {
42 suffix: "",
43 },
44 },
Hsin-Yi Chen69295752017-06-07 18:05:05 +080045 cflags: ["-DBINDER_IPC_32BIT=1"],
Steven Morelandf9f3de22020-05-06 17:14:39 -070046 test_suites: ["vts"],
Hsin-Yi Chen69295752017-06-07 18:05:05 +080047}
48
49cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070050 name: "binderDriverInterfaceTest",
51 defaults: ["binder_test_defaults"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070052 product_variables: {
53 binder32bit: {
54 cflags: ["-DBINDER_IPC_32BIT=1"],
55 },
56 },
Yifan Hong4e419d82021-04-26 11:32:56 -070057 header_libs: ["libbinder_headers"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070058 srcs: ["binderDriverInterfaceTest.cpp"],
Steven Morelandea7659e2022-02-03 00:04:06 +000059 test_suites: [
60 "device-tests",
61 "vts",
62 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070063}
64
65cc_test {
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080066 name: "binderLibTest_IPC_32",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070067 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -070068 srcs: ["binderLibTest.cpp"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080069 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -070070 "libbase",
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080071 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -070072 "liblog",
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080073 "libutils",
74 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -070075 static_libs: [
76 "libgmock",
77 ],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080078 compile_multilib: "32",
Steven Morelandea7659e2022-02-03 00:04:06 +000079 multilib: {
80 lib32: {
81 suffix: "",
82 },
83 },
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080084 cflags: ["-DBINDER_IPC_32BIT=1"],
Steven Morelandf9f3de22020-05-06 17:14:39 -070085 test_suites: ["vts"],
86 require_root: true,
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080087}
88
Steven Morelandcefba612020-11-05 22:57:06 +000089// unit test only, which can run on host and doesn't use /dev/binder
90cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000091 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000092 host_supported: true,
93 target: {
94 darwin: {
95 enabled: false,
96 },
97 },
Steven Morelandea7659e2022-02-03 00:04:06 +000098 srcs: [
99 "binderParcelUnitTest.cpp",
100 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +0000101 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -0500102 "binderMemoryHeapBaseUnitTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +0000103 ],
Steven Morelandcefba612020-11-05 22:57:06 +0000104 shared_libs: [
105 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -0700106 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +0000107 "libutils",
108 ],
109 test_suites: ["general-tests"],
110}
111
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800112cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700113 name: "binderLibTest",
114 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800115 product_variables: {
116 binder32bit: {
117 cflags: ["-DBINDER_IPC_32BIT=1"],
118 },
119 },
120
Dan Willemsen59e086f2016-07-25 17:13:45 -0700121 srcs: ["binderLibTest.cpp"],
122 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700123 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700124 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700125 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700126 "libutils",
127 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700128 static_libs: [
129 "libgmock",
130 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000131 test_suites: [
132 "device-tests",
133 "vts",
134 ],
Dan Shi80ada592019-09-13 09:17:17 -0700135 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700136}
137
Steven Moreland37aff182021-03-26 02:04:16 +0000138aidl_interface {
139 name: "binderRpcTestIface",
140 host_supported: true,
141 unstable: true,
142 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700143 "BinderRpcTestClientInfo.aidl",
144 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000145 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000146 "IBinderRpcSession.aidl",
147 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700148 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000149 ],
150 backend: {
151 java: {
152 enabled: false,
153 },
154 },
155}
156
Yifan Honge0e53282021-09-23 18:37:21 -0700157cc_library_static {
158 name: "libbinder_tls_test_utils",
159 host_supported: true,
160 target: {
161 darwin: {
162 enabled: false,
163 },
164 },
165 defaults: [
166 "binder_test_defaults",
167 "libbinder_tls_shared_deps",
168 ],
169 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700170 "libbase",
171 "liblog",
172 ],
173 static_libs: [
174 "libbinder_tls_static",
175 ],
176 srcs: [
177 "RpcTlsTestUtils.cpp",
178 ],
179 export_include_dirs: [
180 "include_tls_test_utils",
181 ],
182 visibility: [
183 ":__subpackages__",
184 ],
185}
186
Andrei Homescu12106de2022-04-27 04:42:21 +0000187cc_defaults {
188 name: "binderRpcTest_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000189 host_supported: true,
190 target: {
191 darwin: {
192 enabled: false,
193 },
Steven Moreland1d448af2021-04-20 01:05:18 +0000194 android: {
195 test_suites: ["vts"],
196 },
Steven Morelandf6ec4632021-04-01 16:20:47 +0000197 },
Steven Moreland37aff182021-03-26 02:04:16 +0000198 defaults: [
199 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000200 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000201
202 srcs: [
Steven Moreland5553ac42020-11-11 02:14:45 +0000203 "binderRpcTest.cpp",
204 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000205
206 static_libs: [
207 "libbinder_tls_static",
208 "libbinder_tls_test_utils",
209 "binderRpcTestIface-cpp",
210 "binderRpcTestIface-ndk",
211 ],
212
213 test_suites: ["general-tests"],
214 require_root: true,
215}
216
217cc_test {
218 name: "binderRpcTest",
219 defaults: [
220 "binderRpcTest_defaults",
221 "libbinder_tls_shared_deps",
222 ],
223
224 cflags: [
225 "-DBINDER_WITH_KERNEL_IPC",
226 ],
227
Steven Moreland5553ac42020-11-11 02:14:45 +0000228 shared_libs: [
229 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000230 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000231 "libbase",
232 "libutils",
233 "libcutils",
234 "liblog",
235 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000236}
237
238cc_defaults {
239 name: "binderRpcTest_static_defaults",
240
241 shared_libs: [
242 "libutils",
243 // libcrypto_static is not visible to this module
244 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000245 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000246 static_libs: [
247 "libbase",
248 "libcutils",
249 "liblog",
250 "libssl",
251 ],
252
253 cflags: [
254 // Disable tests that require shared libraries,
255 // e.g., libbinder.so or libbinder_ndk.so
256 "-DBINDER_TEST_NO_SHARED_LIBS",
257 ],
258}
259
260cc_test {
261 name: "binderRpcTestNoKernel",
262 defaults: [
263 "binderRpcTest_defaults",
264 "binderRpcTest_static_defaults",
265 ],
266 static_libs: [
267 "libbinder_rpc_no_kernel",
268 ],
269}
270
271cc_test {
272 name: "binderRpcTestSingleThreaded",
273 defaults: [
274 "binderRpcTest_defaults",
275 "binderRpcTest_static_defaults",
276 ],
277 cflags: [
278 "-DBINDER_RPC_SINGLE_THREADED",
279 "-DBINDER_WITH_KERNEL_IPC",
280 ],
281 static_libs: [
282 "libbinder_rpc_single_threaded",
283 ],
284}
285
286cc_test {
287 name: "binderRpcTestSingleThreadedNoKernel",
288 defaults: [
289 "binderRpcTest_defaults",
290 "binderRpcTest_static_defaults",
291 ],
292 cflags: [
293 "-DBINDER_RPC_SINGLE_THREADED",
294 ],
295 static_libs: [
296 "libbinder_rpc_single_threaded_no_kernel",
297 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000298}
299
Yifan Hongff73aa92021-09-17 21:28:01 -0700300cc_test {
301 name: "RpcTlsUtilsTest",
302 host_supported: true,
303 target: {
304 darwin: {
305 enabled: false,
306 },
307 android: {
308 test_suites: ["vts"],
309 },
310 },
311 defaults: [
312 "binder_test_defaults",
313 "libbinder_tls_shared_deps",
314 ],
315 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700316 "RpcTlsUtilsTest.cpp",
317 ],
318 shared_libs: [
319 "libbinder",
320 "libbase",
321 "libutils",
322 "liblog",
323 ],
324 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700325 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700326 "libbinder_tls_static",
327 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000328 test_suites: [
329 "general-tests",
330 "device-tests",
331 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700332}
333
Steven Morelandcda60852021-04-14 23:45:32 +0000334cc_benchmark {
335 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700336 defaults: [
337 "binder_test_defaults",
338 "libbinder_tls_shared_deps",
339 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000340 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000341 target: {
342 darwin: {
343 enabled: false,
344 },
345 },
Steven Morelandcda60852021-04-14 23:45:32 +0000346 srcs: [
347 "binderRpcBenchmark.cpp",
348 "IBinderRpcBenchmark.aidl",
349 ],
350 shared_libs: [
351 "libbase",
352 "libbinder",
353 "liblog",
354 "libutils",
355 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700356 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700357 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700358 "libbinder_tls_static",
359 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000360}
361
Steven Moreland5553ac42020-11-11 02:14:45 +0000362cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700363 name: "binderRpcWireProtocolTest",
364 host_supported: true,
365 target: {
366 darwin: {
367 enabled: false,
368 },
369 android: {
370 test_suites: ["vts"],
371 },
372 },
373 defaults: [
374 "binder_test_defaults",
375 ],
376 srcs: [
377 "binderRpcWireProtocolTest.cpp",
378 ],
379 shared_libs: [
380 "libbinder",
381 "libbase",
382 "libutils",
383 "libcutils",
384 "liblog",
385 ],
386 test_suites: ["general-tests"],
387}
388
389cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700390 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700391 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700392 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700393 shared_libs: [
394 "libbinder",
395 "libutils",
396 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700397 cflags: [
398 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700399 "-Wno-missing-field-initializers",
400 "-Wno-sign-compare",
401 "-O3",
402 ],
403}
Wei Wang78f2a372016-10-20 23:18:17 -0700404
405cc_test {
406 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700407 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700408 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700409 shared_libs: [
410 "libbinder",
411 "libutils",
412 "libbase",
413 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700414 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700415}
Howard Chenc135dbc2017-03-25 17:12:59 +0800416
417cc_test {
418 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700419 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700420 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800421 shared_libs: [
422 "libbinder",
423 "libutils",
424 "libbase",
425 ],
426}
Dan Stozad630e522016-12-01 15:16:31 -0800427
428cc_test {
429 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700430 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700431 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800432
433 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800434 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800435 ],
436
437 cpp_std: "experimental",
438 gnu_extensions: false,
439
440 shared_libs: [
441 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700442 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800443 "liblog",
444 "libutils",
445 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000446 test_suites: [
447 "device-tests",
448 "vts",
449 ],
Dan Shi80ada592019-09-13 09:17:17 -0700450 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800451}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700452
Steven Morelandf23dae22020-10-27 19:34:55 +0000453cc_test {
454 name: "binderClearBufTest",
455 defaults: ["binder_test_defaults"],
456 srcs: [
457 "binderClearBufTest.cpp",
458 ],
459
460 shared_libs: [
461 "libbase",
462 "libbinder",
463 "liblog",
464 "libutils",
465 ],
466
467 test_suites: ["general-tests"],
468 require_root: true,
469}
470
Steven Moreland12300a02019-08-02 13:27:15 -0700471aidl_interface {
472 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900473 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700474 srcs: [
475 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700476 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000477 backend: {
478 java: {
479 enabled: false,
480 },
481 },
Steven Moreland12300a02019-08-02 13:27:15 -0700482}
483
Steven Morelanddea3cf92019-07-16 18:06:55 -0700484cc_test {
485 name: "binderStabilityTest",
486 defaults: ["binder_test_defaults"],
487 srcs: [
488 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700489 ],
490
Steven Moreland13f84662020-07-23 21:30:41 +0000491 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700492 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700493 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700494 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700495 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700496 "libutils",
497 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700498 static_libs: [
499 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900500 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700501 ],
502
Steven Morelandea7659e2022-02-03 00:04:06 +0000503 test_suites: [
504 "device-tests",
505 "vts",
506 ],
Dan Shi302709b2019-09-19 15:28:15 -0700507 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700508}
Steven Moreland042ae822020-05-27 17:45:17 +0000509
510cc_test {
511 name: "binderAllocationLimits",
512 defaults: ["binder_test_defaults"],
513 srcs: ["binderAllocationLimits.cpp"],
514 shared_libs: [
515 "libbinder",
516 "liblog",
517 "libutils",
518 "libutilscallstack",
519 "libbase",
520 ],
521 test_suites: ["device-tests"],
522 require_root: true,
523}
Andy Hung73a14702020-11-24 13:04:46 -0800524
525cc_benchmark {
526 name: "binderParcelBenchmark",
527 defaults: ["binder_test_defaults"],
528 srcs: ["binderParcelBenchmark.cpp"],
529 shared_libs: [
530 "libbase",
531 "libbinder",
532 "liblog",
533 "libutils",
534 ],
535}
Yifan Hongaf766e62021-06-14 13:24:19 -0700536
537cc_test_host {
538 name: "binderUtilsHostTest",
539 defaults: ["binder_test_defaults"],
540 srcs: ["binderUtilsHostTest.cpp"],
541 shared_libs: [
542 "libbase",
543 "libbinder",
544 ],
545 static_libs: [
546 "libgmock",
547 ],
548 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700549 target: {
550 darwin: {
551 enabled: false,
552 },
553 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700554}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700555
556cc_test_host {
557 name: "binderHostDeviceTest",
558 defaults: ["binder_test_defaults"],
559 srcs: ["binderHostDeviceTest.cpp"],
560 test_config: "binderHostDeviceTest.xml",
561 shared_libs: [
562 "libbase",
563 "libbinder",
564 "liblog",
565 "libutils",
566 ],
567 static_libs: [
568 "libgmock",
569 ],
570 target_required: [
571 "binderHostDeviceTestService",
572 ],
573 test_suites: ["general-tests"],
574 target: {
575 darwin: {
576 enabled: false,
577 },
578 },
579 test_options: {
580 unit_test: false,
581 },
582}
583
584cc_test {
585 name: "binderHostDeviceTestService",
586 // The binary is named differently from the module so that PushFilePreparer pushes the binary
587 // directly, not the test module directory.
588 stem: "binderHostDeviceTest-service",
589 defaults: ["binder_test_defaults"],
590 gtest: false,
591 auto_gen_config: false,
592 srcs: ["binderHostDeviceTestService.cpp"],
593 shared_libs: [
594 "libbase",
595 "libbinder",
596 "liblog",
597 "libutils",
598 ],
599 test_suites: ["general-tests"],
600}