blob: 6800a8d36c58be69f746a210c4ed1744241fe080 [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 ],
Tomasz Wasilczykfbfea5b2024-04-30 10:54:23 -0700203 header_libs: [
204 "libbinder_headers_base",
205 ],
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700206 shared_libs: [
207 "libbase",
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700208 ],
209 srcs: [
210 "FileUtils.cpp",
211 ],
212 visibility: [
213 ":__subpackages__",
214 ],
215}
216
Andrei Homescu12106de2022-04-27 04:42:21 +0000217cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000218 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000219 host_supported: true,
220 target: {
221 darwin: {
222 enabled: false,
223 },
224 },
Steven Moreland37aff182021-03-26 02:04:16 +0000225 defaults: [
226 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000227 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000228
Andrei Homescu12106de2022-04-27 04:42:21 +0000229 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700230 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000231 "libbinder_tls_static",
232 "libbinder_tls_test_utils",
233 "binderRpcTestIface-cpp",
234 "binderRpcTestIface-ndk",
235 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000236}
237
238cc_defaults {
239 name: "binderRpcTest_service_defaults",
240 defaults: [
241 "binderRpcTest_common_defaults",
242 ],
243 gtest: false,
244 auto_gen_config: false,
245 srcs: [
246 "binderRpcTestCommon.cpp",
247 "binderRpcTestService.cpp",
248 ],
249}
250
251cc_defaults {
252 name: "binderRpcTest_defaults",
253 target: {
254 android: {
255 test_suites: ["vts"],
256 },
257 },
258 defaults: [
259 "binderRpcTest_common_defaults",
260 ],
261
262 srcs: [
263 "binderRpcTest.cpp",
264 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000265 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000266 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000267
Steven Moreland20531612023-04-04 18:03:24 +0000268 // This test uses a lot of resources and takes a long time. Due to
269 // design of several tests, it is also very sensitive to resource
270 // contention on the device. b/276820894
271 test_options: {
272 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000273 test_runner_options: [
274 {
275 name: "native-test-timeout",
276 value: "10m",
277 },
278 ],
Steven Moreland20531612023-04-04 18:03:24 +0000279 },
280
Andrei Homescu12106de2022-04-27 04:42:21 +0000281 test_suites: ["general-tests"],
282 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000283
284 data_bins: [
285 "binder_rpc_test_service",
286 "binder_rpc_test_service_no_kernel",
287 "binder_rpc_test_service_single_threaded",
288 "binder_rpc_test_service_single_threaded_no_kernel",
289 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000290}
291
Andrei Homescu2a298012022-06-15 01:08:54 +0000292cc_defaults {
293 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000294 cflags: [
295 "-DBINDER_WITH_KERNEL_IPC",
296 ],
297
Steven Moreland5553ac42020-11-11 02:14:45 +0000298 shared_libs: [
299 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000300 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000301 "libbase",
302 "libutils",
303 "libcutils",
304 "liblog",
305 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000306}
307
308cc_defaults {
309 name: "binderRpcTest_static_defaults",
310
311 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000312 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000313 "libutils",
314 // libcrypto_static is not visible to this module
315 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000316 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000317 static_libs: [
318 "libbase",
319 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000320 "libssl",
321 ],
322
323 cflags: [
324 // Disable tests that require shared libraries,
325 // e.g., libbinder.so or libbinder_ndk.so
326 "-DBINDER_TEST_NO_SHARED_LIBS",
327 ],
328}
329
330cc_test {
Andrei Homescu2a298012022-06-15 01:08:54 +0000331 // The module name cannot start with "binderRpcTest" because
332 // then atest tries to execute it as part of binderRpcTest
333 name: "binder_rpc_test_service",
334 defaults: [
335 "binderRpcTest_service_defaults",
336 "binderRpcTest_shared_defaults",
337 "libbinder_tls_shared_deps",
338 ],
339}
340
341cc_test {
342 name: "binder_rpc_test_service_no_kernel",
343 defaults: [
344 "binderRpcTest_service_defaults",
345 "binderRpcTest_static_defaults",
346 ],
347 static_libs: [
348 "libbinder_rpc_no_kernel",
349 ],
350}
351
352cc_test {
353 name: "binder_rpc_test_service_single_threaded",
354 defaults: [
355 "binderRpcTest_service_defaults",
356 "binderRpcTest_static_defaults",
357 ],
358 cflags: [
359 "-DBINDER_RPC_SINGLE_THREADED",
360 "-DBINDER_WITH_KERNEL_IPC",
361 ],
362 static_libs: [
363 "libbinder_rpc_single_threaded",
364 ],
365}
366
367cc_test {
368 name: "binder_rpc_test_service_single_threaded_no_kernel",
369 defaults: [
370 "binderRpcTest_service_defaults",
371 "binderRpcTest_static_defaults",
372 ],
373 cflags: [
374 "-DBINDER_RPC_SINGLE_THREADED",
375 ],
376 static_libs: [
377 "libbinder_rpc_single_threaded_no_kernel",
378 ],
379}
380
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000381cc_binary {
382 name: "binderRpcTestService_on_trusty_mock",
383 defaults: [
384 "trusty_mock_defaults",
385 ],
386
387 srcs: [
388 "binderRpcTestCommon.cpp",
389 "binderRpcTestServiceTrusty.cpp",
390 ],
391
392 shared_libs: [
393 "libbinder_on_trusty_mock",
394 "libbase",
395 "libutils",
396 "libcutils",
397 ],
398
399 static_libs: [
400 "binderRpcTestIface-cpp",
401 ],
402}
403
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000404cc_binary {
405 name: "binderRpcTest_on_trusty_mock",
406 defaults: [
407 "trusty_mock_defaults",
408 ],
409
410 srcs: [
411 "binderRpcUniversalTests.cpp",
412 "binderRpcTestCommon.cpp",
413 "binderRpcTestTrusty.cpp",
414 ],
415
416 shared_libs: [
417 "libbinder_on_trusty_mock",
418 "libbase",
419 "libutils",
420 "libcutils",
421 ],
422
423 static_libs: [
424 "binderRpcTestIface-cpp",
425 "libgtest",
426 ],
427}
428
Andrei Homescu2a298012022-06-15 01:08:54 +0000429cc_test {
430 name: "binderRpcTest",
431 defaults: [
432 "binderRpcTest_defaults",
433 "binderRpcTest_shared_defaults",
434 "libbinder_tls_shared_deps",
435 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000436
437 // Add the Trusty mock library as a fake dependency so it gets built
438 required: [
439 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000440 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000441 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000442 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000443 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000444 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000445}
446
447cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000448 name: "binderRpcTestNoKernel",
449 defaults: [
450 "binderRpcTest_defaults",
451 "binderRpcTest_static_defaults",
452 ],
453 static_libs: [
454 "libbinder_rpc_no_kernel",
455 ],
456}
457
458cc_test {
459 name: "binderRpcTestSingleThreaded",
460 defaults: [
461 "binderRpcTest_defaults",
462 "binderRpcTest_static_defaults",
463 ],
464 cflags: [
465 "-DBINDER_RPC_SINGLE_THREADED",
466 "-DBINDER_WITH_KERNEL_IPC",
467 ],
468 static_libs: [
469 "libbinder_rpc_single_threaded",
470 ],
471}
472
473cc_test {
474 name: "binderRpcTestSingleThreadedNoKernel",
475 defaults: [
476 "binderRpcTest_defaults",
477 "binderRpcTest_static_defaults",
478 ],
479 cflags: [
480 "-DBINDER_RPC_SINGLE_THREADED",
481 ],
482 static_libs: [
483 "libbinder_rpc_single_threaded_no_kernel",
484 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000485}
486
Yifan Hongff73aa92021-09-17 21:28:01 -0700487cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000488 name: "binderRpcToTrustyTest",
489 vendor: true,
490 host_supported: false,
491 defaults: [
492 "binderRpcTest_common_defaults",
493 "binderRpcTest_static_defaults",
494 ],
495
496 srcs: [
497 "binderRpcTest.cpp",
498 "binderRpcTestCommon.cpp",
499 "binderRpcUniversalTests.cpp",
500 ],
501
502 cflags: [
503 "-DBINDER_RPC_TO_TRUSTY_TEST",
504 ],
505
506 static_libs: [
507 // We want to link libbinder statically so we can push the binary
508 // to the device for testing independently of the library
509 "libbinder_rpc_no_kernel",
510 "libbinder_trusty",
511 "libtrusty",
512 ],
513
514 test_suites: ["device-tests"],
515 require_root: true,
516}
517
518cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700519 name: "RpcTlsUtilsTest",
520 host_supported: true,
521 target: {
522 darwin: {
523 enabled: false,
524 },
525 android: {
526 test_suites: ["vts"],
527 },
528 },
529 defaults: [
530 "binder_test_defaults",
531 "libbinder_tls_shared_deps",
532 ],
533 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700534 "RpcTlsUtilsTest.cpp",
535 ],
536 shared_libs: [
537 "libbinder",
538 "libbase",
539 "libutils",
540 "liblog",
541 ],
542 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700543 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700544 "libbinder_tls_static",
545 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000546 test_suites: [
547 "general-tests",
548 "device-tests",
549 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700550}
551
Steven Morelandcda60852021-04-14 23:45:32 +0000552cc_benchmark {
553 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700554 defaults: [
555 "binder_test_defaults",
556 "libbinder_tls_shared_deps",
557 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000558 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000559 target: {
560 darwin: {
561 enabled: false,
562 },
563 },
Steven Morelandcda60852021-04-14 23:45:32 +0000564 srcs: [
565 "binderRpcBenchmark.cpp",
566 "IBinderRpcBenchmark.aidl",
567 ],
568 shared_libs: [
569 "libbase",
570 "libbinder",
571 "liblog",
572 "libutils",
573 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700574 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700575 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700576 "libbinder_tls_static",
577 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000578}
579
Steven Moreland5553ac42020-11-11 02:14:45 +0000580cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700581 name: "binderRpcWireProtocolTest",
582 host_supported: true,
583 target: {
584 darwin: {
585 enabled: false,
586 },
587 android: {
588 test_suites: ["vts"],
589 },
590 },
591 defaults: [
592 "binder_test_defaults",
593 ],
594 srcs: [
595 "binderRpcWireProtocolTest.cpp",
596 ],
597 shared_libs: [
598 "libbinder",
599 "libbase",
600 "libutils",
601 "libcutils",
602 "liblog",
603 ],
604 test_suites: ["general-tests"],
605}
606
607cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700608 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700609 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700610 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700611 shared_libs: [
612 "libbinder",
613 "libutils",
614 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700615 cflags: [
616 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700617 "-Wno-missing-field-initializers",
618 "-Wno-sign-compare",
619 "-O3",
620 ],
621}
Wei Wang78f2a372016-10-20 23:18:17 -0700622
623cc_test {
624 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700625 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700626 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700627 shared_libs: [
628 "libbinder",
629 "libutils",
630 "libbase",
631 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700632 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700633}
Howard Chenc135dbc2017-03-25 17:12:59 +0800634
635cc_test {
636 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700637 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700638 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800639 shared_libs: [
640 "libbinder",
641 "libutils",
642 "libbase",
643 ],
644}
Dan Stozad630e522016-12-01 15:16:31 -0800645
646cc_test {
647 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700648 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700649 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800650
651 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800652 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800653 ],
654
655 cpp_std: "experimental",
656 gnu_extensions: false,
657
658 shared_libs: [
659 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700660 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800661 "liblog",
662 "libutils",
663 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000664 test_suites: [
665 "device-tests",
666 "vts",
667 ],
Dan Shi80ada592019-09-13 09:17:17 -0700668 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800669}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700670
Steven Morelandf23dae22020-10-27 19:34:55 +0000671cc_test {
672 name: "binderClearBufTest",
673 defaults: ["binder_test_defaults"],
674 srcs: [
675 "binderClearBufTest.cpp",
676 ],
677
678 shared_libs: [
679 "libbase",
680 "libbinder",
681 "liblog",
682 "libutils",
683 ],
684
685 test_suites: ["general-tests"],
686 require_root: true,
687}
688
Steven Moreland12300a02019-08-02 13:27:15 -0700689aidl_interface {
690 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900691 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700692 srcs: [
693 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700694 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000695 backend: {
696 java: {
697 enabled: false,
698 },
699 },
Steven Moreland12300a02019-08-02 13:27:15 -0700700}
701
Steven Morelanddea3cf92019-07-16 18:06:55 -0700702cc_test {
703 name: "binderStabilityTest",
704 defaults: ["binder_test_defaults"],
705 srcs: [
706 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700707 ],
708
Steven Moreland13f84662020-07-23 21:30:41 +0000709 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700710 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700711 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700712 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700713 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700714 "libutils",
715 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700716 static_libs: [
717 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900718 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700719 ],
720
Steven Morelandea7659e2022-02-03 00:04:06 +0000721 test_suites: [
722 "device-tests",
723 "vts",
724 ],
Dan Shi302709b2019-09-19 15:28:15 -0700725 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700726}
Steven Moreland042ae822020-05-27 17:45:17 +0000727
728cc_test {
729 name: "binderAllocationLimits",
730 defaults: ["binder_test_defaults"],
731 srcs: ["binderAllocationLimits.cpp"],
732 shared_libs: [
733 "libbinder",
734 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000735 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000736 "libutils",
737 "libutilscallstack",
738 "libbase",
739 ],
740 test_suites: ["device-tests"],
741 require_root: true,
742}
Andy Hung73a14702020-11-24 13:04:46 -0800743
744cc_benchmark {
745 name: "binderParcelBenchmark",
746 defaults: ["binder_test_defaults"],
747 srcs: ["binderParcelBenchmark.cpp"],
748 shared_libs: [
749 "libbase",
750 "libbinder",
751 "liblog",
752 "libutils",
753 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000754 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800755}
Yifan Hongaf766e62021-06-14 13:24:19 -0700756
757cc_test_host {
758 name: "binderUtilsHostTest",
759 defaults: ["binder_test_defaults"],
760 srcs: ["binderUtilsHostTest.cpp"],
761 shared_libs: [
762 "libbase",
763 "libbinder",
764 ],
765 static_libs: [
766 "libgmock",
767 ],
768 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700769 target: {
770 darwin: {
771 enabled: false,
772 },
773 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700774}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700775
776cc_test_host {
777 name: "binderHostDeviceTest",
778 defaults: ["binder_test_defaults"],
779 srcs: ["binderHostDeviceTest.cpp"],
780 test_config: "binderHostDeviceTest.xml",
781 shared_libs: [
782 "libbase",
783 "libbinder",
784 "liblog",
785 "libutils",
786 ],
787 static_libs: [
788 "libgmock",
789 ],
790 target_required: [
791 "binderHostDeviceTestService",
792 ],
793 test_suites: ["general-tests"],
794 target: {
795 darwin: {
796 enabled: false,
797 },
798 },
799 test_options: {
800 unit_test: false,
801 },
802}
803
804cc_test {
805 name: "binderHostDeviceTestService",
806 // The binary is named differently from the module so that PushFilePreparer pushes the binary
807 // directly, not the test module directory.
808 stem: "binderHostDeviceTest-service",
809 defaults: ["binder_test_defaults"],
810 gtest: false,
811 auto_gen_config: false,
812 srcs: ["binderHostDeviceTestService.cpp"],
813 shared_libs: [
814 "libbase",
815 "libbinder",
816 "liblog",
817 "libutils",
818 ],
819 test_suites: ["general-tests"],
820}
Pawanf00fabb2022-08-04 17:56:18 +0000821
822cc_defaults {
823 name: "service_fuzzer_defaults",
824 static_libs: [
825 "libbase",
826 "libbinder_random_parcel",
827 "libcutils",
828 ],
829 target: {
830 android: {
831 shared_libs: [
832 "libbinder_ndk",
833 "libbinder",
834 "libutils",
835 ],
836 },
837 host: {
838 static_libs: [
839 "libbinder_ndk",
840 "libbinder",
841 "libutils",
842 ],
843 },
844 darwin: {
845 enabled: false,
846 },
847 },
848 fuzz_config: {
849 cc: [
850 "smoreland@google.com",
851 "waghpawan@google.com",
852 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000853 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
854 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000855 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000856 },
857}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000858
859cc_defaults {
860 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000861 fuzz_config: {
862 asan_options: [
863 "detect_leaks=0",
864 ],
865 hwasan_options: [
866 "detect_leaks=0",
867 ],
868 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000869}