blob: dd50fbdc38bdd3e1021a92f686b9cbe9a8cc4ad8 [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
Devin Moore1df9c5f2024-07-23 22:09:29 +0000238 compile_multilib: "both",
239 multilib: {
240 lib32: {
241 suffix: "32",
242 },
243 lib64: {
244 suffix: "64",
245 },
246 },
247
Andrei Homescu12106de2022-04-27 04:42:21 +0000248 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700249 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000250 "libbinder_tls_static",
251 "libbinder_tls_test_utils",
252 "binderRpcTestIface-cpp",
253 "binderRpcTestIface-ndk",
254 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000255}
256
257cc_defaults {
258 name: "binderRpcTest_service_defaults",
259 defaults: [
260 "binderRpcTest_common_defaults",
261 ],
262 gtest: false,
263 auto_gen_config: false,
264 srcs: [
265 "binderRpcTestCommon.cpp",
266 "binderRpcTestService.cpp",
267 ],
268}
269
270cc_defaults {
271 name: "binderRpcTest_defaults",
272 target: {
273 android: {
274 test_suites: ["vts"],
275 },
276 },
277 defaults: [
278 "binderRpcTest_common_defaults",
279 ],
280
281 srcs: [
282 "binderRpcTest.cpp",
283 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000284 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000285 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000286
Steven Moreland20531612023-04-04 18:03:24 +0000287 // This test uses a lot of resources and takes a long time. Due to
288 // design of several tests, it is also very sensitive to resource
289 // contention on the device. b/276820894
290 test_options: {
291 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000292 test_runner_options: [
293 {
294 name: "native-test-timeout",
295 value: "10m",
296 },
297 ],
Steven Moreland20531612023-04-04 18:03:24 +0000298 },
299
Andrei Homescu12106de2022-04-27 04:42:21 +0000300 test_suites: ["general-tests"],
301 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000302
303 data_bins: [
304 "binder_rpc_test_service",
305 "binder_rpc_test_service_no_kernel",
306 "binder_rpc_test_service_single_threaded",
307 "binder_rpc_test_service_single_threaded_no_kernel",
308 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000309}
310
Andrei Homescu2a298012022-06-15 01:08:54 +0000311cc_defaults {
312 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000313 cflags: [
314 "-DBINDER_WITH_KERNEL_IPC",
315 ],
316
Steven Moreland5553ac42020-11-11 02:14:45 +0000317 shared_libs: [
318 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000319 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000320 "libbase",
321 "libutils",
322 "libcutils",
323 "liblog",
324 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000325}
326
327cc_defaults {
328 name: "binderRpcTest_static_defaults",
329
330 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000331 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000332 "libutils",
333 // libcrypto_static is not visible to this module
334 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000335 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000336 static_libs: [
337 "libbase",
338 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000339 "libssl",
340 ],
341
342 cflags: [
343 // Disable tests that require shared libraries,
344 // e.g., libbinder.so or libbinder_ndk.so
345 "-DBINDER_TEST_NO_SHARED_LIBS",
346 ],
347}
348
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700349cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000350 // The module name cannot start with "binderRpcTest" because
351 // then atest tries to execute it as part of binderRpcTest
352 name: "binder_rpc_test_service",
353 defaults: [
354 "binderRpcTest_service_defaults",
355 "binderRpcTest_shared_defaults",
356 "libbinder_tls_shared_deps",
357 ],
358}
359
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700360cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000361 name: "binder_rpc_test_service_no_kernel",
362 defaults: [
363 "binderRpcTest_service_defaults",
364 "binderRpcTest_static_defaults",
365 ],
366 static_libs: [
367 "libbinder_rpc_no_kernel",
368 ],
369}
370
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700371cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000372 name: "binder_rpc_test_service_single_threaded",
373 defaults: [
374 "binderRpcTest_service_defaults",
375 "binderRpcTest_static_defaults",
376 ],
377 cflags: [
378 "-DBINDER_RPC_SINGLE_THREADED",
379 "-DBINDER_WITH_KERNEL_IPC",
380 ],
381 static_libs: [
382 "libbinder_rpc_single_threaded",
383 ],
384}
385
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700386cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000387 name: "binder_rpc_test_service_single_threaded_no_kernel",
388 defaults: [
389 "binderRpcTest_service_defaults",
390 "binderRpcTest_static_defaults",
391 ],
392 cflags: [
393 "-DBINDER_RPC_SINGLE_THREADED",
394 ],
395 static_libs: [
396 "libbinder_rpc_single_threaded_no_kernel",
397 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700398 shared_libs: [
399 "libbinder_ndk",
400 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000401}
402
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000403cc_binary {
404 name: "binderRpcTestService_on_trusty_mock",
405 defaults: [
406 "trusty_mock_defaults",
407 ],
408
409 srcs: [
410 "binderRpcTestCommon.cpp",
411 "binderRpcTestServiceTrusty.cpp",
412 ],
413
414 shared_libs: [
415 "libbinder_on_trusty_mock",
416 "libbase",
417 "libutils",
418 "libcutils",
419 ],
420
421 static_libs: [
422 "binderRpcTestIface-cpp",
423 ],
424}
425
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000426cc_binary {
427 name: "binderRpcTest_on_trusty_mock",
428 defaults: [
429 "trusty_mock_defaults",
430 ],
431
432 srcs: [
433 "binderRpcUniversalTests.cpp",
434 "binderRpcTestCommon.cpp",
435 "binderRpcTestTrusty.cpp",
436 ],
437
438 shared_libs: [
439 "libbinder_on_trusty_mock",
440 "libbase",
441 "libutils",
442 "libcutils",
443 ],
444
445 static_libs: [
446 "binderRpcTestIface-cpp",
447 "libgtest",
448 ],
449}
450
Andrei Homescu2a298012022-06-15 01:08:54 +0000451cc_test {
452 name: "binderRpcTest",
453 defaults: [
454 "binderRpcTest_defaults",
455 "binderRpcTest_shared_defaults",
456 "libbinder_tls_shared_deps",
457 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000458
459 // Add the Trusty mock library as a fake dependency so it gets built
460 required: [
461 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000462 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000463 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000464 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000465 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000466 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000467}
468
469cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000470 name: "binderRpcTestNoKernel",
471 defaults: [
472 "binderRpcTest_defaults",
473 "binderRpcTest_static_defaults",
474 ],
475 static_libs: [
476 "libbinder_rpc_no_kernel",
477 ],
478}
479
480cc_test {
Tomasz Wasilczyk2265ad92024-05-01 12:54:46 -0700481 name: "binderRpcTestNoKernelAtAll",
482 defaults: [
483 "binderRpcTest_defaults",
484 "binderRpcTest_static_defaults",
485 ],
486 static_libs: [
487 "libbinder_rpc_no_kernel",
488 ],
489 cflags: [
490 "-DBINDER_NO_KERNEL_IPC_TESTING",
491 ],
492}
493
494cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000495 name: "binderRpcTestSingleThreaded",
496 defaults: [
497 "binderRpcTest_defaults",
498 "binderRpcTest_static_defaults",
499 ],
500 cflags: [
501 "-DBINDER_RPC_SINGLE_THREADED",
502 "-DBINDER_WITH_KERNEL_IPC",
503 ],
504 static_libs: [
505 "libbinder_rpc_single_threaded",
506 ],
507}
508
509cc_test {
510 name: "binderRpcTestSingleThreadedNoKernel",
511 defaults: [
512 "binderRpcTest_defaults",
513 "binderRpcTest_static_defaults",
514 ],
515 cflags: [
516 "-DBINDER_RPC_SINGLE_THREADED",
517 ],
518 static_libs: [
519 "libbinder_rpc_single_threaded_no_kernel",
520 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700521 shared_libs: [
522 "libbinder_ndk",
523 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000524}
525
Yifan Hongff73aa92021-09-17 21:28:01 -0700526cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000527 name: "binderRpcToTrustyTest",
528 vendor: true,
529 host_supported: false,
530 defaults: [
531 "binderRpcTest_common_defaults",
532 "binderRpcTest_static_defaults",
533 ],
534
535 srcs: [
536 "binderRpcTest.cpp",
537 "binderRpcTestCommon.cpp",
538 "binderRpcUniversalTests.cpp",
539 ],
540
541 cflags: [
542 "-DBINDER_RPC_TO_TRUSTY_TEST",
543 ],
544
545 static_libs: [
546 // We want to link libbinder statically so we can push the binary
547 // to the device for testing independently of the library
548 "libbinder_rpc_no_kernel",
549 "libbinder_trusty",
550 "libtrusty",
551 ],
552
553 test_suites: ["device-tests"],
554 require_root: true,
555}
556
557cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700558 name: "RpcTlsUtilsTest",
559 host_supported: true,
560 target: {
561 darwin: {
562 enabled: false,
563 },
564 android: {
565 test_suites: ["vts"],
566 },
567 },
568 defaults: [
569 "binder_test_defaults",
570 "libbinder_tls_shared_deps",
571 ],
572 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700573 "RpcTlsUtilsTest.cpp",
574 ],
575 shared_libs: [
576 "libbinder",
577 "libbase",
578 "libutils",
579 "liblog",
580 ],
581 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700582 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700583 "libbinder_tls_static",
584 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000585 test_suites: [
586 "general-tests",
587 "device-tests",
588 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700589}
590
Steven Morelandcda60852021-04-14 23:45:32 +0000591cc_benchmark {
592 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700593 defaults: [
594 "binder_test_defaults",
595 "libbinder_tls_shared_deps",
596 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000597 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000598 target: {
599 darwin: {
600 enabled: false,
601 },
602 },
Steven Morelandcda60852021-04-14 23:45:32 +0000603 srcs: [
604 "binderRpcBenchmark.cpp",
605 "IBinderRpcBenchmark.aidl",
606 ],
607 shared_libs: [
608 "libbase",
609 "libbinder",
610 "liblog",
611 "libutils",
612 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700613 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700614 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700615 "libbinder_tls_static",
616 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000617}
618
Steven Moreland5553ac42020-11-11 02:14:45 +0000619cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700620 name: "binderRpcWireProtocolTest",
621 host_supported: true,
622 target: {
623 darwin: {
624 enabled: false,
625 },
626 android: {
627 test_suites: ["vts"],
628 },
629 },
630 defaults: [
631 "binder_test_defaults",
632 ],
633 srcs: [
634 "binderRpcWireProtocolTest.cpp",
635 ],
636 shared_libs: [
637 "libbinder",
638 "libbase",
639 "libutils",
640 "libcutils",
641 "liblog",
642 ],
643 test_suites: ["general-tests"],
644}
645
646cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700647 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700648 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700649 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700650 shared_libs: [
651 "libbinder",
652 "libutils",
653 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700654 cflags: [
655 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700656 "-Wno-missing-field-initializers",
657 "-Wno-sign-compare",
658 "-O3",
659 ],
660}
Wei Wang78f2a372016-10-20 23:18:17 -0700661
662cc_test {
663 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700664 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700665 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700666 shared_libs: [
667 "libbinder",
668 "libutils",
669 "libbase",
670 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700671 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700672}
Howard Chenc135dbc2017-03-25 17:12:59 +0800673
674cc_test {
675 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700676 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700677 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800678 shared_libs: [
679 "libbinder",
680 "libutils",
681 "libbase",
682 ],
683}
Dan Stozad630e522016-12-01 15:16:31 -0800684
685cc_test {
686 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700687 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700688 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800689
690 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800691 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800692 ],
693
694 cpp_std: "experimental",
695 gnu_extensions: false,
696
697 shared_libs: [
698 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700699 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800700 "liblog",
701 "libutils",
702 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000703 test_suites: [
704 "device-tests",
705 "vts",
706 ],
Dan Shi80ada592019-09-13 09:17:17 -0700707 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800708}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700709
Steven Morelandf23dae22020-10-27 19:34:55 +0000710cc_test {
711 name: "binderClearBufTest",
712 defaults: ["binder_test_defaults"],
713 srcs: [
714 "binderClearBufTest.cpp",
715 ],
716
717 shared_libs: [
718 "libbase",
719 "libbinder",
720 "liblog",
721 "libutils",
722 ],
723
724 test_suites: ["general-tests"],
725 require_root: true,
726}
727
Steven Moreland12300a02019-08-02 13:27:15 -0700728aidl_interface {
729 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900730 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700731 srcs: [
732 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700733 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000734 backend: {
735 java: {
736 enabled: false,
737 },
738 },
Steven Moreland12300a02019-08-02 13:27:15 -0700739}
740
Steven Morelanddea3cf92019-07-16 18:06:55 -0700741cc_test {
742 name: "binderStabilityTest",
743 defaults: ["binder_test_defaults"],
744 srcs: [
745 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700746 ],
747
Steven Moreland13f84662020-07-23 21:30:41 +0000748 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700749 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700750 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700751 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700752 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700753 "libutils",
754 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700755 static_libs: [
756 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900757 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700758 ],
759
Steven Morelandea7659e2022-02-03 00:04:06 +0000760 test_suites: [
761 "device-tests",
762 "vts",
763 ],
Dan Shi302709b2019-09-19 15:28:15 -0700764 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700765}
Steven Moreland042ae822020-05-27 17:45:17 +0000766
767cc_test {
768 name: "binderAllocationLimits",
769 defaults: ["binder_test_defaults"],
770 srcs: ["binderAllocationLimits.cpp"],
771 shared_libs: [
772 "libbinder",
773 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000774 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000775 "libutils",
776 "libutilscallstack",
777 "libbase",
778 ],
779 test_suites: ["device-tests"],
780 require_root: true,
781}
Andy Hung73a14702020-11-24 13:04:46 -0800782
783cc_benchmark {
784 name: "binderParcelBenchmark",
785 defaults: ["binder_test_defaults"],
786 srcs: ["binderParcelBenchmark.cpp"],
787 shared_libs: [
788 "libbase",
789 "libbinder",
790 "liblog",
791 "libutils",
792 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000793 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800794}
Yifan Hongaf766e62021-06-14 13:24:19 -0700795
796cc_test_host {
797 name: "binderUtilsHostTest",
798 defaults: ["binder_test_defaults"],
799 srcs: ["binderUtilsHostTest.cpp"],
800 shared_libs: [
801 "libbase",
802 "libbinder",
803 ],
804 static_libs: [
805 "libgmock",
806 ],
807 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700808 target: {
809 darwin: {
810 enabled: false,
811 },
812 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700813}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700814
815cc_test_host {
816 name: "binderHostDeviceTest",
817 defaults: ["binder_test_defaults"],
818 srcs: ["binderHostDeviceTest.cpp"],
819 test_config: "binderHostDeviceTest.xml",
820 shared_libs: [
821 "libbase",
822 "libbinder",
823 "liblog",
824 "libutils",
825 ],
826 static_libs: [
827 "libgmock",
828 ],
829 target_required: [
830 "binderHostDeviceTestService",
831 ],
832 test_suites: ["general-tests"],
833 target: {
834 darwin: {
835 enabled: false,
836 },
837 },
838 test_options: {
839 unit_test: false,
840 },
841}
842
843cc_test {
844 name: "binderHostDeviceTestService",
845 // The binary is named differently from the module so that PushFilePreparer pushes the binary
846 // directly, not the test module directory.
847 stem: "binderHostDeviceTest-service",
848 defaults: ["binder_test_defaults"],
849 gtest: false,
850 auto_gen_config: false,
851 srcs: ["binderHostDeviceTestService.cpp"],
852 shared_libs: [
853 "libbase",
854 "libbinder",
855 "liblog",
856 "libutils",
857 ],
858 test_suites: ["general-tests"],
859}
Pawanf00fabb2022-08-04 17:56:18 +0000860
861cc_defaults {
862 name: "service_fuzzer_defaults",
863 static_libs: [
864 "libbase",
865 "libbinder_random_parcel",
866 "libcutils",
867 ],
868 target: {
869 android: {
870 shared_libs: [
871 "libbinder_ndk",
872 "libbinder",
873 "libutils",
874 ],
875 },
876 host: {
877 static_libs: [
878 "libbinder_ndk",
879 "libbinder",
880 "libutils",
881 ],
882 },
883 darwin: {
884 enabled: false,
885 },
886 },
887 fuzz_config: {
888 cc: [
889 "smoreland@google.com",
890 "waghpawan@google.com",
891 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000892 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
893 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000894 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000895 },
896}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000897
898cc_defaults {
899 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000900 fuzz_config: {
901 asan_options: [
902 "detect_leaks=0",
903 ],
904 hwasan_options: [
905 "detect_leaks=0",
906 ],
907 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000908}