blob: 041c28098a5259d147b443f0c397e497d6d1f1a7 [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"],
72 shared_libs: [
73 "libbinder",
74 "libcutils",
75 "libutils",
76 ],
77 static_libs: [
78 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +000079 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +000080 "libbinder_random_parcel_seeds",
81 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +000082 ],
83 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +000084 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +000085}
86
87aidl_interface {
88 name: "binderRecordReplayTestIface",
89 unstable: true,
90 srcs: [
91 "IBinderRecordReplayTest.aidl",
92 ],
Pawan Wagh8da45382023-05-11 08:08:50 +000093 imports: ["binderReadParcelIface"],
94 backend: {
95 java: {
96 enabled: true,
97 platform_apis: true,
98 },
99 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000100}
101
102cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700103 name: "binderLibTest",
104 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800105
Dan Willemsen59e086f2016-07-25 17:13:45 -0700106 srcs: ["binderLibTest.cpp"],
107 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700108 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700109 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700110 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700111 "libutils",
112 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700113 static_libs: [
114 "libgmock",
115 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000116 test_suites: [
117 "device-tests",
118 "vts",
119 ],
Dan Shi80ada592019-09-13 09:17:17 -0700120 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700121}
122
Steven Moreland37aff182021-03-26 02:04:16 +0000123aidl_interface {
124 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000125 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000126 host_supported: true,
127 unstable: true,
128 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700129 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000130 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700131 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000132 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000133 "IBinderRpcSession.aidl",
134 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700135 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000136 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800137 flags: [
138 "-Werror",
139 "-Wno-mixed-oneway",
140 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000141 backend: {
142 java: {
143 enabled: false,
144 },
145 },
146}
147
Yifan Honge0e53282021-09-23 18:37:21 -0700148cc_library_static {
149 name: "libbinder_tls_test_utils",
150 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000151 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700152 target: {
153 darwin: {
154 enabled: false,
155 },
156 },
157 defaults: [
158 "binder_test_defaults",
159 "libbinder_tls_shared_deps",
160 ],
161 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700162 "libbase",
163 "liblog",
164 ],
165 static_libs: [
166 "libbinder_tls_static",
167 ],
168 srcs: [
169 "RpcTlsTestUtils.cpp",
170 ],
171 export_include_dirs: [
172 "include_tls_test_utils",
173 ],
174 visibility: [
175 ":__subpackages__",
176 ],
177}
178
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700179cc_library_static {
180 name: "libbinder_test_utils",
181 host_supported: true,
182 vendor_available: true,
183 target: {
184 darwin: {
185 enabled: false,
186 },
187 },
188 defaults: [
189 "binder_test_defaults",
190 ],
191 shared_libs: [
192 "libbase",
193 "liblog",
194 ],
195 srcs: [
196 "FileUtils.cpp",
197 ],
198 visibility: [
199 ":__subpackages__",
200 ],
201}
202
Andrei Homescu12106de2022-04-27 04:42:21 +0000203cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000204 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000205 host_supported: true,
206 target: {
207 darwin: {
208 enabled: false,
209 },
210 },
Steven Moreland37aff182021-03-26 02:04:16 +0000211 defaults: [
212 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000213 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000214
Andrei Homescu12106de2022-04-27 04:42:21 +0000215 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700216 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000217 "libbinder_tls_static",
218 "libbinder_tls_test_utils",
219 "binderRpcTestIface-cpp",
220 "binderRpcTestIface-ndk",
221 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000222}
223
224cc_defaults {
225 name: "binderRpcTest_service_defaults",
226 defaults: [
227 "binderRpcTest_common_defaults",
228 ],
229 gtest: false,
230 auto_gen_config: false,
231 srcs: [
232 "binderRpcTestCommon.cpp",
233 "binderRpcTestService.cpp",
234 ],
235}
236
237cc_defaults {
238 name: "binderRpcTest_defaults",
239 target: {
240 android: {
241 test_suites: ["vts"],
242 },
243 },
244 defaults: [
245 "binderRpcTest_common_defaults",
246 ],
247
248 srcs: [
249 "binderRpcTest.cpp",
250 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000251 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000252 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000253
Steven Moreland20531612023-04-04 18:03:24 +0000254 // This test uses a lot of resources and takes a long time. Due to
255 // design of several tests, it is also very sensitive to resource
256 // contention on the device. b/276820894
257 test_options: {
258 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000259 test_runner_options: [
260 {
261 name: "native-test-timeout",
262 value: "10m",
263 },
264 ],
Steven Moreland20531612023-04-04 18:03:24 +0000265 },
266
Andrei Homescu12106de2022-04-27 04:42:21 +0000267 test_suites: ["general-tests"],
268 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000269
270 data_bins: [
271 "binder_rpc_test_service",
272 "binder_rpc_test_service_no_kernel",
273 "binder_rpc_test_service_single_threaded",
274 "binder_rpc_test_service_single_threaded_no_kernel",
275 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000276}
277
Andrei Homescu2a298012022-06-15 01:08:54 +0000278cc_defaults {
279 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000280 cflags: [
281 "-DBINDER_WITH_KERNEL_IPC",
282 ],
283
Steven Moreland5553ac42020-11-11 02:14:45 +0000284 shared_libs: [
285 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000286 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000287 "libbase",
288 "libutils",
289 "libcutils",
290 "liblog",
291 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000292}
293
294cc_defaults {
295 name: "binderRpcTest_static_defaults",
296
297 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000298 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000299 "libutils",
300 // libcrypto_static is not visible to this module
301 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000302 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000303 static_libs: [
304 "libbase",
305 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000306 "libssl",
307 ],
308
309 cflags: [
310 // Disable tests that require shared libraries,
311 // e.g., libbinder.so or libbinder_ndk.so
312 "-DBINDER_TEST_NO_SHARED_LIBS",
313 ],
314}
315
316cc_test {
Andrei Homescu2a298012022-06-15 01:08:54 +0000317 // The module name cannot start with "binderRpcTest" because
318 // then atest tries to execute it as part of binderRpcTest
319 name: "binder_rpc_test_service",
320 defaults: [
321 "binderRpcTest_service_defaults",
322 "binderRpcTest_shared_defaults",
323 "libbinder_tls_shared_deps",
324 ],
325}
326
327cc_test {
328 name: "binder_rpc_test_service_no_kernel",
329 defaults: [
330 "binderRpcTest_service_defaults",
331 "binderRpcTest_static_defaults",
332 ],
333 static_libs: [
334 "libbinder_rpc_no_kernel",
335 ],
336}
337
338cc_test {
339 name: "binder_rpc_test_service_single_threaded",
340 defaults: [
341 "binderRpcTest_service_defaults",
342 "binderRpcTest_static_defaults",
343 ],
344 cflags: [
345 "-DBINDER_RPC_SINGLE_THREADED",
346 "-DBINDER_WITH_KERNEL_IPC",
347 ],
348 static_libs: [
349 "libbinder_rpc_single_threaded",
350 ],
351}
352
353cc_test {
354 name: "binder_rpc_test_service_single_threaded_no_kernel",
355 defaults: [
356 "binderRpcTest_service_defaults",
357 "binderRpcTest_static_defaults",
358 ],
359 cflags: [
360 "-DBINDER_RPC_SINGLE_THREADED",
361 ],
362 static_libs: [
363 "libbinder_rpc_single_threaded_no_kernel",
364 ],
365}
366
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000367cc_binary {
368 name: "binderRpcTestService_on_trusty_mock",
369 defaults: [
370 "trusty_mock_defaults",
371 ],
372
373 srcs: [
374 "binderRpcTestCommon.cpp",
375 "binderRpcTestServiceTrusty.cpp",
376 ],
377
378 shared_libs: [
379 "libbinder_on_trusty_mock",
380 "libbase",
381 "libutils",
382 "libcutils",
383 ],
384
385 static_libs: [
386 "binderRpcTestIface-cpp",
387 ],
388}
389
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000390cc_binary {
391 name: "binderRpcTest_on_trusty_mock",
392 defaults: [
393 "trusty_mock_defaults",
394 ],
395
396 srcs: [
397 "binderRpcUniversalTests.cpp",
398 "binderRpcTestCommon.cpp",
399 "binderRpcTestTrusty.cpp",
400 ],
401
402 shared_libs: [
403 "libbinder_on_trusty_mock",
404 "libbase",
405 "libutils",
406 "libcutils",
407 ],
408
409 static_libs: [
410 "binderRpcTestIface-cpp",
411 "libgtest",
412 ],
413}
414
Andrei Homescu2a298012022-06-15 01:08:54 +0000415cc_test {
416 name: "binderRpcTest",
417 defaults: [
418 "binderRpcTest_defaults",
419 "binderRpcTest_shared_defaults",
420 "libbinder_tls_shared_deps",
421 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000422
423 // Add the Trusty mock library as a fake dependency so it gets built
424 required: [
425 "libbinder_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000426 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000427 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000428 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000429}
430
431cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000432 name: "binderRpcTestNoKernel",
433 defaults: [
434 "binderRpcTest_defaults",
435 "binderRpcTest_static_defaults",
436 ],
437 static_libs: [
438 "libbinder_rpc_no_kernel",
439 ],
440}
441
442cc_test {
443 name: "binderRpcTestSingleThreaded",
444 defaults: [
445 "binderRpcTest_defaults",
446 "binderRpcTest_static_defaults",
447 ],
448 cflags: [
449 "-DBINDER_RPC_SINGLE_THREADED",
450 "-DBINDER_WITH_KERNEL_IPC",
451 ],
452 static_libs: [
453 "libbinder_rpc_single_threaded",
454 ],
455}
456
457cc_test {
458 name: "binderRpcTestSingleThreadedNoKernel",
459 defaults: [
460 "binderRpcTest_defaults",
461 "binderRpcTest_static_defaults",
462 ],
463 cflags: [
464 "-DBINDER_RPC_SINGLE_THREADED",
465 ],
466 static_libs: [
467 "libbinder_rpc_single_threaded_no_kernel",
468 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000469}
470
Yifan Hongff73aa92021-09-17 21:28:01 -0700471cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000472 name: "binderRpcToTrustyTest",
473 vendor: true,
474 host_supported: false,
475 defaults: [
476 "binderRpcTest_common_defaults",
477 "binderRpcTest_static_defaults",
478 ],
479
480 srcs: [
481 "binderRpcTest.cpp",
482 "binderRpcTestCommon.cpp",
483 "binderRpcUniversalTests.cpp",
484 ],
485
486 cflags: [
487 "-DBINDER_RPC_TO_TRUSTY_TEST",
488 ],
489
490 static_libs: [
491 // We want to link libbinder statically so we can push the binary
492 // to the device for testing independently of the library
493 "libbinder_rpc_no_kernel",
494 "libbinder_trusty",
495 "libtrusty",
496 ],
497
498 test_suites: ["device-tests"],
499 require_root: true,
500}
501
502cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700503 name: "RpcTlsUtilsTest",
504 host_supported: true,
505 target: {
506 darwin: {
507 enabled: false,
508 },
509 android: {
510 test_suites: ["vts"],
511 },
512 },
513 defaults: [
514 "binder_test_defaults",
515 "libbinder_tls_shared_deps",
516 ],
517 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700518 "RpcTlsUtilsTest.cpp",
519 ],
520 shared_libs: [
521 "libbinder",
522 "libbase",
523 "libutils",
524 "liblog",
525 ],
526 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700527 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700528 "libbinder_tls_static",
529 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000530 test_suites: [
531 "general-tests",
532 "device-tests",
533 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700534}
535
Steven Morelandcda60852021-04-14 23:45:32 +0000536cc_benchmark {
537 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700538 defaults: [
539 "binder_test_defaults",
540 "libbinder_tls_shared_deps",
541 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000542 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000543 target: {
544 darwin: {
545 enabled: false,
546 },
547 },
Steven Morelandcda60852021-04-14 23:45:32 +0000548 srcs: [
549 "binderRpcBenchmark.cpp",
550 "IBinderRpcBenchmark.aidl",
551 ],
552 shared_libs: [
553 "libbase",
554 "libbinder",
555 "liblog",
556 "libutils",
557 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700558 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700559 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700560 "libbinder_tls_static",
561 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000562}
563
Steven Moreland5553ac42020-11-11 02:14:45 +0000564cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700565 name: "binderRpcWireProtocolTest",
566 host_supported: true,
567 target: {
568 darwin: {
569 enabled: false,
570 },
571 android: {
572 test_suites: ["vts"],
573 },
574 },
575 defaults: [
576 "binder_test_defaults",
577 ],
578 srcs: [
579 "binderRpcWireProtocolTest.cpp",
580 ],
581 shared_libs: [
582 "libbinder",
583 "libbase",
584 "libutils",
585 "libcutils",
586 "liblog",
587 ],
588 test_suites: ["general-tests"],
589}
590
591cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700592 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700593 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700594 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700595 shared_libs: [
596 "libbinder",
597 "libutils",
598 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700599 cflags: [
600 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700601 "-Wno-missing-field-initializers",
602 "-Wno-sign-compare",
603 "-O3",
604 ],
605}
Wei Wang78f2a372016-10-20 23:18:17 -0700606
607cc_test {
608 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700609 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700610 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700611 shared_libs: [
612 "libbinder",
613 "libutils",
614 "libbase",
615 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700616 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700617}
Howard Chenc135dbc2017-03-25 17:12:59 +0800618
619cc_test {
620 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700621 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700622 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800623 shared_libs: [
624 "libbinder",
625 "libutils",
626 "libbase",
627 ],
628}
Dan Stozad630e522016-12-01 15:16:31 -0800629
630cc_test {
631 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700632 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700633 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800634
635 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800636 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800637 ],
638
639 cpp_std: "experimental",
640 gnu_extensions: false,
641
642 shared_libs: [
643 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700644 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800645 "liblog",
646 "libutils",
647 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000648 test_suites: [
649 "device-tests",
650 "vts",
651 ],
Dan Shi80ada592019-09-13 09:17:17 -0700652 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800653}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700654
Steven Morelandf23dae22020-10-27 19:34:55 +0000655cc_test {
656 name: "binderClearBufTest",
657 defaults: ["binder_test_defaults"],
658 srcs: [
659 "binderClearBufTest.cpp",
660 ],
661
662 shared_libs: [
663 "libbase",
664 "libbinder",
665 "liblog",
666 "libutils",
667 ],
668
669 test_suites: ["general-tests"],
670 require_root: true,
671}
672
Steven Moreland12300a02019-08-02 13:27:15 -0700673aidl_interface {
674 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900675 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700676 srcs: [
677 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700678 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000679 backend: {
680 java: {
681 enabled: false,
682 },
683 },
Steven Moreland12300a02019-08-02 13:27:15 -0700684}
685
Steven Morelanddea3cf92019-07-16 18:06:55 -0700686cc_test {
687 name: "binderStabilityTest",
688 defaults: ["binder_test_defaults"],
689 srcs: [
690 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700691 ],
692
Steven Moreland13f84662020-07-23 21:30:41 +0000693 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700694 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700695 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700696 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700697 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700698 "libutils",
699 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700700 static_libs: [
701 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900702 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700703 ],
704
Steven Morelandea7659e2022-02-03 00:04:06 +0000705 test_suites: [
706 "device-tests",
707 "vts",
708 ],
Dan Shi302709b2019-09-19 15:28:15 -0700709 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700710}
Steven Moreland042ae822020-05-27 17:45:17 +0000711
712cc_test {
713 name: "binderAllocationLimits",
714 defaults: ["binder_test_defaults"],
715 srcs: ["binderAllocationLimits.cpp"],
716 shared_libs: [
717 "libbinder",
718 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000719 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000720 "libutils",
721 "libutilscallstack",
722 "libbase",
723 ],
724 test_suites: ["device-tests"],
725 require_root: true,
726}
Andy Hung73a14702020-11-24 13:04:46 -0800727
728cc_benchmark {
729 name: "binderParcelBenchmark",
730 defaults: ["binder_test_defaults"],
731 srcs: ["binderParcelBenchmark.cpp"],
732 shared_libs: [
733 "libbase",
734 "libbinder",
735 "liblog",
736 "libutils",
737 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000738 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800739}
Yifan Hongaf766e62021-06-14 13:24:19 -0700740
741cc_test_host {
742 name: "binderUtilsHostTest",
743 defaults: ["binder_test_defaults"],
744 srcs: ["binderUtilsHostTest.cpp"],
745 shared_libs: [
746 "libbase",
747 "libbinder",
748 ],
749 static_libs: [
750 "libgmock",
751 ],
752 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700753 target: {
754 darwin: {
755 enabled: false,
756 },
757 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700758}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700759
760cc_test_host {
761 name: "binderHostDeviceTest",
762 defaults: ["binder_test_defaults"],
763 srcs: ["binderHostDeviceTest.cpp"],
764 test_config: "binderHostDeviceTest.xml",
765 shared_libs: [
766 "libbase",
767 "libbinder",
768 "liblog",
769 "libutils",
770 ],
771 static_libs: [
772 "libgmock",
773 ],
774 target_required: [
775 "binderHostDeviceTestService",
776 ],
777 test_suites: ["general-tests"],
778 target: {
779 darwin: {
780 enabled: false,
781 },
782 },
783 test_options: {
784 unit_test: false,
785 },
786}
787
788cc_test {
789 name: "binderHostDeviceTestService",
790 // The binary is named differently from the module so that PushFilePreparer pushes the binary
791 // directly, not the test module directory.
792 stem: "binderHostDeviceTest-service",
793 defaults: ["binder_test_defaults"],
794 gtest: false,
795 auto_gen_config: false,
796 srcs: ["binderHostDeviceTestService.cpp"],
797 shared_libs: [
798 "libbase",
799 "libbinder",
800 "liblog",
801 "libutils",
802 ],
803 test_suites: ["general-tests"],
804}
Pawanf00fabb2022-08-04 17:56:18 +0000805
806cc_defaults {
807 name: "service_fuzzer_defaults",
808 static_libs: [
809 "libbase",
810 "libbinder_random_parcel",
811 "libcutils",
812 ],
813 target: {
814 android: {
815 shared_libs: [
816 "libbinder_ndk",
817 "libbinder",
818 "libutils",
819 ],
820 },
821 host: {
822 static_libs: [
823 "libbinder_ndk",
824 "libbinder",
825 "libutils",
826 ],
827 },
828 darwin: {
829 enabled: false,
830 },
831 },
832 fuzz_config: {
833 cc: [
834 "smoreland@google.com",
835 "waghpawan@google.com",
836 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000837 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
838 hotlists: ["4637097"],
Pawanf00fabb2022-08-04 17:56:18 +0000839 },
840}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000841
842cc_defaults {
843 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000844 fuzz_config: {
845 asan_options: [
846 "detect_leaks=0",
847 ],
848 hwasan_options: [
849 "detect_leaks=0",
850 ],
851 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000852}