blob: a3533d831bfc9cbf9e9c3a4e36358c9e8f24273e [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: [
170 "libbinder",
171 "libbase",
172 "liblog",
173 ],
174 static_libs: [
175 "libbinder_tls_static",
176 ],
177 srcs: [
178 "RpcTlsTestUtils.cpp",
179 ],
180 export_include_dirs: [
181 "include_tls_test_utils",
182 ],
183 visibility: [
184 ":__subpackages__",
185 ],
186}
187
Dan Willemsen59e086f2016-07-25 17:13:45 -0700188cc_test {
Steven Moreland5553ac42020-11-11 02:14:45 +0000189 name: "binderRpcTest",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000190 host_supported: true,
191 target: {
192 darwin: {
193 enabled: false,
194 },
Steven Moreland1d448af2021-04-20 01:05:18 +0000195 android: {
196 test_suites: ["vts"],
197 },
Steven Morelandf6ec4632021-04-01 16:20:47 +0000198 },
Steven Moreland37aff182021-03-26 02:04:16 +0000199 defaults: [
200 "binder_test_defaults",
Yifan Hong92409752021-07-30 21:25:32 -0700201 "libbinder_tls_shared_deps",
Steven Moreland37aff182021-03-26 02:04:16 +0000202 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000203
204 srcs: [
Steven Moreland5553ac42020-11-11 02:14:45 +0000205 "binderRpcTest.cpp",
206 ],
207 shared_libs: [
208 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000209 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000210 "libbase",
211 "libutils",
212 "libcutils",
213 "liblog",
214 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000215 static_libs: [
Yifan Hong92409752021-07-30 21:25:32 -0700216 "libbinder_tls_static",
Yifan Honge0e53282021-09-23 18:37:21 -0700217 "libbinder_tls_test_utils",
Steven Moreland37aff182021-03-26 02:04:16 +0000218 "binderRpcTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900219 "binderRpcTestIface-ndk",
Steven Moreland37aff182021-03-26 02:04:16 +0000220 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000221 test_suites: ["general-tests"],
222 require_root: true,
223}
224
Yifan Hongff73aa92021-09-17 21:28:01 -0700225cc_test {
226 name: "RpcTlsUtilsTest",
227 host_supported: true,
228 target: {
229 darwin: {
230 enabled: false,
231 },
232 android: {
233 test_suites: ["vts"],
234 },
235 },
236 defaults: [
237 "binder_test_defaults",
238 "libbinder_tls_shared_deps",
239 ],
240 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700241 "RpcTlsUtilsTest.cpp",
242 ],
243 shared_libs: [
244 "libbinder",
245 "libbase",
246 "libutils",
247 "liblog",
248 ],
249 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700250 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700251 "libbinder_tls_static",
252 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000253 test_suites: [
254 "general-tests",
255 "device-tests",
256 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700257}
258
Steven Morelandcda60852021-04-14 23:45:32 +0000259cc_benchmark {
260 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700261 defaults: [
262 "binder_test_defaults",
263 "libbinder_tls_shared_deps",
264 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000265 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000266 target: {
267 darwin: {
268 enabled: false,
269 },
270 },
Steven Morelandcda60852021-04-14 23:45:32 +0000271 srcs: [
272 "binderRpcBenchmark.cpp",
273 "IBinderRpcBenchmark.aidl",
274 ],
275 shared_libs: [
276 "libbase",
277 "libbinder",
278 "liblog",
279 "libutils",
280 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700281 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700282 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700283 "libbinder_tls_static",
284 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000285}
286
Steven Moreland5553ac42020-11-11 02:14:45 +0000287cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700288 name: "binderRpcWireProtocolTest",
289 host_supported: true,
290 target: {
291 darwin: {
292 enabled: false,
293 },
294 android: {
295 test_suites: ["vts"],
296 },
297 },
298 defaults: [
299 "binder_test_defaults",
300 ],
301 srcs: [
302 "binderRpcWireProtocolTest.cpp",
303 ],
304 shared_libs: [
305 "libbinder",
306 "libbase",
307 "libutils",
308 "libcutils",
309 "liblog",
310 ],
311 test_suites: ["general-tests"],
312}
313
314cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700315 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700316 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700317 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700318 shared_libs: [
319 "libbinder",
320 "libutils",
321 ],
322 clang: true,
323 cflags: [
324 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700325 "-Wno-missing-field-initializers",
326 "-Wno-sign-compare",
327 "-O3",
328 ],
329}
Wei Wang78f2a372016-10-20 23:18:17 -0700330
331cc_test {
332 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700333 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700334 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700335 shared_libs: [
336 "libbinder",
337 "libutils",
338 "libbase",
339 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700340 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700341}
Howard Chenc135dbc2017-03-25 17:12:59 +0800342
343cc_test {
344 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700345 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700346 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800347 shared_libs: [
348 "libbinder",
349 "libutils",
350 "libbase",
351 ],
352}
Dan Stozad630e522016-12-01 15:16:31 -0800353
354cc_test {
355 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700356 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700357 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800358
359 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800360 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800361 ],
362
363 cpp_std: "experimental",
364 gnu_extensions: false,
365
366 shared_libs: [
367 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700368 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800369 "liblog",
370 "libutils",
371 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000372 test_suites: [
373 "device-tests",
374 "vts",
375 ],
Dan Shi80ada592019-09-13 09:17:17 -0700376 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800377}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700378
Steven Morelandf23dae22020-10-27 19:34:55 +0000379cc_test {
380 name: "binderClearBufTest",
381 defaults: ["binder_test_defaults"],
382 srcs: [
383 "binderClearBufTest.cpp",
384 ],
385
386 shared_libs: [
387 "libbase",
388 "libbinder",
389 "liblog",
390 "libutils",
391 ],
392
393 test_suites: ["general-tests"],
394 require_root: true,
395}
396
Steven Moreland12300a02019-08-02 13:27:15 -0700397aidl_interface {
398 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900399 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700400 srcs: [
401 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700402 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000403 backend: {
404 java: {
405 enabled: false,
406 },
407 },
Steven Moreland12300a02019-08-02 13:27:15 -0700408}
409
Steven Morelanddea3cf92019-07-16 18:06:55 -0700410cc_test {
411 name: "binderStabilityTest",
412 defaults: ["binder_test_defaults"],
413 srcs: [
414 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700415 ],
416
Steven Moreland13f84662020-07-23 21:30:41 +0000417 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700418 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700419 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700420 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700421 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700422 "libutils",
423 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700424 static_libs: [
425 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900426 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700427 ],
428
Steven Morelandea7659e2022-02-03 00:04:06 +0000429 test_suites: [
430 "device-tests",
431 "vts",
432 ],
Dan Shi302709b2019-09-19 15:28:15 -0700433 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700434}
Steven Moreland042ae822020-05-27 17:45:17 +0000435
436cc_test {
437 name: "binderAllocationLimits",
438 defaults: ["binder_test_defaults"],
439 srcs: ["binderAllocationLimits.cpp"],
440 shared_libs: [
441 "libbinder",
442 "liblog",
443 "libutils",
444 "libutilscallstack",
445 "libbase",
446 ],
447 test_suites: ["device-tests"],
448 require_root: true,
449}
Andy Hung73a14702020-11-24 13:04:46 -0800450
451cc_benchmark {
452 name: "binderParcelBenchmark",
453 defaults: ["binder_test_defaults"],
454 srcs: ["binderParcelBenchmark.cpp"],
455 shared_libs: [
456 "libbase",
457 "libbinder",
458 "liblog",
459 "libutils",
460 ],
461}
Yifan Hongaf766e62021-06-14 13:24:19 -0700462
463cc_test_host {
464 name: "binderUtilsHostTest",
465 defaults: ["binder_test_defaults"],
466 srcs: ["binderUtilsHostTest.cpp"],
467 shared_libs: [
468 "libbase",
469 "libbinder",
470 ],
471 static_libs: [
472 "libgmock",
473 ],
474 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700475 target: {
476 darwin: {
477 enabled: false,
478 },
479 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700480}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700481
482cc_test_host {
483 name: "binderHostDeviceTest",
484 defaults: ["binder_test_defaults"],
485 srcs: ["binderHostDeviceTest.cpp"],
486 test_config: "binderHostDeviceTest.xml",
487 shared_libs: [
488 "libbase",
489 "libbinder",
490 "liblog",
491 "libutils",
492 ],
493 static_libs: [
494 "libgmock",
495 ],
496 target_required: [
497 "binderHostDeviceTestService",
498 ],
499 test_suites: ["general-tests"],
500 target: {
501 darwin: {
502 enabled: false,
503 },
504 },
505 test_options: {
506 unit_test: false,
507 },
508}
509
510cc_test {
511 name: "binderHostDeviceTestService",
512 // The binary is named differently from the module so that PushFilePreparer pushes the binary
513 // directly, not the test module directory.
514 stem: "binderHostDeviceTest-service",
515 defaults: ["binder_test_defaults"],
516 gtest: false,
517 auto_gen_config: false,
518 srcs: ["binderHostDeviceTestService.cpp"],
519 shared_libs: [
520 "libbase",
521 "libbinder",
522 "liblog",
523 "libutils",
524 ],
525 test_suites: ["general-tests"],
526}