blob: 66b552afc0741df5bcfc6d2be39d625064196192 [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",
Tomasz Wasilczyke97f3a82024-04-30 10:37:32 -070031 "-Wformat",
32 "-Wpessimizing-move",
33 "-Wsign-compare",
34 "-Wunused-result",
35 "-Wzero-as-null-pointer-constant",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070036 ],
37}
38
Dan Willemsen59e086f2016-07-25 17:13:45 -070039cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070040 name: "binderDriverInterfaceTest",
41 defaults: ["binder_test_defaults"],
Yifan Hong4e419d82021-04-26 11:32:56 -070042 header_libs: ["libbinder_headers"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070043 srcs: ["binderDriverInterfaceTest.cpp"],
Steven Morelandea7659e2022-02-03 00:04:06 +000044 test_suites: [
45 "device-tests",
46 "vts",
47 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070048}
49
Steven Morelandcefba612020-11-05 22:57:06 +000050// unit test only, which can run on host and doesn't use /dev/binder
51cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000052 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000053 host_supported: true,
54 target: {
55 darwin: {
56 enabled: false,
57 },
58 },
Steven Morelandea7659e2022-02-03 00:04:06 +000059 srcs: [
60 "binderParcelUnitTest.cpp",
61 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +000062 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -050063 "binderMemoryHeapBaseUnitTest.cpp",
Fabián Cañas08bdc772023-01-02 15:02:56 -050064 "binderRecordedTransactionTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +000065 ],
Steven Morelandcefba612020-11-05 22:57:06 +000066 shared_libs: [
67 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -070068 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +000069 "libutils",
70 ],
71 test_suites: ["general-tests"],
72}
73
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080074cc_test {
Steven Morelanda8244b92023-04-20 23:34:11 +000075 name: "binderRecordReplayTest",
76 srcs: ["binderRecordReplayTest.cpp"],
Pawan Wagh76b18152023-12-01 14:30:26 +000077 cflags: [
78 "-DBINDER_WITH_KERNEL_IPC",
79 ],
Steven Morelanda8244b92023-04-20 23:34:11 +000080 shared_libs: [
81 "libbinder",
82 "libcutils",
83 "libutils",
Pawan Wagh76b18152023-12-01 14:30:26 +000084 "liblog",
Steven Morelanda8244b92023-04-20 23:34:11 +000085 ],
86 static_libs: [
87 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +000088 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +000089 "libbinder_random_parcel_seeds",
90 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +000091 ],
92 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +000093 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +000094}
95
96aidl_interface {
97 name: "binderRecordReplayTestIface",
98 unstable: true,
99 srcs: [
100 "IBinderRecordReplayTest.aidl",
101 ],
Pawan Wagh8da45382023-05-11 08:08:50 +0000102 imports: ["binderReadParcelIface"],
103 backend: {
104 java: {
105 enabled: true,
106 platform_apis: true,
107 },
Steven Moreland59813352024-02-08 23:52:11 +0000108
109 // TODO: switch from FileDescriptor to ParcelFileDescriptor
Pawan Wagh76b18152023-12-01 14:30:26 +0000110 ndk: {
111 enabled: false,
112 },
Steven Moreland59813352024-02-08 23:52:11 +0000113 rust: {
114 enabled: false,
115 },
Pawan Wagh8da45382023-05-11 08:08:50 +0000116 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000117}
118
119cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700120 name: "binderLibTest",
121 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800122
Dan Willemsen59e086f2016-07-25 17:13:45 -0700123 srcs: ["binderLibTest.cpp"],
124 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700125 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700126 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700127 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700128 "libutils",
129 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700130 static_libs: [
131 "libgmock",
132 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000133 test_suites: [
134 "device-tests",
135 "vts",
136 ],
Dan Shi80ada592019-09-13 09:17:17 -0700137 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700138}
139
Steven Moreland37aff182021-03-26 02:04:16 +0000140aidl_interface {
141 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000142 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000143 host_supported: true,
144 unstable: true,
145 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700146 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000147 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700148 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000149 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000150 "IBinderRpcSession.aidl",
151 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700152 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000153 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800154 flags: [
155 "-Werror",
156 "-Wno-mixed-oneway",
157 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000158 backend: {
159 java: {
160 enabled: false,
161 },
162 },
163}
164
Yifan Honge0e53282021-09-23 18:37:21 -0700165cc_library_static {
166 name: "libbinder_tls_test_utils",
167 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000168 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700169 target: {
170 darwin: {
171 enabled: false,
172 },
173 },
174 defaults: [
175 "binder_test_defaults",
176 "libbinder_tls_shared_deps",
177 ],
178 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700179 "libbase",
180 "liblog",
181 ],
182 static_libs: [
183 "libbinder_tls_static",
184 ],
185 srcs: [
186 "RpcTlsTestUtils.cpp",
187 ],
188 export_include_dirs: [
189 "include_tls_test_utils",
190 ],
191 visibility: [
192 ":__subpackages__",
193 ],
194}
195
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700196cc_library_static {
197 name: "libbinder_test_utils",
198 host_supported: true,
199 vendor_available: true,
200 target: {
201 darwin: {
202 enabled: false,
203 },
204 },
205 defaults: [
206 "binder_test_defaults",
207 ],
Tomasz Wasilczykfbfea5b2024-04-30 10:54:23 -0700208 header_libs: [
209 "libbinder_headers_base",
210 ],
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700211 shared_libs: [
212 "libbase",
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700213 ],
214 srcs: [
215 "FileUtils.cpp",
216 ],
217 visibility: [
218 ":__subpackages__",
219 ],
220}
221
Andrei Homescu12106de2022-04-27 04:42:21 +0000222cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000223 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000224 host_supported: true,
225 target: {
226 darwin: {
227 enabled: false,
228 },
229 },
Steven Moreland37aff182021-03-26 02:04:16 +0000230 defaults: [
231 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000232 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000233
Andrei Homescu12106de2022-04-27 04:42:21 +0000234 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700235 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000236 "libbinder_tls_static",
237 "libbinder_tls_test_utils",
238 "binderRpcTestIface-cpp",
239 "binderRpcTestIface-ndk",
240 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000241}
242
243cc_defaults {
244 name: "binderRpcTest_service_defaults",
245 defaults: [
246 "binderRpcTest_common_defaults",
247 ],
248 gtest: false,
249 auto_gen_config: false,
250 srcs: [
251 "binderRpcTestCommon.cpp",
252 "binderRpcTestService.cpp",
253 ],
254}
255
256cc_defaults {
257 name: "binderRpcTest_defaults",
258 target: {
259 android: {
260 test_suites: ["vts"],
261 },
262 },
263 defaults: [
264 "binderRpcTest_common_defaults",
265 ],
266
267 srcs: [
268 "binderRpcTest.cpp",
269 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000270 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000271 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000272
Steven Moreland20531612023-04-04 18:03:24 +0000273 // This test uses a lot of resources and takes a long time. Due to
274 // design of several tests, it is also very sensitive to resource
275 // contention on the device. b/276820894
276 test_options: {
277 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000278 test_runner_options: [
279 {
280 name: "native-test-timeout",
281 value: "10m",
282 },
283 ],
Steven Moreland20531612023-04-04 18:03:24 +0000284 },
285
Andrei Homescu12106de2022-04-27 04:42:21 +0000286 test_suites: ["general-tests"],
287 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000288
289 data_bins: [
290 "binder_rpc_test_service",
291 "binder_rpc_test_service_no_kernel",
292 "binder_rpc_test_service_single_threaded",
293 "binder_rpc_test_service_single_threaded_no_kernel",
294 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000295}
296
Andrei Homescu2a298012022-06-15 01:08:54 +0000297cc_defaults {
298 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000299 cflags: [
300 "-DBINDER_WITH_KERNEL_IPC",
301 ],
302
Steven Moreland5553ac42020-11-11 02:14:45 +0000303 shared_libs: [
304 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000305 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000306 "libbase",
307 "libutils",
308 "libcutils",
309 "liblog",
310 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000311}
312
313cc_defaults {
314 name: "binderRpcTest_static_defaults",
315
316 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000317 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000318 "libutils",
319 // libcrypto_static is not visible to this module
320 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000321 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000322 static_libs: [
323 "libbase",
324 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000325 "libssl",
326 ],
327
328 cflags: [
329 // Disable tests that require shared libraries,
330 // e.g., libbinder.so or libbinder_ndk.so
331 "-DBINDER_TEST_NO_SHARED_LIBS",
332 ],
333}
334
335cc_test {
Andrei Homescu2a298012022-06-15 01:08:54 +0000336 // The module name cannot start with "binderRpcTest" because
337 // then atest tries to execute it as part of binderRpcTest
338 name: "binder_rpc_test_service",
339 defaults: [
340 "binderRpcTest_service_defaults",
341 "binderRpcTest_shared_defaults",
342 "libbinder_tls_shared_deps",
343 ],
344}
345
346cc_test {
347 name: "binder_rpc_test_service_no_kernel",
348 defaults: [
349 "binderRpcTest_service_defaults",
350 "binderRpcTest_static_defaults",
351 ],
352 static_libs: [
353 "libbinder_rpc_no_kernel",
354 ],
355}
356
357cc_test {
358 name: "binder_rpc_test_service_single_threaded",
359 defaults: [
360 "binderRpcTest_service_defaults",
361 "binderRpcTest_static_defaults",
362 ],
363 cflags: [
364 "-DBINDER_RPC_SINGLE_THREADED",
365 "-DBINDER_WITH_KERNEL_IPC",
366 ],
367 static_libs: [
368 "libbinder_rpc_single_threaded",
369 ],
370}
371
372cc_test {
373 name: "binder_rpc_test_service_single_threaded_no_kernel",
374 defaults: [
375 "binderRpcTest_service_defaults",
376 "binderRpcTest_static_defaults",
377 ],
378 cflags: [
379 "-DBINDER_RPC_SINGLE_THREADED",
380 ],
381 static_libs: [
382 "libbinder_rpc_single_threaded_no_kernel",
383 ],
384}
385
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000386cc_binary {
387 name: "binderRpcTestService_on_trusty_mock",
388 defaults: [
389 "trusty_mock_defaults",
390 ],
391
392 srcs: [
393 "binderRpcTestCommon.cpp",
394 "binderRpcTestServiceTrusty.cpp",
395 ],
396
397 shared_libs: [
398 "libbinder_on_trusty_mock",
399 "libbase",
400 "libutils",
401 "libcutils",
402 ],
403
404 static_libs: [
405 "binderRpcTestIface-cpp",
406 ],
407}
408
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000409cc_binary {
410 name: "binderRpcTest_on_trusty_mock",
411 defaults: [
412 "trusty_mock_defaults",
413 ],
414
415 srcs: [
416 "binderRpcUniversalTests.cpp",
417 "binderRpcTestCommon.cpp",
418 "binderRpcTestTrusty.cpp",
419 ],
420
421 shared_libs: [
422 "libbinder_on_trusty_mock",
423 "libbase",
424 "libutils",
425 "libcutils",
426 ],
427
428 static_libs: [
429 "binderRpcTestIface-cpp",
430 "libgtest",
431 ],
432}
433
Andrei Homescu2a298012022-06-15 01:08:54 +0000434cc_test {
435 name: "binderRpcTest",
436 defaults: [
437 "binderRpcTest_defaults",
438 "binderRpcTest_shared_defaults",
439 "libbinder_tls_shared_deps",
440 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000441
442 // Add the Trusty mock library as a fake dependency so it gets built
443 required: [
444 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000445 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000446 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000447 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000448 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000449 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000450}
451
452cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000453 name: "binderRpcTestNoKernel",
454 defaults: [
455 "binderRpcTest_defaults",
456 "binderRpcTest_static_defaults",
457 ],
458 static_libs: [
459 "libbinder_rpc_no_kernel",
460 ],
461}
462
463cc_test {
Tomasz Wasilczyk2265ad92024-05-01 12:54:46 -0700464 name: "binderRpcTestNoKernelAtAll",
465 defaults: [
466 "binderRpcTest_defaults",
467 "binderRpcTest_static_defaults",
468 ],
469 static_libs: [
470 "libbinder_rpc_no_kernel",
471 ],
472 cflags: [
473 "-DBINDER_NO_KERNEL_IPC_TESTING",
474 ],
475}
476
477cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000478 name: "binderRpcTestSingleThreaded",
479 defaults: [
480 "binderRpcTest_defaults",
481 "binderRpcTest_static_defaults",
482 ],
483 cflags: [
484 "-DBINDER_RPC_SINGLE_THREADED",
485 "-DBINDER_WITH_KERNEL_IPC",
486 ],
487 static_libs: [
488 "libbinder_rpc_single_threaded",
489 ],
490}
491
492cc_test {
493 name: "binderRpcTestSingleThreadedNoKernel",
494 defaults: [
495 "binderRpcTest_defaults",
496 "binderRpcTest_static_defaults",
497 ],
498 cflags: [
499 "-DBINDER_RPC_SINGLE_THREADED",
500 ],
501 static_libs: [
502 "libbinder_rpc_single_threaded_no_kernel",
503 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000504}
505
Yifan Hongff73aa92021-09-17 21:28:01 -0700506cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000507 name: "binderRpcToTrustyTest",
508 vendor: true,
509 host_supported: false,
510 defaults: [
511 "binderRpcTest_common_defaults",
512 "binderRpcTest_static_defaults",
513 ],
514
515 srcs: [
516 "binderRpcTest.cpp",
517 "binderRpcTestCommon.cpp",
518 "binderRpcUniversalTests.cpp",
519 ],
520
521 cflags: [
522 "-DBINDER_RPC_TO_TRUSTY_TEST",
523 ],
524
525 static_libs: [
526 // We want to link libbinder statically so we can push the binary
527 // to the device for testing independently of the library
528 "libbinder_rpc_no_kernel",
529 "libbinder_trusty",
530 "libtrusty",
531 ],
532
533 test_suites: ["device-tests"],
534 require_root: true,
535}
536
537cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700538 name: "RpcTlsUtilsTest",
539 host_supported: true,
540 target: {
541 darwin: {
542 enabled: false,
543 },
544 android: {
545 test_suites: ["vts"],
546 },
547 },
548 defaults: [
549 "binder_test_defaults",
550 "libbinder_tls_shared_deps",
551 ],
552 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700553 "RpcTlsUtilsTest.cpp",
554 ],
555 shared_libs: [
556 "libbinder",
557 "libbase",
558 "libutils",
559 "liblog",
560 ],
561 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700562 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700563 "libbinder_tls_static",
564 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000565 test_suites: [
566 "general-tests",
567 "device-tests",
568 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700569}
570
Steven Morelandcda60852021-04-14 23:45:32 +0000571cc_benchmark {
572 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700573 defaults: [
574 "binder_test_defaults",
575 "libbinder_tls_shared_deps",
576 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000577 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000578 target: {
579 darwin: {
580 enabled: false,
581 },
582 },
Steven Morelandcda60852021-04-14 23:45:32 +0000583 srcs: [
584 "binderRpcBenchmark.cpp",
585 "IBinderRpcBenchmark.aidl",
586 ],
587 shared_libs: [
588 "libbase",
589 "libbinder",
590 "liblog",
591 "libutils",
592 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700593 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700594 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700595 "libbinder_tls_static",
596 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000597}
598
Steven Moreland5553ac42020-11-11 02:14:45 +0000599cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700600 name: "binderRpcWireProtocolTest",
601 host_supported: true,
602 target: {
603 darwin: {
604 enabled: false,
605 },
606 android: {
607 test_suites: ["vts"],
608 },
609 },
610 defaults: [
611 "binder_test_defaults",
612 ],
613 srcs: [
614 "binderRpcWireProtocolTest.cpp",
615 ],
616 shared_libs: [
617 "libbinder",
618 "libbase",
619 "libutils",
620 "libcutils",
621 "liblog",
622 ],
623 test_suites: ["general-tests"],
624}
625
626cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700627 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700628 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700629 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700630 shared_libs: [
631 "libbinder",
632 "libutils",
633 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700634 cflags: [
635 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700636 "-Wno-missing-field-initializers",
637 "-Wno-sign-compare",
638 "-O3",
639 ],
640}
Wei Wang78f2a372016-10-20 23:18:17 -0700641
642cc_test {
643 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700644 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700645 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700646 shared_libs: [
647 "libbinder",
648 "libutils",
649 "libbase",
650 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700651 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700652}
Howard Chenc135dbc2017-03-25 17:12:59 +0800653
654cc_test {
655 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700656 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700657 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800658 shared_libs: [
659 "libbinder",
660 "libutils",
661 "libbase",
662 ],
663}
Dan Stozad630e522016-12-01 15:16:31 -0800664
665cc_test {
666 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700667 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700668 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800669
670 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800671 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800672 ],
673
674 cpp_std: "experimental",
675 gnu_extensions: false,
676
677 shared_libs: [
678 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700679 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800680 "liblog",
681 "libutils",
682 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000683 test_suites: [
684 "device-tests",
685 "vts",
686 ],
Dan Shi80ada592019-09-13 09:17:17 -0700687 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800688}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700689
Steven Morelandf23dae22020-10-27 19:34:55 +0000690cc_test {
691 name: "binderClearBufTest",
692 defaults: ["binder_test_defaults"],
693 srcs: [
694 "binderClearBufTest.cpp",
695 ],
696
697 shared_libs: [
698 "libbase",
699 "libbinder",
700 "liblog",
701 "libutils",
702 ],
703
704 test_suites: ["general-tests"],
705 require_root: true,
706}
707
Steven Moreland12300a02019-08-02 13:27:15 -0700708aidl_interface {
709 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900710 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700711 srcs: [
712 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700713 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000714 backend: {
715 java: {
716 enabled: false,
717 },
718 },
Steven Moreland12300a02019-08-02 13:27:15 -0700719}
720
Steven Morelanddea3cf92019-07-16 18:06:55 -0700721cc_test {
722 name: "binderStabilityTest",
723 defaults: ["binder_test_defaults"],
724 srcs: [
725 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700726 ],
727
Steven Moreland13f84662020-07-23 21:30:41 +0000728 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700729 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700730 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700731 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700732 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700733 "libutils",
734 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700735 static_libs: [
736 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900737 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700738 ],
739
Steven Morelandea7659e2022-02-03 00:04:06 +0000740 test_suites: [
741 "device-tests",
742 "vts",
743 ],
Dan Shi302709b2019-09-19 15:28:15 -0700744 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700745}
Steven Moreland042ae822020-05-27 17:45:17 +0000746
747cc_test {
748 name: "binderAllocationLimits",
749 defaults: ["binder_test_defaults"],
750 srcs: ["binderAllocationLimits.cpp"],
751 shared_libs: [
752 "libbinder",
753 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000754 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000755 "libutils",
756 "libutilscallstack",
757 "libbase",
758 ],
759 test_suites: ["device-tests"],
760 require_root: true,
761}
Andy Hung73a14702020-11-24 13:04:46 -0800762
763cc_benchmark {
764 name: "binderParcelBenchmark",
765 defaults: ["binder_test_defaults"],
766 srcs: ["binderParcelBenchmark.cpp"],
767 shared_libs: [
768 "libbase",
769 "libbinder",
770 "liblog",
771 "libutils",
772 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000773 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800774}
Yifan Hongaf766e62021-06-14 13:24:19 -0700775
776cc_test_host {
777 name: "binderUtilsHostTest",
778 defaults: ["binder_test_defaults"],
779 srcs: ["binderUtilsHostTest.cpp"],
780 shared_libs: [
781 "libbase",
782 "libbinder",
783 ],
784 static_libs: [
785 "libgmock",
786 ],
787 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700788 target: {
789 darwin: {
790 enabled: false,
791 },
792 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700793}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700794
795cc_test_host {
796 name: "binderHostDeviceTest",
797 defaults: ["binder_test_defaults"],
798 srcs: ["binderHostDeviceTest.cpp"],
799 test_config: "binderHostDeviceTest.xml",
800 shared_libs: [
801 "libbase",
802 "libbinder",
803 "liblog",
804 "libutils",
805 ],
806 static_libs: [
807 "libgmock",
808 ],
809 target_required: [
810 "binderHostDeviceTestService",
811 ],
812 test_suites: ["general-tests"],
813 target: {
814 darwin: {
815 enabled: false,
816 },
817 },
818 test_options: {
819 unit_test: false,
820 },
821}
822
823cc_test {
824 name: "binderHostDeviceTestService",
825 // The binary is named differently from the module so that PushFilePreparer pushes the binary
826 // directly, not the test module directory.
827 stem: "binderHostDeviceTest-service",
828 defaults: ["binder_test_defaults"],
829 gtest: false,
830 auto_gen_config: false,
831 srcs: ["binderHostDeviceTestService.cpp"],
832 shared_libs: [
833 "libbase",
834 "libbinder",
835 "liblog",
836 "libutils",
837 ],
838 test_suites: ["general-tests"],
839}
Pawanf00fabb2022-08-04 17:56:18 +0000840
841cc_defaults {
842 name: "service_fuzzer_defaults",
843 static_libs: [
844 "libbase",
845 "libbinder_random_parcel",
846 "libcutils",
847 ],
848 target: {
849 android: {
850 shared_libs: [
851 "libbinder_ndk",
852 "libbinder",
853 "libutils",
854 ],
855 },
856 host: {
857 static_libs: [
858 "libbinder_ndk",
859 "libbinder",
860 "libutils",
861 ],
862 },
863 darwin: {
864 enabled: false,
865 },
866 },
867 fuzz_config: {
868 cc: [
869 "smoreland@google.com",
870 "waghpawan@google.com",
871 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000872 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
873 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000874 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000875 },
876}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000877
878cc_defaults {
879 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000880 fuzz_config: {
881 asan_options: [
882 "detect_leaks=0",
883 ],
884 hwasan_options: [
885 "detect_leaks=0",
886 ],
887 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000888}