blob: 0e653af707da554445a63d56f8d7694103b3264f [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",
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -070028 cmake_snapshot_supported: true,
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070029 cflags: [
30 "-Wall",
31 "-Werror",
Tomasz Wasilczyke97f3a82024-04-30 10:37:32 -070032 "-Wformat",
33 "-Wpessimizing-move",
34 "-Wsign-compare",
35 "-Wunused-result",
36 "-Wzero-as-null-pointer-constant",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070037 ],
38}
39
Dan Willemsen59e086f2016-07-25 17:13:45 -070040cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070041 name: "binderDriverInterfaceTest",
42 defaults: ["binder_test_defaults"],
Yifan Hong4e419d82021-04-26 11:32:56 -070043 header_libs: ["libbinder_headers"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070044 srcs: ["binderDriverInterfaceTest.cpp"],
Yu-Ting Tsengd5fc4462024-04-30 15:07:13 -070045 shared_libs: [
46 "libbinder",
47 ],
Steven Morelandea7659e2022-02-03 00:04:06 +000048 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +000049 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +000050 "vts",
51 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070052}
53
Parth Saneb6ed0eb2024-06-25 14:38:42 +000054cc_test {
55 name: "binderCacheUnitTest",
56 target: {
57 darwin: {
58 enabled: false,
59 },
60 },
61 srcs: [
62 "binderCacheUnitTest.cpp",
63 ],
64 shared_libs: [
65 "liblog",
66 "libbinder",
67 "libcutils",
68 "libutils",
69 ],
70 static_libs: [
71 "libfakeservicemanager",
72 ],
73 defaults: ["libbinder_client_cache_flag"],
74 test_suites: ["general-tests"],
75 require_root: true,
76}
77
Steven Morelandcefba612020-11-05 22:57:06 +000078// unit test only, which can run on host and doesn't use /dev/binder
79cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000080 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000081 host_supported: true,
82 target: {
83 darwin: {
84 enabled: false,
85 },
86 },
Steven Morelandea7659e2022-02-03 00:04:06 +000087 srcs: [
88 "binderParcelUnitTest.cpp",
89 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +000090 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -050091 "binderMemoryHeapBaseUnitTest.cpp",
Fabián Cañas08bdc772023-01-02 15:02:56 -050092 "binderRecordedTransactionTest.cpp",
Abhishek Gadewar76f00822024-05-09 17:02:18 -070093 "binderPersistableBundleTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +000094 ],
Steven Morelandcefba612020-11-05 22:57:06 +000095 shared_libs: [
96 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -070097 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +000098 "libutils",
99 ],
100 test_suites: ["general-tests"],
101}
102
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800103cc_test {
Steven Morelanda8244b92023-04-20 23:34:11 +0000104 name: "binderRecordReplayTest",
105 srcs: ["binderRecordReplayTest.cpp"],
Pawan Wagh76b18152023-12-01 14:30:26 +0000106 cflags: [
107 "-DBINDER_WITH_KERNEL_IPC",
108 ],
Steven Morelanda8244b92023-04-20 23:34:11 +0000109 shared_libs: [
110 "libbinder",
111 "libcutils",
112 "libutils",
Pawan Wagh76b18152023-12-01 14:30:26 +0000113 "liblog",
Steven Morelanda8244b92023-04-20 23:34:11 +0000114 ],
115 static_libs: [
116 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +0000117 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +0000118 "libbinder_random_parcel_seeds",
119 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +0000120 ],
121 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +0000122 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +0000123}
124
125aidl_interface {
126 name: "binderRecordReplayTestIface",
127 unstable: true,
128 srcs: [
129 "IBinderRecordReplayTest.aidl",
130 ],
Pawan Wagh8da45382023-05-11 08:08:50 +0000131 imports: ["binderReadParcelIface"],
132 backend: {
133 java: {
134 enabled: true,
135 platform_apis: true,
136 },
Steven Moreland59813352024-02-08 23:52:11 +0000137
138 // TODO: switch from FileDescriptor to ParcelFileDescriptor
Pawan Wagh76b18152023-12-01 14:30:26 +0000139 ndk: {
140 enabled: false,
141 },
Steven Moreland59813352024-02-08 23:52:11 +0000142 rust: {
143 enabled: false,
144 },
Pawan Wagh8da45382023-05-11 08:08:50 +0000145 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000146}
147
148cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700149 name: "binderLibTest",
150 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800151
Dan Willemsen59e086f2016-07-25 17:13:45 -0700152 srcs: ["binderLibTest.cpp"],
153 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700154 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700155 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700156 "liblog",
Yu-Ting Tsengd5fc4462024-04-30 15:07:13 -0700157 "libprocessgroup",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700158 "libutils",
159 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700160 static_libs: [
161 "libgmock",
162 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000163 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000164 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000165 "vts",
166 ],
Dan Shi80ada592019-09-13 09:17:17 -0700167 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700168}
169
Steven Moreland37aff182021-03-26 02:04:16 +0000170aidl_interface {
171 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000172 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000173 host_supported: true,
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700174 cmake_snapshot_supported: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000175 unstable: true,
176 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700177 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000178 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700179 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000180 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000181 "IBinderRpcSession.aidl",
182 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700183 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000184 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800185 flags: [
186 "-Werror",
187 "-Wno-mixed-oneway",
188 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000189 backend: {
190 java: {
191 enabled: false,
192 },
193 },
194}
195
Yifan Honge0e53282021-09-23 18:37:21 -0700196cc_library_static {
197 name: "libbinder_tls_test_utils",
198 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000199 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700200 target: {
201 darwin: {
202 enabled: false,
203 },
204 },
205 defaults: [
206 "binder_test_defaults",
207 "libbinder_tls_shared_deps",
208 ],
209 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700210 "libbase",
211 "liblog",
212 ],
213 static_libs: [
214 "libbinder_tls_static",
215 ],
216 srcs: [
217 "RpcTlsTestUtils.cpp",
218 ],
219 export_include_dirs: [
220 "include_tls_test_utils",
221 ],
222 visibility: [
223 ":__subpackages__",
224 ],
225}
226
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700227cc_library_static {
228 name: "libbinder_test_utils",
229 host_supported: true,
230 vendor_available: true,
231 target: {
232 darwin: {
233 enabled: false,
234 },
235 },
236 defaults: [
237 "binder_test_defaults",
238 ],
Tomasz Wasilczykfbfea5b2024-04-30 10:54:23 -0700239 header_libs: [
240 "libbinder_headers_base",
241 ],
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700242 shared_libs: [
243 "libbase",
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700244 ],
245 srcs: [
246 "FileUtils.cpp",
247 ],
248 visibility: [
249 ":__subpackages__",
250 ],
251}
252
Andrei Homescu12106de2022-04-27 04:42:21 +0000253cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000254 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000255 host_supported: true,
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700256 cmake_snapshot_supported: true,
Steven Morelandf6ec4632021-04-01 16:20:47 +0000257 target: {
258 darwin: {
259 enabled: false,
260 },
261 },
Steven Moreland37aff182021-03-26 02:04:16 +0000262 defaults: [
263 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000264 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000265
Devin Moore1df9c5f2024-07-23 22:09:29 +0000266 compile_multilib: "both",
267 multilib: {
268 lib32: {
269 suffix: "32",
270 },
271 lib64: {
272 suffix: "64",
273 },
274 },
275
Andrei Homescu12106de2022-04-27 04:42:21 +0000276 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700277 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000278 "libbinder_tls_static",
279 "libbinder_tls_test_utils",
280 "binderRpcTestIface-cpp",
281 "binderRpcTestIface-ndk",
282 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000283}
284
285cc_defaults {
286 name: "binderRpcTest_service_defaults",
287 defaults: [
288 "binderRpcTest_common_defaults",
289 ],
290 gtest: false,
291 auto_gen_config: false,
292 srcs: [
293 "binderRpcTestCommon.cpp",
294 "binderRpcTestService.cpp",
295 ],
296}
297
298cc_defaults {
299 name: "binderRpcTest_defaults",
300 target: {
301 android: {
302 test_suites: ["vts"],
303 },
304 },
305 defaults: [
306 "binderRpcTest_common_defaults",
307 ],
308
309 srcs: [
310 "binderRpcTest.cpp",
311 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000312 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000313 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000314
Steven Moreland20531612023-04-04 18:03:24 +0000315 // This test uses a lot of resources and takes a long time. Due to
316 // design of several tests, it is also very sensitive to resource
317 // contention on the device. b/276820894
318 test_options: {
319 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000320 test_runner_options: [
321 {
322 name: "native-test-timeout",
323 value: "10m",
324 },
325 ],
Steven Moreland20531612023-04-04 18:03:24 +0000326 },
327
Andrei Homescu12106de2022-04-27 04:42:21 +0000328 test_suites: ["general-tests"],
329 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000330
331 data_bins: [
332 "binder_rpc_test_service",
333 "binder_rpc_test_service_no_kernel",
334 "binder_rpc_test_service_single_threaded",
335 "binder_rpc_test_service_single_threaded_no_kernel",
336 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000337}
338
Andrei Homescu2a298012022-06-15 01:08:54 +0000339cc_defaults {
340 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000341 cflags: [
342 "-DBINDER_WITH_KERNEL_IPC",
343 ],
344
Steven Moreland5553ac42020-11-11 02:14:45 +0000345 shared_libs: [
346 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000347 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000348 "libbase",
349 "libutils",
350 "libcutils",
351 "liblog",
352 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000353}
354
355cc_defaults {
356 name: "binderRpcTest_static_defaults",
357
358 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000359 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000360 "libutils",
361 // libcrypto_static is not visible to this module
362 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000363 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000364 static_libs: [
365 "libbase",
366 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000367 "libssl",
368 ],
369
370 cflags: [
371 // Disable tests that require shared libraries,
372 // e.g., libbinder.so or libbinder_ndk.so
373 "-DBINDER_TEST_NO_SHARED_LIBS",
374 ],
375}
376
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700377cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000378 // The module name cannot start with "binderRpcTest" because
379 // then atest tries to execute it as part of binderRpcTest
380 name: "binder_rpc_test_service",
381 defaults: [
382 "binderRpcTest_service_defaults",
383 "binderRpcTest_shared_defaults",
384 "libbinder_tls_shared_deps",
385 ],
386}
387
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700388cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000389 name: "binder_rpc_test_service_no_kernel",
390 defaults: [
391 "binderRpcTest_service_defaults",
392 "binderRpcTest_static_defaults",
393 ],
394 static_libs: [
395 "libbinder_rpc_no_kernel",
396 ],
397}
398
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700399cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000400 name: "binder_rpc_test_service_single_threaded",
401 defaults: [
402 "binderRpcTest_service_defaults",
403 "binderRpcTest_static_defaults",
404 ],
405 cflags: [
406 "-DBINDER_RPC_SINGLE_THREADED",
407 "-DBINDER_WITH_KERNEL_IPC",
408 ],
409 static_libs: [
410 "libbinder_rpc_single_threaded",
411 ],
412}
413
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700414cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000415 name: "binder_rpc_test_service_single_threaded_no_kernel",
416 defaults: [
417 "binderRpcTest_service_defaults",
418 "binderRpcTest_static_defaults",
419 ],
420 cflags: [
421 "-DBINDER_RPC_SINGLE_THREADED",
422 ],
423 static_libs: [
424 "libbinder_rpc_single_threaded_no_kernel",
425 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700426 shared_libs: [
427 "libbinder_ndk",
428 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000429}
430
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000431cc_binary {
432 name: "binderRpcTestService_on_trusty_mock",
433 defaults: [
434 "trusty_mock_defaults",
435 ],
436
437 srcs: [
438 "binderRpcTestCommon.cpp",
439 "binderRpcTestServiceTrusty.cpp",
440 ],
441
442 shared_libs: [
443 "libbinder_on_trusty_mock",
444 "libbase",
445 "libutils",
446 "libcutils",
447 ],
448
449 static_libs: [
450 "binderRpcTestIface-cpp",
451 ],
452}
453
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000454cc_binary {
455 name: "binderRpcTest_on_trusty_mock",
456 defaults: [
457 "trusty_mock_defaults",
458 ],
459
460 srcs: [
461 "binderRpcUniversalTests.cpp",
462 "binderRpcTestCommon.cpp",
463 "binderRpcTestTrusty.cpp",
464 ],
465
466 shared_libs: [
467 "libbinder_on_trusty_mock",
468 "libbase",
469 "libutils",
470 "libcutils",
471 ],
472
473 static_libs: [
474 "binderRpcTestIface-cpp",
475 "libgtest",
476 ],
477}
478
Andrei Homescu2a298012022-06-15 01:08:54 +0000479cc_test {
480 name: "binderRpcTest",
481 defaults: [
482 "binderRpcTest_defaults",
483 "binderRpcTest_shared_defaults",
484 "libbinder_tls_shared_deps",
485 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000486
487 // Add the Trusty mock library as a fake dependency so it gets built
488 required: [
489 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000490 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000491 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000492 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000493 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000494 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000495}
496
497cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000498 name: "binderRpcTestNoKernel",
499 defaults: [
500 "binderRpcTest_defaults",
501 "binderRpcTest_static_defaults",
502 ],
503 static_libs: [
504 "libbinder_rpc_no_kernel",
505 ],
506}
507
508cc_test {
Tomasz Wasilczyk2265ad92024-05-01 12:54:46 -0700509 name: "binderRpcTestNoKernelAtAll",
510 defaults: [
511 "binderRpcTest_defaults",
512 "binderRpcTest_static_defaults",
513 ],
514 static_libs: [
515 "libbinder_rpc_no_kernel",
516 ],
517 cflags: [
518 "-DBINDER_NO_KERNEL_IPC_TESTING",
519 ],
520}
521
522cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000523 name: "binderRpcTestSingleThreaded",
524 defaults: [
525 "binderRpcTest_defaults",
526 "binderRpcTest_static_defaults",
527 ],
528 cflags: [
529 "-DBINDER_RPC_SINGLE_THREADED",
530 "-DBINDER_WITH_KERNEL_IPC",
531 ],
532 static_libs: [
533 "libbinder_rpc_single_threaded",
534 ],
535}
536
537cc_test {
538 name: "binderRpcTestSingleThreadedNoKernel",
539 defaults: [
540 "binderRpcTest_defaults",
541 "binderRpcTest_static_defaults",
542 ],
543 cflags: [
544 "-DBINDER_RPC_SINGLE_THREADED",
545 ],
546 static_libs: [
547 "libbinder_rpc_single_threaded_no_kernel",
548 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700549 shared_libs: [
550 "libbinder_ndk",
551 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000552}
553
Yifan Hongff73aa92021-09-17 21:28:01 -0700554cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000555 name: "binderRpcToTrustyTest",
556 vendor: true,
557 host_supported: false,
558 defaults: [
559 "binderRpcTest_common_defaults",
560 "binderRpcTest_static_defaults",
561 ],
562
563 srcs: [
564 "binderRpcTest.cpp",
565 "binderRpcTestCommon.cpp",
566 "binderRpcUniversalTests.cpp",
567 ],
568
569 cflags: [
570 "-DBINDER_RPC_TO_TRUSTY_TEST",
571 ],
572
573 static_libs: [
574 // We want to link libbinder statically so we can push the binary
575 // to the device for testing independently of the library
576 "libbinder_rpc_no_kernel",
577 "libbinder_trusty",
578 "libtrusty",
579 ],
580
581 test_suites: ["device-tests"],
582 require_root: true,
583}
584
585cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700586 name: "RpcTlsUtilsTest",
587 host_supported: true,
588 target: {
589 darwin: {
590 enabled: false,
591 },
592 android: {
593 test_suites: ["vts"],
594 },
595 },
596 defaults: [
597 "binder_test_defaults",
598 "libbinder_tls_shared_deps",
599 ],
600 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700601 "RpcTlsUtilsTest.cpp",
602 ],
603 shared_libs: [
604 "libbinder",
605 "libbase",
606 "libutils",
607 "liblog",
608 ],
609 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700610 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700611 "libbinder_tls_static",
612 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000613 test_suites: [
614 "general-tests",
615 "device-tests",
616 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700617}
618
Steven Morelandcda60852021-04-14 23:45:32 +0000619cc_benchmark {
620 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700621 defaults: [
622 "binder_test_defaults",
623 "libbinder_tls_shared_deps",
624 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000625 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000626 target: {
627 darwin: {
628 enabled: false,
629 },
630 },
Steven Morelandcda60852021-04-14 23:45:32 +0000631 srcs: [
632 "binderRpcBenchmark.cpp",
633 "IBinderRpcBenchmark.aidl",
634 ],
635 shared_libs: [
636 "libbase",
637 "libbinder",
638 "liblog",
639 "libutils",
640 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700641 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700642 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700643 "libbinder_tls_static",
644 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000645}
646
Steven Moreland5553ac42020-11-11 02:14:45 +0000647cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700648 name: "binderRpcWireProtocolTest",
649 host_supported: true,
650 target: {
651 darwin: {
652 enabled: false,
653 },
654 android: {
655 test_suites: ["vts"],
656 },
657 },
658 defaults: [
659 "binder_test_defaults",
660 ],
661 srcs: [
662 "binderRpcWireProtocolTest.cpp",
663 ],
664 shared_libs: [
665 "libbinder",
666 "libbase",
667 "libutils",
668 "libcutils",
669 "liblog",
670 ],
671 test_suites: ["general-tests"],
672}
673
674cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700675 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700676 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700677 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700678 shared_libs: [
679 "libbinder",
680 "libutils",
681 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700682 cflags: [
683 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700684 "-Wno-missing-field-initializers",
685 "-Wno-sign-compare",
686 "-O3",
687 ],
688}
Wei Wang78f2a372016-10-20 23:18:17 -0700689
690cc_test {
691 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700692 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700693 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700694 shared_libs: [
695 "libbinder",
696 "libutils",
697 "libbase",
698 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700699 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700700}
Howard Chenc135dbc2017-03-25 17:12:59 +0800701
702cc_test {
703 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700704 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700705 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800706 shared_libs: [
707 "libbinder",
708 "libutils",
709 "libbase",
710 ],
711}
Dan Stozad630e522016-12-01 15:16:31 -0800712
713cc_test {
714 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700715 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700716 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800717
718 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800719 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800720 ],
721
722 cpp_std: "experimental",
723 gnu_extensions: false,
724
725 shared_libs: [
726 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700727 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800728 "liblog",
729 "libutils",
730 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000731 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000732 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000733 "vts",
734 ],
Dan Shi80ada592019-09-13 09:17:17 -0700735 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800736}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700737
Steven Morelandf23dae22020-10-27 19:34:55 +0000738cc_test {
739 name: "binderClearBufTest",
740 defaults: ["binder_test_defaults"],
741 srcs: [
742 "binderClearBufTest.cpp",
743 ],
744
745 shared_libs: [
746 "libbase",
747 "libbinder",
748 "liblog",
749 "libutils",
750 ],
751
752 test_suites: ["general-tests"],
753 require_root: true,
754}
755
Steven Moreland12300a02019-08-02 13:27:15 -0700756aidl_interface {
757 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900758 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700759 srcs: [
760 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700761 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000762 backend: {
763 java: {
764 enabled: false,
765 },
766 },
Steven Moreland12300a02019-08-02 13:27:15 -0700767}
768
Steven Morelanddea3cf92019-07-16 18:06:55 -0700769cc_test {
770 name: "binderStabilityTest",
771 defaults: ["binder_test_defaults"],
772 srcs: [
773 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700774 ],
775
Steven Moreland13f84662020-07-23 21:30:41 +0000776 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700777 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700778 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700779 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700780 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700781 "libutils",
782 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700783 static_libs: [
784 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900785 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700786 ],
787
Steven Morelandea7659e2022-02-03 00:04:06 +0000788 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000789 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000790 "vts",
791 ],
Dan Shi302709b2019-09-19 15:28:15 -0700792 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700793}
Steven Moreland042ae822020-05-27 17:45:17 +0000794
795cc_test {
796 name: "binderAllocationLimits",
797 defaults: ["binder_test_defaults"],
798 srcs: ["binderAllocationLimits.cpp"],
799 shared_libs: [
800 "libbinder",
801 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000802 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000803 "libutils",
804 "libutilscallstack",
805 "libbase",
806 ],
807 test_suites: ["device-tests"],
808 require_root: true,
809}
Andy Hung73a14702020-11-24 13:04:46 -0800810
811cc_benchmark {
812 name: "binderParcelBenchmark",
813 defaults: ["binder_test_defaults"],
814 srcs: ["binderParcelBenchmark.cpp"],
815 shared_libs: [
816 "libbase",
817 "libbinder",
818 "liblog",
819 "libutils",
820 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000821 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800822}
Yifan Hongaf766e62021-06-14 13:24:19 -0700823
824cc_test_host {
825 name: "binderUtilsHostTest",
826 defaults: ["binder_test_defaults"],
827 srcs: ["binderUtilsHostTest.cpp"],
828 shared_libs: [
829 "libbase",
830 "libbinder",
831 ],
832 static_libs: [
833 "libgmock",
834 ],
835 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700836 target: {
837 darwin: {
838 enabled: false,
839 },
840 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700841}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700842
843cc_test_host {
844 name: "binderHostDeviceTest",
845 defaults: ["binder_test_defaults"],
846 srcs: ["binderHostDeviceTest.cpp"],
847 test_config: "binderHostDeviceTest.xml",
848 shared_libs: [
849 "libbase",
850 "libbinder",
851 "liblog",
852 "libutils",
853 ],
854 static_libs: [
855 "libgmock",
856 ],
857 target_required: [
858 "binderHostDeviceTestService",
859 ],
860 test_suites: ["general-tests"],
861 target: {
862 darwin: {
863 enabled: false,
864 },
865 },
866 test_options: {
867 unit_test: false,
868 },
869}
870
871cc_test {
872 name: "binderHostDeviceTestService",
873 // The binary is named differently from the module so that PushFilePreparer pushes the binary
874 // directly, not the test module directory.
875 stem: "binderHostDeviceTest-service",
876 defaults: ["binder_test_defaults"],
877 gtest: false,
878 auto_gen_config: false,
879 srcs: ["binderHostDeviceTestService.cpp"],
880 shared_libs: [
881 "libbase",
882 "libbinder",
883 "liblog",
884 "libutils",
885 ],
886 test_suites: ["general-tests"],
887}
Pawanf00fabb2022-08-04 17:56:18 +0000888
889cc_defaults {
890 name: "service_fuzzer_defaults",
891 static_libs: [
892 "libbase",
893 "libbinder_random_parcel",
894 "libcutils",
895 ],
896 target: {
897 android: {
898 shared_libs: [
899 "libbinder_ndk",
900 "libbinder",
901 "libutils",
902 ],
903 },
904 host: {
905 static_libs: [
906 "libbinder_ndk",
907 "libbinder",
908 "libutils",
909 ],
910 },
911 darwin: {
912 enabled: false,
913 },
914 },
Pawan Wagh6cee6bd2024-08-28 22:16:56 +0000915 corpus: ["corpus/*"],
Pawanf00fabb2022-08-04 17:56:18 +0000916 fuzz_config: {
917 cc: [
918 "smoreland@google.com",
919 "waghpawan@google.com",
920 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000921 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
922 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000923 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000924 },
925}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000926
927cc_defaults {
928 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000929 fuzz_config: {
930 asan_options: [
931 "detect_leaks=0",
932 ],
933 hwasan_options: [
934 "detect_leaks=0",
935 ],
936 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000937}