blob: 35002eb3c506884af209ae5835aa46b70e0b940a [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",
28 cflags: [
29 "-Wall",
30 "-Werror",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070031 ],
32}
33
Dan Willemsen59e086f2016-07-25 17:13:45 -070034cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070035 name: "binderDriverInterfaceTest",
36 defaults: ["binder_test_defaults"],
Yifan Hong4e419d82021-04-26 11:32:56 -070037 header_libs: ["libbinder_headers"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070038 srcs: ["binderDriverInterfaceTest.cpp"],
Steven Morelandea7659e2022-02-03 00:04:06 +000039 test_suites: [
40 "device-tests",
41 "vts",
42 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070043}
44
Steven Morelandcefba612020-11-05 22:57:06 +000045// unit test only, which can run on host and doesn't use /dev/binder
46cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000047 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000048 host_supported: true,
49 target: {
50 darwin: {
51 enabled: false,
52 },
53 },
Steven Morelandea7659e2022-02-03 00:04:06 +000054 srcs: [
55 "binderParcelUnitTest.cpp",
56 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +000057 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -050058 "binderMemoryHeapBaseUnitTest.cpp",
Fabián Cañas08bdc772023-01-02 15:02:56 -050059 "binderRecordedTransactionTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +000060 ],
Steven Morelandcefba612020-11-05 22:57:06 +000061 shared_libs: [
62 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -070063 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +000064 "libutils",
65 ],
66 test_suites: ["general-tests"],
67}
68
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080069cc_test {
Steven Morelanda8244b92023-04-20 23:34:11 +000070 name: "binderRecordReplayTest",
71 srcs: ["binderRecordReplayTest.cpp"],
Pawan Wagh76b18152023-12-01 14:30:26 +000072 cflags: [
73 "-DBINDER_WITH_KERNEL_IPC",
74 ],
Steven Morelanda8244b92023-04-20 23:34:11 +000075 shared_libs: [
76 "libbinder",
77 "libcutils",
78 "libutils",
Pawan Wagh76b18152023-12-01 14:30:26 +000079 "liblog",
Steven Morelanda8244b92023-04-20 23:34:11 +000080 ],
81 static_libs: [
82 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +000083 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +000084 "libbinder_random_parcel_seeds",
85 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +000086 ],
87 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +000088 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +000089}
90
91aidl_interface {
92 name: "binderRecordReplayTestIface",
93 unstable: true,
94 srcs: [
95 "IBinderRecordReplayTest.aidl",
96 ],
Pawan Wagh8da45382023-05-11 08:08:50 +000097 imports: ["binderReadParcelIface"],
98 backend: {
99 java: {
100 enabled: true,
101 platform_apis: true,
102 },
Steven Moreland59813352024-02-08 23:52:11 +0000103
104 // TODO: switch from FileDescriptor to ParcelFileDescriptor
Pawan Wagh76b18152023-12-01 14:30:26 +0000105 ndk: {
106 enabled: false,
107 },
Steven Moreland59813352024-02-08 23:52:11 +0000108 rust: {
109 enabled: false,
110 },
Pawan Wagh8da45382023-05-11 08:08:50 +0000111 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000112}
113
114cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700115 name: "binderLibTest",
116 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800117
Dan Willemsen59e086f2016-07-25 17:13:45 -0700118 srcs: ["binderLibTest.cpp"],
119 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700120 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700121 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700122 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700123 "libutils",
124 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700125 static_libs: [
126 "libgmock",
127 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000128 test_suites: [
129 "device-tests",
130 "vts",
131 ],
Dan Shi80ada592019-09-13 09:17:17 -0700132 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700133}
134
Steven Moreland37aff182021-03-26 02:04:16 +0000135aidl_interface {
136 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000137 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000138 host_supported: true,
139 unstable: true,
140 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700141 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000142 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700143 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000144 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000145 "IBinderRpcSession.aidl",
146 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700147 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000148 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800149 flags: [
150 "-Werror",
151 "-Wno-mixed-oneway",
152 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000153 backend: {
154 java: {
155 enabled: false,
156 },
157 },
158}
159
Yifan Honge0e53282021-09-23 18:37:21 -0700160cc_library_static {
161 name: "libbinder_tls_test_utils",
162 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000163 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700164 target: {
165 darwin: {
166 enabled: false,
167 },
168 },
169 defaults: [
170 "binder_test_defaults",
171 "libbinder_tls_shared_deps",
172 ],
173 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700174 "libbase",
175 "liblog",
176 ],
177 static_libs: [
178 "libbinder_tls_static",
179 ],
180 srcs: [
181 "RpcTlsTestUtils.cpp",
182 ],
183 export_include_dirs: [
184 "include_tls_test_utils",
185 ],
186 visibility: [
187 ":__subpackages__",
188 ],
189}
190
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700191cc_library_static {
192 name: "libbinder_test_utils",
193 host_supported: true,
194 vendor_available: true,
195 target: {
196 darwin: {
197 enabled: false,
198 },
199 },
200 defaults: [
201 "binder_test_defaults",
202 ],
203 shared_libs: [
204 "libbase",
205 "liblog",
206 ],
207 srcs: [
208 "FileUtils.cpp",
209 ],
210 visibility: [
211 ":__subpackages__",
212 ],
213}
214
Andrei Homescu12106de2022-04-27 04:42:21 +0000215cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000216 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000217 host_supported: true,
218 target: {
219 darwin: {
220 enabled: false,
221 },
222 },
Steven Moreland37aff182021-03-26 02:04:16 +0000223 defaults: [
224 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000225 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000226
Andrei Homescu12106de2022-04-27 04:42:21 +0000227 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700228 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000229 "libbinder_tls_static",
230 "libbinder_tls_test_utils",
231 "binderRpcTestIface-cpp",
232 "binderRpcTestIface-ndk",
233 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000234}
235
236cc_defaults {
237 name: "binderRpcTest_service_defaults",
238 defaults: [
239 "binderRpcTest_common_defaults",
240 ],
241 gtest: false,
242 auto_gen_config: false,
243 srcs: [
244 "binderRpcTestCommon.cpp",
245 "binderRpcTestService.cpp",
246 ],
247}
248
249cc_defaults {
250 name: "binderRpcTest_defaults",
251 target: {
252 android: {
253 test_suites: ["vts"],
254 },
255 },
256 defaults: [
257 "binderRpcTest_common_defaults",
258 ],
259
260 srcs: [
261 "binderRpcTest.cpp",
262 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000263 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000264 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000265
Steven Moreland20531612023-04-04 18:03:24 +0000266 // This test uses a lot of resources and takes a long time. Due to
267 // design of several tests, it is also very sensitive to resource
268 // contention on the device. b/276820894
269 test_options: {
270 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000271 test_runner_options: [
272 {
273 name: "native-test-timeout",
274 value: "10m",
275 },
276 ],
Steven Moreland20531612023-04-04 18:03:24 +0000277 },
278
Andrei Homescu12106de2022-04-27 04:42:21 +0000279 test_suites: ["general-tests"],
280 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000281
282 data_bins: [
283 "binder_rpc_test_service",
284 "binder_rpc_test_service_no_kernel",
285 "binder_rpc_test_service_single_threaded",
286 "binder_rpc_test_service_single_threaded_no_kernel",
287 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000288}
289
Andrei Homescu2a298012022-06-15 01:08:54 +0000290cc_defaults {
291 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000292 cflags: [
293 "-DBINDER_WITH_KERNEL_IPC",
294 ],
295
Steven Moreland5553ac42020-11-11 02:14:45 +0000296 shared_libs: [
297 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000298 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000299 "libbase",
300 "libutils",
301 "libcutils",
302 "liblog",
303 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000304}
305
306cc_defaults {
307 name: "binderRpcTest_static_defaults",
308
309 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000310 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000311 "libutils",
312 // libcrypto_static is not visible to this module
313 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000314 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000315 static_libs: [
316 "libbase",
317 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000318 "libssl",
319 ],
320
321 cflags: [
322 // Disable tests that require shared libraries,
323 // e.g., libbinder.so or libbinder_ndk.so
324 "-DBINDER_TEST_NO_SHARED_LIBS",
325 ],
326}
327
328cc_test {
Andrei Homescu2a298012022-06-15 01:08:54 +0000329 // The module name cannot start with "binderRpcTest" because
330 // then atest tries to execute it as part of binderRpcTest
331 name: "binder_rpc_test_service",
332 defaults: [
333 "binderRpcTest_service_defaults",
334 "binderRpcTest_shared_defaults",
335 "libbinder_tls_shared_deps",
336 ],
337}
338
339cc_test {
340 name: "binder_rpc_test_service_no_kernel",
341 defaults: [
342 "binderRpcTest_service_defaults",
343 "binderRpcTest_static_defaults",
344 ],
345 static_libs: [
346 "libbinder_rpc_no_kernel",
347 ],
348}
349
350cc_test {
351 name: "binder_rpc_test_service_single_threaded",
352 defaults: [
353 "binderRpcTest_service_defaults",
354 "binderRpcTest_static_defaults",
355 ],
356 cflags: [
357 "-DBINDER_RPC_SINGLE_THREADED",
358 "-DBINDER_WITH_KERNEL_IPC",
359 ],
360 static_libs: [
361 "libbinder_rpc_single_threaded",
362 ],
363}
364
365cc_test {
366 name: "binder_rpc_test_service_single_threaded_no_kernel",
367 defaults: [
368 "binderRpcTest_service_defaults",
369 "binderRpcTest_static_defaults",
370 ],
371 cflags: [
372 "-DBINDER_RPC_SINGLE_THREADED",
373 ],
374 static_libs: [
375 "libbinder_rpc_single_threaded_no_kernel",
376 ],
377}
378
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000379cc_binary {
380 name: "binderRpcTestService_on_trusty_mock",
381 defaults: [
382 "trusty_mock_defaults",
383 ],
384
385 srcs: [
386 "binderRpcTestCommon.cpp",
387 "binderRpcTestServiceTrusty.cpp",
388 ],
389
390 shared_libs: [
391 "libbinder_on_trusty_mock",
392 "libbase",
393 "libutils",
394 "libcutils",
395 ],
396
397 static_libs: [
398 "binderRpcTestIface-cpp",
399 ],
400}
401
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000402cc_binary {
403 name: "binderRpcTest_on_trusty_mock",
404 defaults: [
405 "trusty_mock_defaults",
406 ],
407
408 srcs: [
409 "binderRpcUniversalTests.cpp",
410 "binderRpcTestCommon.cpp",
411 "binderRpcTestTrusty.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 "libgtest",
424 ],
425}
426
Andrei Homescu2a298012022-06-15 01:08:54 +0000427cc_test {
428 name: "binderRpcTest",
429 defaults: [
430 "binderRpcTest_defaults",
431 "binderRpcTest_shared_defaults",
432 "libbinder_tls_shared_deps",
433 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000434
435 // Add the Trusty mock library as a fake dependency so it gets built
436 required: [
437 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000438 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000439 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000440 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000441 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000442 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000443}
444
445cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000446 name: "binderRpcTestNoKernel",
447 defaults: [
448 "binderRpcTest_defaults",
449 "binderRpcTest_static_defaults",
450 ],
451 static_libs: [
452 "libbinder_rpc_no_kernel",
453 ],
454}
455
456cc_test {
457 name: "binderRpcTestSingleThreaded",
458 defaults: [
459 "binderRpcTest_defaults",
460 "binderRpcTest_static_defaults",
461 ],
462 cflags: [
463 "-DBINDER_RPC_SINGLE_THREADED",
464 "-DBINDER_WITH_KERNEL_IPC",
465 ],
466 static_libs: [
467 "libbinder_rpc_single_threaded",
468 ],
469}
470
471cc_test {
472 name: "binderRpcTestSingleThreadedNoKernel",
473 defaults: [
474 "binderRpcTest_defaults",
475 "binderRpcTest_static_defaults",
476 ],
477 cflags: [
478 "-DBINDER_RPC_SINGLE_THREADED",
479 ],
480 static_libs: [
481 "libbinder_rpc_single_threaded_no_kernel",
482 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000483}
484
Yifan Hongff73aa92021-09-17 21:28:01 -0700485cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000486 name: "binderRpcToTrustyTest",
487 vendor: true,
488 host_supported: false,
489 defaults: [
490 "binderRpcTest_common_defaults",
491 "binderRpcTest_static_defaults",
492 ],
493
494 srcs: [
495 "binderRpcTest.cpp",
496 "binderRpcTestCommon.cpp",
497 "binderRpcUniversalTests.cpp",
498 ],
499
500 cflags: [
501 "-DBINDER_RPC_TO_TRUSTY_TEST",
502 ],
503
504 static_libs: [
505 // We want to link libbinder statically so we can push the binary
506 // to the device for testing independently of the library
507 "libbinder_rpc_no_kernel",
508 "libbinder_trusty",
509 "libtrusty",
510 ],
511
512 test_suites: ["device-tests"],
513 require_root: true,
514}
515
516cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700517 name: "RpcTlsUtilsTest",
518 host_supported: true,
519 target: {
520 darwin: {
521 enabled: false,
522 },
523 android: {
524 test_suites: ["vts"],
525 },
526 },
527 defaults: [
528 "binder_test_defaults",
529 "libbinder_tls_shared_deps",
530 ],
531 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700532 "RpcTlsUtilsTest.cpp",
533 ],
534 shared_libs: [
535 "libbinder",
536 "libbase",
537 "libutils",
538 "liblog",
539 ],
540 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700541 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700542 "libbinder_tls_static",
543 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000544 test_suites: [
545 "general-tests",
546 "device-tests",
547 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700548}
549
Steven Morelandcda60852021-04-14 23:45:32 +0000550cc_benchmark {
551 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700552 defaults: [
553 "binder_test_defaults",
554 "libbinder_tls_shared_deps",
555 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000556 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000557 target: {
558 darwin: {
559 enabled: false,
560 },
561 },
Steven Morelandcda60852021-04-14 23:45:32 +0000562 srcs: [
563 "binderRpcBenchmark.cpp",
564 "IBinderRpcBenchmark.aidl",
565 ],
566 shared_libs: [
567 "libbase",
568 "libbinder",
569 "liblog",
570 "libutils",
571 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700572 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700573 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700574 "libbinder_tls_static",
575 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000576}
577
Steven Moreland5553ac42020-11-11 02:14:45 +0000578cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700579 name: "binderRpcWireProtocolTest",
580 host_supported: true,
581 target: {
582 darwin: {
583 enabled: false,
584 },
585 android: {
586 test_suites: ["vts"],
587 },
588 },
589 defaults: [
590 "binder_test_defaults",
591 ],
592 srcs: [
593 "binderRpcWireProtocolTest.cpp",
594 ],
595 shared_libs: [
596 "libbinder",
597 "libbase",
598 "libutils",
599 "libcutils",
600 "liblog",
601 ],
602 test_suites: ["general-tests"],
603}
604
605cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700606 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700607 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700608 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700609 shared_libs: [
610 "libbinder",
611 "libutils",
612 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700613 cflags: [
614 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700615 "-Wno-missing-field-initializers",
616 "-Wno-sign-compare",
617 "-O3",
618 ],
619}
Wei Wang78f2a372016-10-20 23:18:17 -0700620
621cc_test {
622 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700623 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700624 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700625 shared_libs: [
626 "libbinder",
627 "libutils",
628 "libbase",
629 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700630 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700631}
Howard Chenc135dbc2017-03-25 17:12:59 +0800632
633cc_test {
634 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700635 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700636 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800637 shared_libs: [
638 "libbinder",
639 "libutils",
640 "libbase",
641 ],
642}
Dan Stozad630e522016-12-01 15:16:31 -0800643
644cc_test {
645 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700646 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700647 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800648
649 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800650 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800651 ],
652
653 cpp_std: "experimental",
654 gnu_extensions: false,
655
656 shared_libs: [
657 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700658 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800659 "liblog",
660 "libutils",
661 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000662 test_suites: [
663 "device-tests",
664 "vts",
665 ],
Dan Shi80ada592019-09-13 09:17:17 -0700666 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800667}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700668
Steven Morelandf23dae22020-10-27 19:34:55 +0000669cc_test {
670 name: "binderClearBufTest",
671 defaults: ["binder_test_defaults"],
672 srcs: [
673 "binderClearBufTest.cpp",
674 ],
675
676 shared_libs: [
677 "libbase",
678 "libbinder",
679 "liblog",
680 "libutils",
681 ],
682
683 test_suites: ["general-tests"],
684 require_root: true,
685}
686
Steven Moreland12300a02019-08-02 13:27:15 -0700687aidl_interface {
688 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900689 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700690 srcs: [
691 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700692 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000693 backend: {
694 java: {
695 enabled: false,
696 },
697 },
Steven Moreland12300a02019-08-02 13:27:15 -0700698}
699
Steven Morelanddea3cf92019-07-16 18:06:55 -0700700cc_test {
701 name: "binderStabilityTest",
702 defaults: ["binder_test_defaults"],
703 srcs: [
704 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700705 ],
706
Steven Moreland13f84662020-07-23 21:30:41 +0000707 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700708 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700709 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700710 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700711 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700712 "libutils",
713 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700714 static_libs: [
715 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900716 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700717 ],
718
Steven Morelandea7659e2022-02-03 00:04:06 +0000719 test_suites: [
720 "device-tests",
721 "vts",
722 ],
Dan Shi302709b2019-09-19 15:28:15 -0700723 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700724}
Steven Moreland042ae822020-05-27 17:45:17 +0000725
726cc_test {
727 name: "binderAllocationLimits",
728 defaults: ["binder_test_defaults"],
729 srcs: ["binderAllocationLimits.cpp"],
730 shared_libs: [
731 "libbinder",
732 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000733 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000734 "libutils",
735 "libutilscallstack",
736 "libbase",
737 ],
738 test_suites: ["device-tests"],
739 require_root: true,
740}
Andy Hung73a14702020-11-24 13:04:46 -0800741
742cc_benchmark {
743 name: "binderParcelBenchmark",
744 defaults: ["binder_test_defaults"],
745 srcs: ["binderParcelBenchmark.cpp"],
746 shared_libs: [
747 "libbase",
748 "libbinder",
749 "liblog",
750 "libutils",
751 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000752 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800753}
Yifan Hongaf766e62021-06-14 13:24:19 -0700754
755cc_test_host {
756 name: "binderUtilsHostTest",
757 defaults: ["binder_test_defaults"],
758 srcs: ["binderUtilsHostTest.cpp"],
759 shared_libs: [
760 "libbase",
761 "libbinder",
762 ],
763 static_libs: [
764 "libgmock",
765 ],
766 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700767 target: {
768 darwin: {
769 enabled: false,
770 },
771 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700772}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700773
774cc_test_host {
775 name: "binderHostDeviceTest",
776 defaults: ["binder_test_defaults"],
777 srcs: ["binderHostDeviceTest.cpp"],
778 test_config: "binderHostDeviceTest.xml",
779 shared_libs: [
780 "libbase",
781 "libbinder",
782 "liblog",
783 "libutils",
784 ],
785 static_libs: [
786 "libgmock",
787 ],
788 target_required: [
789 "binderHostDeviceTestService",
790 ],
791 test_suites: ["general-tests"],
792 target: {
793 darwin: {
794 enabled: false,
795 },
796 },
797 test_options: {
798 unit_test: false,
799 },
800}
801
802cc_test {
803 name: "binderHostDeviceTestService",
804 // The binary is named differently from the module so that PushFilePreparer pushes the binary
805 // directly, not the test module directory.
806 stem: "binderHostDeviceTest-service",
807 defaults: ["binder_test_defaults"],
808 gtest: false,
809 auto_gen_config: false,
810 srcs: ["binderHostDeviceTestService.cpp"],
811 shared_libs: [
812 "libbase",
813 "libbinder",
814 "liblog",
815 "libutils",
816 ],
817 test_suites: ["general-tests"],
818}
Pawanf00fabb2022-08-04 17:56:18 +0000819
820cc_defaults {
821 name: "service_fuzzer_defaults",
822 static_libs: [
823 "libbase",
824 "libbinder_random_parcel",
825 "libcutils",
826 ],
827 target: {
828 android: {
829 shared_libs: [
830 "libbinder_ndk",
831 "libbinder",
832 "libutils",
833 ],
834 },
835 host: {
836 static_libs: [
837 "libbinder_ndk",
838 "libbinder",
839 "libutils",
840 ],
841 },
842 darwin: {
843 enabled: false,
844 },
845 },
846 fuzz_config: {
847 cc: [
848 "smoreland@google.com",
849 "waghpawan@google.com",
850 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000851 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
852 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000853 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000854 },
855}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000856
857cc_defaults {
858 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000859 fuzz_config: {
860 asan_options: [
861 "detect_leaks=0",
862 ],
863 hwasan_options: [
864 "detect_leaks=0",
865 ],
866 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000867}