blob: 4c7684ccb77e2aa9ac4880d41cf50b01fe49d6a8 [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 ],
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700270 compile_multilib: "first",
Andrei Homescu2a298012022-06-15 01:08:54 +0000271
272 srcs: [
273 "binderRpcTest.cpp",
274 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000275 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000276 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000277
Steven Moreland20531612023-04-04 18:03:24 +0000278 // This test uses a lot of resources and takes a long time. Due to
279 // design of several tests, it is also very sensitive to resource
280 // contention on the device. b/276820894
281 test_options: {
282 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000283 test_runner_options: [
284 {
285 name: "native-test-timeout",
286 value: "10m",
287 },
288 ],
Steven Moreland20531612023-04-04 18:03:24 +0000289 },
290
Andrei Homescu12106de2022-04-27 04:42:21 +0000291 test_suites: ["general-tests"],
292 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000293
294 data_bins: [
295 "binder_rpc_test_service",
296 "binder_rpc_test_service_no_kernel",
297 "binder_rpc_test_service_single_threaded",
298 "binder_rpc_test_service_single_threaded_no_kernel",
299 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000300}
301
Andrei Homescu2a298012022-06-15 01:08:54 +0000302cc_defaults {
303 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000304 cflags: [
305 "-DBINDER_WITH_KERNEL_IPC",
306 ],
307
Steven Moreland5553ac42020-11-11 02:14:45 +0000308 shared_libs: [
309 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000310 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000311 "libbase",
312 "libutils",
313 "libcutils",
314 "liblog",
315 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000316}
317
318cc_defaults {
319 name: "binderRpcTest_static_defaults",
320
321 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000322 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000323 "libutils",
324 // libcrypto_static is not visible to this module
325 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000326 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000327 static_libs: [
328 "libbase",
329 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000330 "libssl",
331 ],
332
333 cflags: [
334 // Disable tests that require shared libraries,
335 // e.g., libbinder.so or libbinder_ndk.so
336 "-DBINDER_TEST_NO_SHARED_LIBS",
337 ],
338}
339
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700340cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000341 // The module name cannot start with "binderRpcTest" because
342 // then atest tries to execute it as part of binderRpcTest
343 name: "binder_rpc_test_service",
344 defaults: [
345 "binderRpcTest_service_defaults",
346 "binderRpcTest_shared_defaults",
347 "libbinder_tls_shared_deps",
348 ],
349}
350
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700351cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000352 name: "binder_rpc_test_service_no_kernel",
353 defaults: [
354 "binderRpcTest_service_defaults",
355 "binderRpcTest_static_defaults",
356 ],
357 static_libs: [
358 "libbinder_rpc_no_kernel",
359 ],
360}
361
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700362cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000363 name: "binder_rpc_test_service_single_threaded",
364 defaults: [
365 "binderRpcTest_service_defaults",
366 "binderRpcTest_static_defaults",
367 ],
368 cflags: [
369 "-DBINDER_RPC_SINGLE_THREADED",
370 "-DBINDER_WITH_KERNEL_IPC",
371 ],
372 static_libs: [
373 "libbinder_rpc_single_threaded",
374 ],
375}
376
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700377cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000378 name: "binder_rpc_test_service_single_threaded_no_kernel",
379 defaults: [
380 "binderRpcTest_service_defaults",
381 "binderRpcTest_static_defaults",
382 ],
383 cflags: [
384 "-DBINDER_RPC_SINGLE_THREADED",
385 ],
386 static_libs: [
387 "libbinder_rpc_single_threaded_no_kernel",
388 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700389 shared_libs: [
390 "libbinder_ndk",
391 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000392}
393
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000394cc_binary {
395 name: "binderRpcTestService_on_trusty_mock",
396 defaults: [
397 "trusty_mock_defaults",
398 ],
399
400 srcs: [
401 "binderRpcTestCommon.cpp",
402 "binderRpcTestServiceTrusty.cpp",
403 ],
404
405 shared_libs: [
406 "libbinder_on_trusty_mock",
407 "libbase",
408 "libutils",
409 "libcutils",
410 ],
411
412 static_libs: [
413 "binderRpcTestIface-cpp",
414 ],
415}
416
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000417cc_binary {
418 name: "binderRpcTest_on_trusty_mock",
419 defaults: [
420 "trusty_mock_defaults",
421 ],
422
423 srcs: [
424 "binderRpcUniversalTests.cpp",
425 "binderRpcTestCommon.cpp",
426 "binderRpcTestTrusty.cpp",
427 ],
428
429 shared_libs: [
430 "libbinder_on_trusty_mock",
431 "libbase",
432 "libutils",
433 "libcutils",
434 ],
435
436 static_libs: [
437 "binderRpcTestIface-cpp",
438 "libgtest",
439 ],
440}
441
Andrei Homescu2a298012022-06-15 01:08:54 +0000442cc_test {
443 name: "binderRpcTest",
444 defaults: [
445 "binderRpcTest_defaults",
446 "binderRpcTest_shared_defaults",
447 "libbinder_tls_shared_deps",
448 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000449
450 // Add the Trusty mock library as a fake dependency so it gets built
451 required: [
452 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000453 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000454 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000455 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000456 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000457 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000458}
459
460cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000461 name: "binderRpcTestNoKernel",
462 defaults: [
463 "binderRpcTest_defaults",
464 "binderRpcTest_static_defaults",
465 ],
466 static_libs: [
467 "libbinder_rpc_no_kernel",
468 ],
469}
470
471cc_test {
Tomasz Wasilczyk2265ad92024-05-01 12:54:46 -0700472 name: "binderRpcTestNoKernelAtAll",
473 defaults: [
474 "binderRpcTest_defaults",
475 "binderRpcTest_static_defaults",
476 ],
477 static_libs: [
478 "libbinder_rpc_no_kernel",
479 ],
480 cflags: [
481 "-DBINDER_NO_KERNEL_IPC_TESTING",
482 ],
483}
484
485cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000486 name: "binderRpcTestSingleThreaded",
487 defaults: [
488 "binderRpcTest_defaults",
489 "binderRpcTest_static_defaults",
490 ],
491 cflags: [
492 "-DBINDER_RPC_SINGLE_THREADED",
493 "-DBINDER_WITH_KERNEL_IPC",
494 ],
495 static_libs: [
496 "libbinder_rpc_single_threaded",
497 ],
498}
499
500cc_test {
501 name: "binderRpcTestSingleThreadedNoKernel",
502 defaults: [
503 "binderRpcTest_defaults",
504 "binderRpcTest_static_defaults",
505 ],
506 cflags: [
507 "-DBINDER_RPC_SINGLE_THREADED",
508 ],
509 static_libs: [
510 "libbinder_rpc_single_threaded_no_kernel",
511 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700512 shared_libs: [
513 "libbinder_ndk",
514 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000515}
516
Yifan Hongff73aa92021-09-17 21:28:01 -0700517cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000518 name: "binderRpcToTrustyTest",
519 vendor: true,
520 host_supported: false,
521 defaults: [
522 "binderRpcTest_common_defaults",
523 "binderRpcTest_static_defaults",
524 ],
525
526 srcs: [
527 "binderRpcTest.cpp",
528 "binderRpcTestCommon.cpp",
529 "binderRpcUniversalTests.cpp",
530 ],
531
532 cflags: [
533 "-DBINDER_RPC_TO_TRUSTY_TEST",
534 ],
535
536 static_libs: [
537 // We want to link libbinder statically so we can push the binary
538 // to the device for testing independently of the library
539 "libbinder_rpc_no_kernel",
540 "libbinder_trusty",
541 "libtrusty",
542 ],
543
544 test_suites: ["device-tests"],
545 require_root: true,
546}
547
548cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700549 name: "RpcTlsUtilsTest",
550 host_supported: true,
551 target: {
552 darwin: {
553 enabled: false,
554 },
555 android: {
556 test_suites: ["vts"],
557 },
558 },
559 defaults: [
560 "binder_test_defaults",
561 "libbinder_tls_shared_deps",
562 ],
563 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700564 "RpcTlsUtilsTest.cpp",
565 ],
566 shared_libs: [
567 "libbinder",
568 "libbase",
569 "libutils",
570 "liblog",
571 ],
572 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700573 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700574 "libbinder_tls_static",
575 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000576 test_suites: [
577 "general-tests",
578 "device-tests",
579 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700580}
581
Steven Morelandcda60852021-04-14 23:45:32 +0000582cc_benchmark {
583 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700584 defaults: [
585 "binder_test_defaults",
586 "libbinder_tls_shared_deps",
587 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000588 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000589 target: {
590 darwin: {
591 enabled: false,
592 },
593 },
Steven Morelandcda60852021-04-14 23:45:32 +0000594 srcs: [
595 "binderRpcBenchmark.cpp",
596 "IBinderRpcBenchmark.aidl",
597 ],
598 shared_libs: [
599 "libbase",
600 "libbinder",
601 "liblog",
602 "libutils",
603 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700604 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700605 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700606 "libbinder_tls_static",
607 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000608}
609
Steven Moreland5553ac42020-11-11 02:14:45 +0000610cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700611 name: "binderRpcWireProtocolTest",
612 host_supported: true,
613 target: {
614 darwin: {
615 enabled: false,
616 },
617 android: {
618 test_suites: ["vts"],
619 },
620 },
621 defaults: [
622 "binder_test_defaults",
623 ],
624 srcs: [
625 "binderRpcWireProtocolTest.cpp",
626 ],
627 shared_libs: [
628 "libbinder",
629 "libbase",
630 "libutils",
631 "libcutils",
632 "liblog",
633 ],
634 test_suites: ["general-tests"],
635}
636
637cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700638 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700639 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700640 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700641 shared_libs: [
642 "libbinder",
643 "libutils",
644 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700645 cflags: [
646 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700647 "-Wno-missing-field-initializers",
648 "-Wno-sign-compare",
649 "-O3",
650 ],
651}
Wei Wang78f2a372016-10-20 23:18:17 -0700652
653cc_test {
654 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700655 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700656 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700657 shared_libs: [
658 "libbinder",
659 "libutils",
660 "libbase",
661 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700662 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700663}
Howard Chenc135dbc2017-03-25 17:12:59 +0800664
665cc_test {
666 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700667 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700668 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800669 shared_libs: [
670 "libbinder",
671 "libutils",
672 "libbase",
673 ],
674}
Dan Stozad630e522016-12-01 15:16:31 -0800675
676cc_test {
677 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700678 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700679 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800680
681 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800682 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800683 ],
684
685 cpp_std: "experimental",
686 gnu_extensions: false,
687
688 shared_libs: [
689 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700690 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800691 "liblog",
692 "libutils",
693 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000694 test_suites: [
695 "device-tests",
696 "vts",
697 ],
Dan Shi80ada592019-09-13 09:17:17 -0700698 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800699}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700700
Steven Morelandf23dae22020-10-27 19:34:55 +0000701cc_test {
702 name: "binderClearBufTest",
703 defaults: ["binder_test_defaults"],
704 srcs: [
705 "binderClearBufTest.cpp",
706 ],
707
708 shared_libs: [
709 "libbase",
710 "libbinder",
711 "liblog",
712 "libutils",
713 ],
714
715 test_suites: ["general-tests"],
716 require_root: true,
717}
718
Steven Moreland12300a02019-08-02 13:27:15 -0700719aidl_interface {
720 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900721 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700722 srcs: [
723 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700724 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000725 backend: {
726 java: {
727 enabled: false,
728 },
729 },
Steven Moreland12300a02019-08-02 13:27:15 -0700730}
731
Steven Morelanddea3cf92019-07-16 18:06:55 -0700732cc_test {
733 name: "binderStabilityTest",
734 defaults: ["binder_test_defaults"],
735 srcs: [
736 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700737 ],
738
Steven Moreland13f84662020-07-23 21:30:41 +0000739 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700740 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700741 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700742 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700743 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700744 "libutils",
745 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700746 static_libs: [
747 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900748 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700749 ],
750
Steven Morelandea7659e2022-02-03 00:04:06 +0000751 test_suites: [
752 "device-tests",
753 "vts",
754 ],
Dan Shi302709b2019-09-19 15:28:15 -0700755 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700756}
Steven Moreland042ae822020-05-27 17:45:17 +0000757
758cc_test {
759 name: "binderAllocationLimits",
760 defaults: ["binder_test_defaults"],
761 srcs: ["binderAllocationLimits.cpp"],
762 shared_libs: [
763 "libbinder",
764 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000765 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000766 "libutils",
767 "libutilscallstack",
768 "libbase",
769 ],
770 test_suites: ["device-tests"],
771 require_root: true,
772}
Andy Hung73a14702020-11-24 13:04:46 -0800773
774cc_benchmark {
775 name: "binderParcelBenchmark",
776 defaults: ["binder_test_defaults"],
777 srcs: ["binderParcelBenchmark.cpp"],
778 shared_libs: [
779 "libbase",
780 "libbinder",
781 "liblog",
782 "libutils",
783 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000784 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800785}
Yifan Hongaf766e62021-06-14 13:24:19 -0700786
787cc_test_host {
788 name: "binderUtilsHostTest",
789 defaults: ["binder_test_defaults"],
790 srcs: ["binderUtilsHostTest.cpp"],
791 shared_libs: [
792 "libbase",
793 "libbinder",
794 ],
795 static_libs: [
796 "libgmock",
797 ],
798 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700799 target: {
800 darwin: {
801 enabled: false,
802 },
803 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700804}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700805
806cc_test_host {
807 name: "binderHostDeviceTest",
808 defaults: ["binder_test_defaults"],
809 srcs: ["binderHostDeviceTest.cpp"],
810 test_config: "binderHostDeviceTest.xml",
811 shared_libs: [
812 "libbase",
813 "libbinder",
814 "liblog",
815 "libutils",
816 ],
817 static_libs: [
818 "libgmock",
819 ],
820 target_required: [
821 "binderHostDeviceTestService",
822 ],
823 test_suites: ["general-tests"],
824 target: {
825 darwin: {
826 enabled: false,
827 },
828 },
829 test_options: {
830 unit_test: false,
831 },
832}
833
834cc_test {
835 name: "binderHostDeviceTestService",
836 // The binary is named differently from the module so that PushFilePreparer pushes the binary
837 // directly, not the test module directory.
838 stem: "binderHostDeviceTest-service",
839 defaults: ["binder_test_defaults"],
840 gtest: false,
841 auto_gen_config: false,
842 srcs: ["binderHostDeviceTestService.cpp"],
843 shared_libs: [
844 "libbase",
845 "libbinder",
846 "liblog",
847 "libutils",
848 ],
849 test_suites: ["general-tests"],
850}
Pawanf00fabb2022-08-04 17:56:18 +0000851
852cc_defaults {
853 name: "service_fuzzer_defaults",
854 static_libs: [
855 "libbase",
856 "libbinder_random_parcel",
857 "libcutils",
858 ],
859 target: {
860 android: {
861 shared_libs: [
862 "libbinder_ndk",
863 "libbinder",
864 "libutils",
865 ],
866 },
867 host: {
868 static_libs: [
869 "libbinder_ndk",
870 "libbinder",
871 "libutils",
872 ],
873 },
874 darwin: {
875 enabled: false,
876 },
877 },
878 fuzz_config: {
879 cc: [
880 "smoreland@google.com",
881 "waghpawan@google.com",
882 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000883 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
884 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000885 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000886 },
887}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000888
889cc_defaults {
890 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000891 fuzz_config: {
892 asan_options: [
893 "detect_leaks=0",
894 ],
895 hwasan_options: [
896 "detect_leaks=0",
897 ],
898 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000899}