blob: 3fe55d65f1f392a25926612c1d89ece6160b8c06 [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"],
Steven Morelandea7659e2022-02-03 00:04:06 +000045 test_suites: [
46 "device-tests",
47 "vts",
48 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070049}
50
Steven Morelandcefba612020-11-05 22:57:06 +000051// unit test only, which can run on host and doesn't use /dev/binder
52cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000053 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000054 host_supported: true,
55 target: {
56 darwin: {
57 enabled: false,
58 },
59 },
Steven Morelandea7659e2022-02-03 00:04:06 +000060 srcs: [
61 "binderParcelUnitTest.cpp",
62 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +000063 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -050064 "binderMemoryHeapBaseUnitTest.cpp",
Fabián Cañas08bdc772023-01-02 15:02:56 -050065 "binderRecordedTransactionTest.cpp",
Abhishek Gadewar76f00822024-05-09 17:02:18 -070066 "binderPersistableBundleTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +000067 ],
Steven Morelandcefba612020-11-05 22:57:06 +000068 shared_libs: [
69 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -070070 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +000071 "libutils",
72 ],
73 test_suites: ["general-tests"],
74}
75
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080076cc_test {
Steven Morelanda8244b92023-04-20 23:34:11 +000077 name: "binderRecordReplayTest",
78 srcs: ["binderRecordReplayTest.cpp"],
Pawan Wagh76b18152023-12-01 14:30:26 +000079 cflags: [
80 "-DBINDER_WITH_KERNEL_IPC",
81 ],
Steven Morelanda8244b92023-04-20 23:34:11 +000082 shared_libs: [
83 "libbinder",
84 "libcutils",
85 "libutils",
Pawan Wagh76b18152023-12-01 14:30:26 +000086 "liblog",
Steven Morelanda8244b92023-04-20 23:34:11 +000087 ],
88 static_libs: [
89 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +000090 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +000091 "libbinder_random_parcel_seeds",
92 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +000093 ],
94 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +000095 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +000096}
97
98aidl_interface {
99 name: "binderRecordReplayTestIface",
100 unstable: true,
101 srcs: [
102 "IBinderRecordReplayTest.aidl",
103 ],
Pawan Wagh8da45382023-05-11 08:08:50 +0000104 imports: ["binderReadParcelIface"],
105 backend: {
106 java: {
107 enabled: true,
108 platform_apis: true,
109 },
Steven Moreland59813352024-02-08 23:52:11 +0000110
111 // TODO: switch from FileDescriptor to ParcelFileDescriptor
Pawan Wagh76b18152023-12-01 14:30:26 +0000112 ndk: {
113 enabled: false,
114 },
Steven Moreland59813352024-02-08 23:52:11 +0000115 rust: {
116 enabled: false,
117 },
Pawan Wagh8da45382023-05-11 08:08:50 +0000118 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000119}
120
121cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700122 name: "binderLibTest",
123 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800124
Dan Willemsen59e086f2016-07-25 17:13:45 -0700125 srcs: ["binderLibTest.cpp"],
126 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700127 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700128 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700129 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700130 "libutils",
131 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700132 static_libs: [
133 "libgmock",
134 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000135 test_suites: [
136 "device-tests",
137 "vts",
138 ],
Dan Shi80ada592019-09-13 09:17:17 -0700139 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700140}
141
Steven Moreland37aff182021-03-26 02:04:16 +0000142aidl_interface {
143 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000144 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000145 host_supported: true,
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700146 cmake_snapshot_supported: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000147 unstable: true,
148 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700149 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000150 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700151 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000152 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000153 "IBinderRpcSession.aidl",
154 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700155 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000156 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800157 flags: [
158 "-Werror",
159 "-Wno-mixed-oneway",
160 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000161 backend: {
162 java: {
163 enabled: false,
164 },
165 },
166}
167
Yifan Honge0e53282021-09-23 18:37:21 -0700168cc_library_static {
169 name: "libbinder_tls_test_utils",
170 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000171 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700172 target: {
173 darwin: {
174 enabled: false,
175 },
176 },
177 defaults: [
178 "binder_test_defaults",
179 "libbinder_tls_shared_deps",
180 ],
181 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700182 "libbase",
183 "liblog",
184 ],
185 static_libs: [
186 "libbinder_tls_static",
187 ],
188 srcs: [
189 "RpcTlsTestUtils.cpp",
190 ],
191 export_include_dirs: [
192 "include_tls_test_utils",
193 ],
194 visibility: [
195 ":__subpackages__",
196 ],
197}
198
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700199cc_library_static {
200 name: "libbinder_test_utils",
201 host_supported: true,
202 vendor_available: true,
203 target: {
204 darwin: {
205 enabled: false,
206 },
207 },
208 defaults: [
209 "binder_test_defaults",
210 ],
Tomasz Wasilczykfbfea5b2024-04-30 10:54:23 -0700211 header_libs: [
212 "libbinder_headers_base",
213 ],
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700214 shared_libs: [
215 "libbase",
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700216 ],
217 srcs: [
218 "FileUtils.cpp",
219 ],
220 visibility: [
221 ":__subpackages__",
222 ],
223}
224
Andrei Homescu12106de2022-04-27 04:42:21 +0000225cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000226 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000227 host_supported: true,
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700228 cmake_snapshot_supported: true,
Steven Morelandf6ec4632021-04-01 16:20:47 +0000229 target: {
230 darwin: {
231 enabled: false,
232 },
233 },
Steven Moreland37aff182021-03-26 02:04:16 +0000234 defaults: [
235 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000236 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000237
Andrei Homescu12106de2022-04-27 04:42:21 +0000238 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700239 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000240 "libbinder_tls_static",
241 "libbinder_tls_test_utils",
242 "binderRpcTestIface-cpp",
243 "binderRpcTestIface-ndk",
244 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000245}
246
247cc_defaults {
248 name: "binderRpcTest_service_defaults",
249 defaults: [
250 "binderRpcTest_common_defaults",
251 ],
252 gtest: false,
253 auto_gen_config: false,
254 srcs: [
255 "binderRpcTestCommon.cpp",
256 "binderRpcTestService.cpp",
257 ],
258}
259
260cc_defaults {
261 name: "binderRpcTest_defaults",
262 target: {
263 android: {
264 test_suites: ["vts"],
265 },
266 },
267 defaults: [
268 "binderRpcTest_common_defaults",
269 ],
270
271 srcs: [
272 "binderRpcTest.cpp",
273 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000274 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000275 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000276
Steven Moreland20531612023-04-04 18:03:24 +0000277 // This test uses a lot of resources and takes a long time. Due to
278 // design of several tests, it is also very sensitive to resource
279 // contention on the device. b/276820894
280 test_options: {
281 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000282 test_runner_options: [
283 {
284 name: "native-test-timeout",
285 value: "10m",
286 },
287 ],
Steven Moreland20531612023-04-04 18:03:24 +0000288 },
289
Andrei Homescu12106de2022-04-27 04:42:21 +0000290 test_suites: ["general-tests"],
291 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000292
293 data_bins: [
294 "binder_rpc_test_service",
295 "binder_rpc_test_service_no_kernel",
296 "binder_rpc_test_service_single_threaded",
297 "binder_rpc_test_service_single_threaded_no_kernel",
298 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000299}
300
Andrei Homescu2a298012022-06-15 01:08:54 +0000301cc_defaults {
302 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000303 cflags: [
304 "-DBINDER_WITH_KERNEL_IPC",
305 ],
306
Steven Moreland5553ac42020-11-11 02:14:45 +0000307 shared_libs: [
308 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000309 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000310 "libbase",
311 "libutils",
312 "libcutils",
313 "liblog",
314 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000315}
316
317cc_defaults {
318 name: "binderRpcTest_static_defaults",
319
320 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000321 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000322 "libutils",
323 // libcrypto_static is not visible to this module
324 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000325 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000326 static_libs: [
327 "libbase",
328 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000329 "libssl",
330 ],
331
332 cflags: [
333 // Disable tests that require shared libraries,
334 // e.g., libbinder.so or libbinder_ndk.so
335 "-DBINDER_TEST_NO_SHARED_LIBS",
336 ],
337}
338
339cc_test {
Andrei Homescu2a298012022-06-15 01:08:54 +0000340 // The module name cannot start with "binderRpcTest" because
341 // then atest tries to execute it as part of binderRpcTest
342 name: "binder_rpc_test_service",
343 defaults: [
344 "binderRpcTest_service_defaults",
345 "binderRpcTest_shared_defaults",
346 "libbinder_tls_shared_deps",
347 ],
348}
349
350cc_test {
351 name: "binder_rpc_test_service_no_kernel",
352 defaults: [
353 "binderRpcTest_service_defaults",
354 "binderRpcTest_static_defaults",
355 ],
356 static_libs: [
357 "libbinder_rpc_no_kernel",
358 ],
359}
360
361cc_test {
362 name: "binder_rpc_test_service_single_threaded",
363 defaults: [
364 "binderRpcTest_service_defaults",
365 "binderRpcTest_static_defaults",
366 ],
367 cflags: [
368 "-DBINDER_RPC_SINGLE_THREADED",
369 "-DBINDER_WITH_KERNEL_IPC",
370 ],
371 static_libs: [
372 "libbinder_rpc_single_threaded",
373 ],
374}
375
376cc_test {
377 name: "binder_rpc_test_service_single_threaded_no_kernel",
378 defaults: [
379 "binderRpcTest_service_defaults",
380 "binderRpcTest_static_defaults",
381 ],
382 cflags: [
383 "-DBINDER_RPC_SINGLE_THREADED",
384 ],
385 static_libs: [
386 "libbinder_rpc_single_threaded_no_kernel",
387 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700388 shared_libs: [
389 "libbinder_ndk",
390 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000391}
392
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000393cc_binary {
394 name: "binderRpcTestService_on_trusty_mock",
395 defaults: [
396 "trusty_mock_defaults",
397 ],
398
399 srcs: [
400 "binderRpcTestCommon.cpp",
401 "binderRpcTestServiceTrusty.cpp",
402 ],
403
404 shared_libs: [
405 "libbinder_on_trusty_mock",
406 "libbase",
407 "libutils",
408 "libcutils",
409 ],
410
411 static_libs: [
412 "binderRpcTestIface-cpp",
413 ],
414}
415
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000416cc_binary {
417 name: "binderRpcTest_on_trusty_mock",
418 defaults: [
419 "trusty_mock_defaults",
420 ],
421
422 srcs: [
423 "binderRpcUniversalTests.cpp",
424 "binderRpcTestCommon.cpp",
425 "binderRpcTestTrusty.cpp",
426 ],
427
428 shared_libs: [
429 "libbinder_on_trusty_mock",
430 "libbase",
431 "libutils",
432 "libcutils",
433 ],
434
435 static_libs: [
436 "binderRpcTestIface-cpp",
437 "libgtest",
438 ],
439}
440
Andrei Homescu2a298012022-06-15 01:08:54 +0000441cc_test {
442 name: "binderRpcTest",
443 defaults: [
444 "binderRpcTest_defaults",
445 "binderRpcTest_shared_defaults",
446 "libbinder_tls_shared_deps",
447 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000448
449 // Add the Trusty mock library as a fake dependency so it gets built
450 required: [
451 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000452 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000453 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000454 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000455 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000456 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000457}
458
459cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000460 name: "binderRpcTestNoKernel",
461 defaults: [
462 "binderRpcTest_defaults",
463 "binderRpcTest_static_defaults",
464 ],
465 static_libs: [
466 "libbinder_rpc_no_kernel",
467 ],
468}
469
470cc_test {
Tomasz Wasilczyk2265ad92024-05-01 12:54:46 -0700471 name: "binderRpcTestNoKernelAtAll",
472 defaults: [
473 "binderRpcTest_defaults",
474 "binderRpcTest_static_defaults",
475 ],
476 static_libs: [
477 "libbinder_rpc_no_kernel",
478 ],
479 cflags: [
480 "-DBINDER_NO_KERNEL_IPC_TESTING",
481 ],
482}
483
484cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000485 name: "binderRpcTestSingleThreaded",
486 defaults: [
487 "binderRpcTest_defaults",
488 "binderRpcTest_static_defaults",
489 ],
490 cflags: [
491 "-DBINDER_RPC_SINGLE_THREADED",
492 "-DBINDER_WITH_KERNEL_IPC",
493 ],
494 static_libs: [
495 "libbinder_rpc_single_threaded",
496 ],
497}
498
499cc_test {
500 name: "binderRpcTestSingleThreadedNoKernel",
501 defaults: [
502 "binderRpcTest_defaults",
503 "binderRpcTest_static_defaults",
504 ],
505 cflags: [
506 "-DBINDER_RPC_SINGLE_THREADED",
507 ],
508 static_libs: [
509 "libbinder_rpc_single_threaded_no_kernel",
510 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700511 shared_libs: [
512 "libbinder_ndk",
513 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000514}
515
Yifan Hongff73aa92021-09-17 21:28:01 -0700516cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000517 name: "binderRpcToTrustyTest",
518 vendor: true,
519 host_supported: false,
520 defaults: [
521 "binderRpcTest_common_defaults",
522 "binderRpcTest_static_defaults",
523 ],
524
525 srcs: [
526 "binderRpcTest.cpp",
527 "binderRpcTestCommon.cpp",
528 "binderRpcUniversalTests.cpp",
529 ],
530
531 cflags: [
532 "-DBINDER_RPC_TO_TRUSTY_TEST",
533 ],
534
535 static_libs: [
536 // We want to link libbinder statically so we can push the binary
537 // to the device for testing independently of the library
538 "libbinder_rpc_no_kernel",
539 "libbinder_trusty",
540 "libtrusty",
541 ],
542
543 test_suites: ["device-tests"],
544 require_root: true,
545}
546
547cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700548 name: "RpcTlsUtilsTest",
549 host_supported: true,
550 target: {
551 darwin: {
552 enabled: false,
553 },
554 android: {
555 test_suites: ["vts"],
556 },
557 },
558 defaults: [
559 "binder_test_defaults",
560 "libbinder_tls_shared_deps",
561 ],
562 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700563 "RpcTlsUtilsTest.cpp",
564 ],
565 shared_libs: [
566 "libbinder",
567 "libbase",
568 "libutils",
569 "liblog",
570 ],
571 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700572 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700573 "libbinder_tls_static",
574 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000575 test_suites: [
576 "general-tests",
577 "device-tests",
578 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700579}
580
Steven Morelandcda60852021-04-14 23:45:32 +0000581cc_benchmark {
582 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700583 defaults: [
584 "binder_test_defaults",
585 "libbinder_tls_shared_deps",
586 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000587 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000588 target: {
589 darwin: {
590 enabled: false,
591 },
592 },
Steven Morelandcda60852021-04-14 23:45:32 +0000593 srcs: [
594 "binderRpcBenchmark.cpp",
595 "IBinderRpcBenchmark.aidl",
596 ],
597 shared_libs: [
598 "libbase",
599 "libbinder",
600 "liblog",
601 "libutils",
602 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700603 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700604 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700605 "libbinder_tls_static",
606 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000607}
608
Steven Moreland5553ac42020-11-11 02:14:45 +0000609cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700610 name: "binderRpcWireProtocolTest",
611 host_supported: true,
612 target: {
613 darwin: {
614 enabled: false,
615 },
616 android: {
617 test_suites: ["vts"],
618 },
619 },
620 defaults: [
621 "binder_test_defaults",
622 ],
623 srcs: [
624 "binderRpcWireProtocolTest.cpp",
625 ],
626 shared_libs: [
627 "libbinder",
628 "libbase",
629 "libutils",
630 "libcutils",
631 "liblog",
632 ],
633 test_suites: ["general-tests"],
634}
635
636cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700637 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700638 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700639 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700640 shared_libs: [
641 "libbinder",
642 "libutils",
643 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700644 cflags: [
645 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700646 "-Wno-missing-field-initializers",
647 "-Wno-sign-compare",
648 "-O3",
649 ],
650}
Wei Wang78f2a372016-10-20 23:18:17 -0700651
652cc_test {
653 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700654 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700655 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700656 shared_libs: [
657 "libbinder",
658 "libutils",
659 "libbase",
660 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700661 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700662}
Howard Chenc135dbc2017-03-25 17:12:59 +0800663
664cc_test {
665 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700666 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700667 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800668 shared_libs: [
669 "libbinder",
670 "libutils",
671 "libbase",
672 ],
673}
Dan Stozad630e522016-12-01 15:16:31 -0800674
675cc_test {
676 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700677 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700678 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800679
680 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800681 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800682 ],
683
684 cpp_std: "experimental",
685 gnu_extensions: false,
686
687 shared_libs: [
688 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700689 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800690 "liblog",
691 "libutils",
692 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000693 test_suites: [
694 "device-tests",
695 "vts",
696 ],
Dan Shi80ada592019-09-13 09:17:17 -0700697 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800698}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700699
Steven Morelandf23dae22020-10-27 19:34:55 +0000700cc_test {
701 name: "binderClearBufTest",
702 defaults: ["binder_test_defaults"],
703 srcs: [
704 "binderClearBufTest.cpp",
705 ],
706
707 shared_libs: [
708 "libbase",
709 "libbinder",
710 "liblog",
711 "libutils",
712 ],
713
714 test_suites: ["general-tests"],
715 require_root: true,
716}
717
Steven Moreland12300a02019-08-02 13:27:15 -0700718aidl_interface {
719 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900720 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700721 srcs: [
722 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700723 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000724 backend: {
725 java: {
726 enabled: false,
727 },
728 },
Steven Moreland12300a02019-08-02 13:27:15 -0700729}
730
Steven Morelanddea3cf92019-07-16 18:06:55 -0700731cc_test {
732 name: "binderStabilityTest",
733 defaults: ["binder_test_defaults"],
734 srcs: [
735 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700736 ],
737
Steven Moreland13f84662020-07-23 21:30:41 +0000738 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700739 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700740 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700741 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700742 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700743 "libutils",
744 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700745 static_libs: [
746 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900747 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700748 ],
749
Steven Morelandea7659e2022-02-03 00:04:06 +0000750 test_suites: [
751 "device-tests",
752 "vts",
753 ],
Dan Shi302709b2019-09-19 15:28:15 -0700754 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700755}
Steven Moreland042ae822020-05-27 17:45:17 +0000756
757cc_test {
758 name: "binderAllocationLimits",
759 defaults: ["binder_test_defaults"],
760 srcs: ["binderAllocationLimits.cpp"],
761 shared_libs: [
762 "libbinder",
763 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000764 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000765 "libutils",
766 "libutilscallstack",
767 "libbase",
768 ],
769 test_suites: ["device-tests"],
770 require_root: true,
771}
Andy Hung73a14702020-11-24 13:04:46 -0800772
773cc_benchmark {
774 name: "binderParcelBenchmark",
775 defaults: ["binder_test_defaults"],
776 srcs: ["binderParcelBenchmark.cpp"],
777 shared_libs: [
778 "libbase",
779 "libbinder",
780 "liblog",
781 "libutils",
782 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000783 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800784}
Yifan Hongaf766e62021-06-14 13:24:19 -0700785
786cc_test_host {
787 name: "binderUtilsHostTest",
788 defaults: ["binder_test_defaults"],
789 srcs: ["binderUtilsHostTest.cpp"],
790 shared_libs: [
791 "libbase",
792 "libbinder",
793 ],
794 static_libs: [
795 "libgmock",
796 ],
797 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700798 target: {
799 darwin: {
800 enabled: false,
801 },
802 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700803}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700804
805cc_test_host {
806 name: "binderHostDeviceTest",
807 defaults: ["binder_test_defaults"],
808 srcs: ["binderHostDeviceTest.cpp"],
809 test_config: "binderHostDeviceTest.xml",
810 shared_libs: [
811 "libbase",
812 "libbinder",
813 "liblog",
814 "libutils",
815 ],
816 static_libs: [
817 "libgmock",
818 ],
819 target_required: [
820 "binderHostDeviceTestService",
821 ],
822 test_suites: ["general-tests"],
823 target: {
824 darwin: {
825 enabled: false,
826 },
827 },
828 test_options: {
829 unit_test: false,
830 },
831}
832
833cc_test {
834 name: "binderHostDeviceTestService",
835 // The binary is named differently from the module so that PushFilePreparer pushes the binary
836 // directly, not the test module directory.
837 stem: "binderHostDeviceTest-service",
838 defaults: ["binder_test_defaults"],
839 gtest: false,
840 auto_gen_config: false,
841 srcs: ["binderHostDeviceTestService.cpp"],
842 shared_libs: [
843 "libbase",
844 "libbinder",
845 "liblog",
846 "libutils",
847 ],
848 test_suites: ["general-tests"],
849}
Pawanf00fabb2022-08-04 17:56:18 +0000850
851cc_defaults {
852 name: "service_fuzzer_defaults",
853 static_libs: [
854 "libbase",
855 "libbinder_random_parcel",
856 "libcutils",
857 ],
858 target: {
859 android: {
860 shared_libs: [
861 "libbinder_ndk",
862 "libbinder",
863 "libutils",
864 ],
865 },
866 host: {
867 static_libs: [
868 "libbinder_ndk",
869 "libbinder",
870 "libutils",
871 ],
872 },
873 darwin: {
874 enabled: false,
875 },
876 },
877 fuzz_config: {
878 cc: [
879 "smoreland@google.com",
880 "waghpawan@google.com",
881 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000882 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
883 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000884 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000885 },
886}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000887
888cc_defaults {
889 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000890 fuzz_config: {
891 asan_options: [
892 "detect_leaks=0",
893 ],
894 hwasan_options: [
895 "detect_leaks=0",
896 ],
897 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000898}