blob: 28a3f654b874c772e594048564faf6ae96c11b1e [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 ],
Devin Moorec370db42024-08-09 23:18:05 +0000535 shared_libs: [
536 "libbinder_ndk",
537 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000538}
539
540cc_test {
541 name: "binderRpcTestSingleThreadedNoKernel",
542 defaults: [
543 "binderRpcTest_defaults",
544 "binderRpcTest_static_defaults",
545 ],
546 cflags: [
547 "-DBINDER_RPC_SINGLE_THREADED",
548 ],
549 static_libs: [
550 "libbinder_rpc_single_threaded_no_kernel",
551 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700552 shared_libs: [
553 "libbinder_ndk",
554 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000555}
556
Yifan Hongff73aa92021-09-17 21:28:01 -0700557cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000558 name: "binderRpcToTrustyTest",
559 vendor: true,
560 host_supported: false,
561 defaults: [
562 "binderRpcTest_common_defaults",
563 "binderRpcTest_static_defaults",
564 ],
565
566 srcs: [
567 "binderRpcTest.cpp",
568 "binderRpcTestCommon.cpp",
569 "binderRpcUniversalTests.cpp",
570 ],
571
572 cflags: [
573 "-DBINDER_RPC_TO_TRUSTY_TEST",
574 ],
575
576 static_libs: [
577 // We want to link libbinder statically so we can push the binary
578 // to the device for testing independently of the library
579 "libbinder_rpc_no_kernel",
580 "libbinder_trusty",
581 "libtrusty",
582 ],
583
584 test_suites: ["device-tests"],
585 require_root: true,
586}
587
588cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700589 name: "RpcTlsUtilsTest",
590 host_supported: true,
591 target: {
592 darwin: {
593 enabled: false,
594 },
595 android: {
596 test_suites: ["vts"],
597 },
598 },
599 defaults: [
600 "binder_test_defaults",
601 "libbinder_tls_shared_deps",
602 ],
603 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700604 "RpcTlsUtilsTest.cpp",
605 ],
606 shared_libs: [
607 "libbinder",
608 "libbase",
609 "libutils",
610 "liblog",
611 ],
612 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700613 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700614 "libbinder_tls_static",
615 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000616 test_suites: [
617 "general-tests",
618 "device-tests",
619 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700620}
621
Steven Morelandcda60852021-04-14 23:45:32 +0000622cc_benchmark {
623 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700624 defaults: [
625 "binder_test_defaults",
626 "libbinder_tls_shared_deps",
627 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000628 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000629 target: {
630 darwin: {
631 enabled: false,
632 },
633 },
Steven Morelandcda60852021-04-14 23:45:32 +0000634 srcs: [
635 "binderRpcBenchmark.cpp",
636 "IBinderRpcBenchmark.aidl",
637 ],
638 shared_libs: [
639 "libbase",
640 "libbinder",
641 "liblog",
642 "libutils",
643 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700644 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700645 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700646 "libbinder_tls_static",
647 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000648}
649
Steven Moreland5553ac42020-11-11 02:14:45 +0000650cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700651 name: "binderRpcWireProtocolTest",
652 host_supported: true,
653 target: {
654 darwin: {
655 enabled: false,
656 },
657 android: {
658 test_suites: ["vts"],
659 },
660 },
661 defaults: [
662 "binder_test_defaults",
663 ],
664 srcs: [
665 "binderRpcWireProtocolTest.cpp",
666 ],
667 shared_libs: [
668 "libbinder",
669 "libbase",
670 "libutils",
671 "libcutils",
672 "liblog",
673 ],
674 test_suites: ["general-tests"],
675}
676
677cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700678 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700679 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700680 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700681 shared_libs: [
682 "libbinder",
683 "libutils",
684 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700685 cflags: [
686 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700687 "-Wno-missing-field-initializers",
688 "-Wno-sign-compare",
689 "-O3",
690 ],
691}
Wei Wang78f2a372016-10-20 23:18:17 -0700692
693cc_test {
694 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700695 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700696 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700697 shared_libs: [
698 "libbinder",
699 "libutils",
700 "libbase",
701 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700702 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700703}
Howard Chenc135dbc2017-03-25 17:12:59 +0800704
705cc_test {
706 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700707 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700708 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800709 shared_libs: [
710 "libbinder",
711 "libutils",
712 "libbase",
713 ],
714}
Dan Stozad630e522016-12-01 15:16:31 -0800715
716cc_test {
717 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700718 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700719 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800720
721 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800722 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800723 ],
724
725 cpp_std: "experimental",
726 gnu_extensions: false,
727
728 shared_libs: [
729 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700730 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800731 "liblog",
732 "libutils",
733 ],
Jim Shargo7693c4a2024-10-11 02:28:18 +0000734 static_libs: [
735 "libgmock",
736 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000737 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000738 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000739 "vts",
740 ],
Dan Shi80ada592019-09-13 09:17:17 -0700741 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800742}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700743
Steven Morelandf23dae22020-10-27 19:34:55 +0000744cc_test {
745 name: "binderClearBufTest",
746 defaults: ["binder_test_defaults"],
747 srcs: [
748 "binderClearBufTest.cpp",
749 ],
750
751 shared_libs: [
752 "libbase",
753 "libbinder",
754 "liblog",
755 "libutils",
756 ],
757
758 test_suites: ["general-tests"],
759 require_root: true,
760}
761
Steven Moreland12300a02019-08-02 13:27:15 -0700762aidl_interface {
763 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900764 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700765 srcs: [
766 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700767 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000768 backend: {
769 java: {
770 enabled: false,
771 },
772 },
Steven Moreland12300a02019-08-02 13:27:15 -0700773}
774
Steven Morelanddea3cf92019-07-16 18:06:55 -0700775cc_test {
776 name: "binderStabilityTest",
777 defaults: ["binder_test_defaults"],
778 srcs: [
779 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700780 ],
781
Steven Moreland13f84662020-07-23 21:30:41 +0000782 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700783 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700784 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700785 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700786 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700787 "libutils",
788 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700789 static_libs: [
790 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900791 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700792 ],
793
Steven Morelandea7659e2022-02-03 00:04:06 +0000794 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000795 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000796 "vts",
797 ],
Dan Shi302709b2019-09-19 15:28:15 -0700798 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700799}
Steven Moreland042ae822020-05-27 17:45:17 +0000800
801cc_test {
802 name: "binderAllocationLimits",
803 defaults: ["binder_test_defaults"],
804 srcs: ["binderAllocationLimits.cpp"],
805 shared_libs: [
806 "libbinder",
807 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000808 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000809 "libutils",
810 "libutilscallstack",
811 "libbase",
812 ],
813 test_suites: ["device-tests"],
814 require_root: true,
815}
Andy Hung73a14702020-11-24 13:04:46 -0800816
817cc_benchmark {
818 name: "binderParcelBenchmark",
819 defaults: ["binder_test_defaults"],
820 srcs: ["binderParcelBenchmark.cpp"],
821 shared_libs: [
822 "libbase",
823 "libbinder",
824 "liblog",
825 "libutils",
826 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000827 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800828}
Yifan Hongaf766e62021-06-14 13:24:19 -0700829
830cc_test_host {
831 name: "binderUtilsHostTest",
832 defaults: ["binder_test_defaults"],
833 srcs: ["binderUtilsHostTest.cpp"],
834 shared_libs: [
835 "libbase",
836 "libbinder",
837 ],
838 static_libs: [
839 "libgmock",
840 ],
841 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700842 target: {
843 darwin: {
844 enabled: false,
845 },
846 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700847}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700848
849cc_test_host {
850 name: "binderHostDeviceTest",
851 defaults: ["binder_test_defaults"],
852 srcs: ["binderHostDeviceTest.cpp"],
853 test_config: "binderHostDeviceTest.xml",
854 shared_libs: [
855 "libbase",
856 "libbinder",
857 "liblog",
858 "libutils",
859 ],
860 static_libs: [
861 "libgmock",
862 ],
863 target_required: [
864 "binderHostDeviceTestService",
865 ],
866 test_suites: ["general-tests"],
867 target: {
868 darwin: {
869 enabled: false,
870 },
871 },
872 test_options: {
873 unit_test: false,
874 },
875}
876
877cc_test {
878 name: "binderHostDeviceTestService",
879 // The binary is named differently from the module so that PushFilePreparer pushes the binary
880 // directly, not the test module directory.
881 stem: "binderHostDeviceTest-service",
882 defaults: ["binder_test_defaults"],
883 gtest: false,
884 auto_gen_config: false,
885 srcs: ["binderHostDeviceTestService.cpp"],
886 shared_libs: [
887 "libbase",
888 "libbinder",
889 "liblog",
890 "libutils",
891 ],
892 test_suites: ["general-tests"],
893}
Pawanf00fabb2022-08-04 17:56:18 +0000894
895cc_defaults {
896 name: "service_fuzzer_defaults",
897 static_libs: [
898 "libbase",
899 "libbinder_random_parcel",
900 "libcutils",
901 ],
902 target: {
903 android: {
904 shared_libs: [
905 "libbinder_ndk",
906 "libbinder",
907 "libutils",
908 ],
909 },
910 host: {
911 static_libs: [
912 "libbinder_ndk",
913 "libbinder",
914 "libutils",
915 ],
916 },
917 darwin: {
918 enabled: false,
919 },
920 },
Pawan Wagh6cee6bd2024-08-28 22:16:56 +0000921 corpus: ["corpus/*"],
Pawanf00fabb2022-08-04 17:56:18 +0000922 fuzz_config: {
923 cc: [
924 "smoreland@google.com",
925 "waghpawan@google.com",
926 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000927 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
928 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000929 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000930 },
931}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000932
933cc_defaults {
934 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000935 fuzz_config: {
936 asan_options: [
937 "detect_leaks=0",
938 ],
939 hwasan_options: [
940 "detect_leaks=0",
941 ],
942 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000943}