blob: 2f0987fd1a6fd7f7acfc2f491f465e42b59191f2 [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 Homescu9d8adb12022-08-02 04:38:30 +0000438 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000439 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000440 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000441}
442
443cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000444 name: "binderRpcTestNoKernel",
445 defaults: [
446 "binderRpcTest_defaults",
447 "binderRpcTest_static_defaults",
448 ],
449 static_libs: [
450 "libbinder_rpc_no_kernel",
451 ],
452}
453
454cc_test {
455 name: "binderRpcTestSingleThreaded",
456 defaults: [
457 "binderRpcTest_defaults",
458 "binderRpcTest_static_defaults",
459 ],
460 cflags: [
461 "-DBINDER_RPC_SINGLE_THREADED",
462 "-DBINDER_WITH_KERNEL_IPC",
463 ],
464 static_libs: [
465 "libbinder_rpc_single_threaded",
466 ],
467}
468
469cc_test {
470 name: "binderRpcTestSingleThreadedNoKernel",
471 defaults: [
472 "binderRpcTest_defaults",
473 "binderRpcTest_static_defaults",
474 ],
475 cflags: [
476 "-DBINDER_RPC_SINGLE_THREADED",
477 ],
478 static_libs: [
479 "libbinder_rpc_single_threaded_no_kernel",
480 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000481}
482
Yifan Hongff73aa92021-09-17 21:28:01 -0700483cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000484 name: "binderRpcToTrustyTest",
485 vendor: true,
486 host_supported: false,
487 defaults: [
488 "binderRpcTest_common_defaults",
489 "binderRpcTest_static_defaults",
490 ],
491
492 srcs: [
493 "binderRpcTest.cpp",
494 "binderRpcTestCommon.cpp",
495 "binderRpcUniversalTests.cpp",
496 ],
497
498 cflags: [
499 "-DBINDER_RPC_TO_TRUSTY_TEST",
500 ],
501
502 static_libs: [
503 // We want to link libbinder statically so we can push the binary
504 // to the device for testing independently of the library
505 "libbinder_rpc_no_kernel",
506 "libbinder_trusty",
507 "libtrusty",
508 ],
509
510 test_suites: ["device-tests"],
511 require_root: true,
512}
513
514cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700515 name: "RpcTlsUtilsTest",
516 host_supported: true,
517 target: {
518 darwin: {
519 enabled: false,
520 },
521 android: {
522 test_suites: ["vts"],
523 },
524 },
525 defaults: [
526 "binder_test_defaults",
527 "libbinder_tls_shared_deps",
528 ],
529 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700530 "RpcTlsUtilsTest.cpp",
531 ],
532 shared_libs: [
533 "libbinder",
534 "libbase",
535 "libutils",
536 "liblog",
537 ],
538 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700539 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700540 "libbinder_tls_static",
541 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000542 test_suites: [
543 "general-tests",
544 "device-tests",
545 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700546}
547
Steven Morelandcda60852021-04-14 23:45:32 +0000548cc_benchmark {
549 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700550 defaults: [
551 "binder_test_defaults",
552 "libbinder_tls_shared_deps",
553 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000554 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000555 target: {
556 darwin: {
557 enabled: false,
558 },
559 },
Steven Morelandcda60852021-04-14 23:45:32 +0000560 srcs: [
561 "binderRpcBenchmark.cpp",
562 "IBinderRpcBenchmark.aidl",
563 ],
564 shared_libs: [
565 "libbase",
566 "libbinder",
567 "liblog",
568 "libutils",
569 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700570 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700571 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700572 "libbinder_tls_static",
573 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000574}
575
Steven Moreland5553ac42020-11-11 02:14:45 +0000576cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700577 name: "binderRpcWireProtocolTest",
578 host_supported: true,
579 target: {
580 darwin: {
581 enabled: false,
582 },
583 android: {
584 test_suites: ["vts"],
585 },
586 },
587 defaults: [
588 "binder_test_defaults",
589 ],
590 srcs: [
591 "binderRpcWireProtocolTest.cpp",
592 ],
593 shared_libs: [
594 "libbinder",
595 "libbase",
596 "libutils",
597 "libcutils",
598 "liblog",
599 ],
600 test_suites: ["general-tests"],
601}
602
603cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700604 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700605 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700606 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700607 shared_libs: [
608 "libbinder",
609 "libutils",
610 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700611 cflags: [
612 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700613 "-Wno-missing-field-initializers",
614 "-Wno-sign-compare",
615 "-O3",
616 ],
617}
Wei Wang78f2a372016-10-20 23:18:17 -0700618
619cc_test {
620 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700621 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700622 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700623 shared_libs: [
624 "libbinder",
625 "libutils",
626 "libbase",
627 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700628 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700629}
Howard Chenc135dbc2017-03-25 17:12:59 +0800630
631cc_test {
632 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700633 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700634 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800635 shared_libs: [
636 "libbinder",
637 "libutils",
638 "libbase",
639 ],
640}
Dan Stozad630e522016-12-01 15:16:31 -0800641
642cc_test {
643 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700644 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700645 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800646
647 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800648 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800649 ],
650
651 cpp_std: "experimental",
652 gnu_extensions: false,
653
654 shared_libs: [
655 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700656 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800657 "liblog",
658 "libutils",
659 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000660 test_suites: [
661 "device-tests",
662 "vts",
663 ],
Dan Shi80ada592019-09-13 09:17:17 -0700664 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800665}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700666
Steven Morelandf23dae22020-10-27 19:34:55 +0000667cc_test {
668 name: "binderClearBufTest",
669 defaults: ["binder_test_defaults"],
670 srcs: [
671 "binderClearBufTest.cpp",
672 ],
673
674 shared_libs: [
675 "libbase",
676 "libbinder",
677 "liblog",
678 "libutils",
679 ],
680
681 test_suites: ["general-tests"],
682 require_root: true,
683}
684
Steven Moreland12300a02019-08-02 13:27:15 -0700685aidl_interface {
686 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900687 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700688 srcs: [
689 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700690 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000691 backend: {
692 java: {
693 enabled: false,
694 },
695 },
Steven Moreland12300a02019-08-02 13:27:15 -0700696}
697
Steven Morelanddea3cf92019-07-16 18:06:55 -0700698cc_test {
699 name: "binderStabilityTest",
700 defaults: ["binder_test_defaults"],
701 srcs: [
702 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700703 ],
704
Steven Moreland13f84662020-07-23 21:30:41 +0000705 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700706 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700707 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700708 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700709 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700710 "libutils",
711 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700712 static_libs: [
713 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900714 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700715 ],
716
Steven Morelandea7659e2022-02-03 00:04:06 +0000717 test_suites: [
718 "device-tests",
719 "vts",
720 ],
Dan Shi302709b2019-09-19 15:28:15 -0700721 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700722}
Steven Moreland042ae822020-05-27 17:45:17 +0000723
724cc_test {
725 name: "binderAllocationLimits",
726 defaults: ["binder_test_defaults"],
727 srcs: ["binderAllocationLimits.cpp"],
728 shared_libs: [
729 "libbinder",
730 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000731 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000732 "libutils",
733 "libutilscallstack",
734 "libbase",
735 ],
736 test_suites: ["device-tests"],
737 require_root: true,
738}
Andy Hung73a14702020-11-24 13:04:46 -0800739
740cc_benchmark {
741 name: "binderParcelBenchmark",
742 defaults: ["binder_test_defaults"],
743 srcs: ["binderParcelBenchmark.cpp"],
744 shared_libs: [
745 "libbase",
746 "libbinder",
747 "liblog",
748 "libutils",
749 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000750 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800751}
Yifan Hongaf766e62021-06-14 13:24:19 -0700752
753cc_test_host {
754 name: "binderUtilsHostTest",
755 defaults: ["binder_test_defaults"],
756 srcs: ["binderUtilsHostTest.cpp"],
757 shared_libs: [
758 "libbase",
759 "libbinder",
760 ],
761 static_libs: [
762 "libgmock",
763 ],
764 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700765 target: {
766 darwin: {
767 enabled: false,
768 },
769 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700770}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700771
772cc_test_host {
773 name: "binderHostDeviceTest",
774 defaults: ["binder_test_defaults"],
775 srcs: ["binderHostDeviceTest.cpp"],
776 test_config: "binderHostDeviceTest.xml",
777 shared_libs: [
778 "libbase",
779 "libbinder",
780 "liblog",
781 "libutils",
782 ],
783 static_libs: [
784 "libgmock",
785 ],
786 target_required: [
787 "binderHostDeviceTestService",
788 ],
789 test_suites: ["general-tests"],
790 target: {
791 darwin: {
792 enabled: false,
793 },
794 },
795 test_options: {
796 unit_test: false,
797 },
798}
799
800cc_test {
801 name: "binderHostDeviceTestService",
802 // The binary is named differently from the module so that PushFilePreparer pushes the binary
803 // directly, not the test module directory.
804 stem: "binderHostDeviceTest-service",
805 defaults: ["binder_test_defaults"],
806 gtest: false,
807 auto_gen_config: false,
808 srcs: ["binderHostDeviceTestService.cpp"],
809 shared_libs: [
810 "libbase",
811 "libbinder",
812 "liblog",
813 "libutils",
814 ],
815 test_suites: ["general-tests"],
816}
Pawanf00fabb2022-08-04 17:56:18 +0000817
818cc_defaults {
819 name: "service_fuzzer_defaults",
820 static_libs: [
821 "libbase",
822 "libbinder_random_parcel",
823 "libcutils",
824 ],
825 target: {
826 android: {
827 shared_libs: [
828 "libbinder_ndk",
829 "libbinder",
830 "libutils",
831 ],
832 },
833 host: {
834 static_libs: [
835 "libbinder_ndk",
836 "libbinder",
837 "libutils",
838 ],
839 },
840 darwin: {
841 enabled: false,
842 },
843 },
844 fuzz_config: {
845 cc: [
846 "smoreland@google.com",
847 "waghpawan@google.com",
848 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000849 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
850 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000851 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000852 },
853}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000854
855cc_defaults {
856 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000857 fuzz_config: {
858 asan_options: [
859 "detect_leaks=0",
860 ],
861 hwasan_options: [
862 "detect_leaks=0",
863 ],
864 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000865}