blob: bd24a20370fe5fa379ab8092b49a6b5953b227a1 [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 {
464 name: "binderRpcTestSingleThreaded",
465 defaults: [
466 "binderRpcTest_defaults",
467 "binderRpcTest_static_defaults",
468 ],
469 cflags: [
470 "-DBINDER_RPC_SINGLE_THREADED",
471 "-DBINDER_WITH_KERNEL_IPC",
472 ],
473 static_libs: [
474 "libbinder_rpc_single_threaded",
475 ],
476}
477
478cc_test {
479 name: "binderRpcTestSingleThreadedNoKernel",
480 defaults: [
481 "binderRpcTest_defaults",
482 "binderRpcTest_static_defaults",
483 ],
484 cflags: [
485 "-DBINDER_RPC_SINGLE_THREADED",
486 ],
487 static_libs: [
488 "libbinder_rpc_single_threaded_no_kernel",
489 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000490}
491
Yifan Hongff73aa92021-09-17 21:28:01 -0700492cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000493 name: "binderRpcToTrustyTest",
494 vendor: true,
495 host_supported: false,
496 defaults: [
497 "binderRpcTest_common_defaults",
498 "binderRpcTest_static_defaults",
499 ],
500
501 srcs: [
502 "binderRpcTest.cpp",
503 "binderRpcTestCommon.cpp",
504 "binderRpcUniversalTests.cpp",
505 ],
506
507 cflags: [
508 "-DBINDER_RPC_TO_TRUSTY_TEST",
509 ],
510
511 static_libs: [
512 // We want to link libbinder statically so we can push the binary
513 // to the device for testing independently of the library
514 "libbinder_rpc_no_kernel",
515 "libbinder_trusty",
516 "libtrusty",
517 ],
518
519 test_suites: ["device-tests"],
520 require_root: true,
521}
522
523cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700524 name: "RpcTlsUtilsTest",
525 host_supported: true,
526 target: {
527 darwin: {
528 enabled: false,
529 },
530 android: {
531 test_suites: ["vts"],
532 },
533 },
534 defaults: [
535 "binder_test_defaults",
536 "libbinder_tls_shared_deps",
537 ],
538 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700539 "RpcTlsUtilsTest.cpp",
540 ],
541 shared_libs: [
542 "libbinder",
543 "libbase",
544 "libutils",
545 "liblog",
546 ],
547 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700548 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700549 "libbinder_tls_static",
550 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000551 test_suites: [
552 "general-tests",
553 "device-tests",
554 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700555}
556
Steven Morelandcda60852021-04-14 23:45:32 +0000557cc_benchmark {
558 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700559 defaults: [
560 "binder_test_defaults",
561 "libbinder_tls_shared_deps",
562 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000563 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000564 target: {
565 darwin: {
566 enabled: false,
567 },
568 },
Steven Morelandcda60852021-04-14 23:45:32 +0000569 srcs: [
570 "binderRpcBenchmark.cpp",
571 "IBinderRpcBenchmark.aidl",
572 ],
573 shared_libs: [
574 "libbase",
575 "libbinder",
576 "liblog",
577 "libutils",
578 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700579 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700580 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700581 "libbinder_tls_static",
582 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000583}
584
Steven Moreland5553ac42020-11-11 02:14:45 +0000585cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700586 name: "binderRpcWireProtocolTest",
587 host_supported: true,
588 target: {
589 darwin: {
590 enabled: false,
591 },
592 android: {
593 test_suites: ["vts"],
594 },
595 },
596 defaults: [
597 "binder_test_defaults",
598 ],
599 srcs: [
600 "binderRpcWireProtocolTest.cpp",
601 ],
602 shared_libs: [
603 "libbinder",
604 "libbase",
605 "libutils",
606 "libcutils",
607 "liblog",
608 ],
609 test_suites: ["general-tests"],
610}
611
612cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700613 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700614 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700615 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700616 shared_libs: [
617 "libbinder",
618 "libutils",
619 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700620 cflags: [
621 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700622 "-Wno-missing-field-initializers",
623 "-Wno-sign-compare",
624 "-O3",
625 ],
626}
Wei Wang78f2a372016-10-20 23:18:17 -0700627
628cc_test {
629 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700630 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700631 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700632 shared_libs: [
633 "libbinder",
634 "libutils",
635 "libbase",
636 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700637 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700638}
Howard Chenc135dbc2017-03-25 17:12:59 +0800639
640cc_test {
641 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700642 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700643 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800644 shared_libs: [
645 "libbinder",
646 "libutils",
647 "libbase",
648 ],
649}
Dan Stozad630e522016-12-01 15:16:31 -0800650
651cc_test {
652 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700653 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700654 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800655
656 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800657 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800658 ],
659
660 cpp_std: "experimental",
661 gnu_extensions: false,
662
663 shared_libs: [
664 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700665 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800666 "liblog",
667 "libutils",
668 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000669 test_suites: [
670 "device-tests",
671 "vts",
672 ],
Dan Shi80ada592019-09-13 09:17:17 -0700673 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800674}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700675
Steven Morelandf23dae22020-10-27 19:34:55 +0000676cc_test {
677 name: "binderClearBufTest",
678 defaults: ["binder_test_defaults"],
679 srcs: [
680 "binderClearBufTest.cpp",
681 ],
682
683 shared_libs: [
684 "libbase",
685 "libbinder",
686 "liblog",
687 "libutils",
688 ],
689
690 test_suites: ["general-tests"],
691 require_root: true,
692}
693
Steven Moreland12300a02019-08-02 13:27:15 -0700694aidl_interface {
695 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900696 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700697 srcs: [
698 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700699 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000700 backend: {
701 java: {
702 enabled: false,
703 },
704 },
Steven Moreland12300a02019-08-02 13:27:15 -0700705}
706
Steven Morelanddea3cf92019-07-16 18:06:55 -0700707cc_test {
708 name: "binderStabilityTest",
709 defaults: ["binder_test_defaults"],
710 srcs: [
711 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700712 ],
713
Steven Moreland13f84662020-07-23 21:30:41 +0000714 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700715 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700716 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700717 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700718 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700719 "libutils",
720 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700721 static_libs: [
722 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900723 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700724 ],
725
Steven Morelandea7659e2022-02-03 00:04:06 +0000726 test_suites: [
727 "device-tests",
728 "vts",
729 ],
Dan Shi302709b2019-09-19 15:28:15 -0700730 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700731}
Steven Moreland042ae822020-05-27 17:45:17 +0000732
733cc_test {
734 name: "binderAllocationLimits",
735 defaults: ["binder_test_defaults"],
736 srcs: ["binderAllocationLimits.cpp"],
737 shared_libs: [
738 "libbinder",
739 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000740 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000741 "libutils",
742 "libutilscallstack",
743 "libbase",
744 ],
745 test_suites: ["device-tests"],
746 require_root: true,
747}
Andy Hung73a14702020-11-24 13:04:46 -0800748
749cc_benchmark {
750 name: "binderParcelBenchmark",
751 defaults: ["binder_test_defaults"],
752 srcs: ["binderParcelBenchmark.cpp"],
753 shared_libs: [
754 "libbase",
755 "libbinder",
756 "liblog",
757 "libutils",
758 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000759 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800760}
Yifan Hongaf766e62021-06-14 13:24:19 -0700761
762cc_test_host {
763 name: "binderUtilsHostTest",
764 defaults: ["binder_test_defaults"],
765 srcs: ["binderUtilsHostTest.cpp"],
766 shared_libs: [
767 "libbase",
768 "libbinder",
769 ],
770 static_libs: [
771 "libgmock",
772 ],
773 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700774 target: {
775 darwin: {
776 enabled: false,
777 },
778 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700779}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700780
781cc_test_host {
782 name: "binderHostDeviceTest",
783 defaults: ["binder_test_defaults"],
784 srcs: ["binderHostDeviceTest.cpp"],
785 test_config: "binderHostDeviceTest.xml",
786 shared_libs: [
787 "libbase",
788 "libbinder",
789 "liblog",
790 "libutils",
791 ],
792 static_libs: [
793 "libgmock",
794 ],
795 target_required: [
796 "binderHostDeviceTestService",
797 ],
798 test_suites: ["general-tests"],
799 target: {
800 darwin: {
801 enabled: false,
802 },
803 },
804 test_options: {
805 unit_test: false,
806 },
807}
808
809cc_test {
810 name: "binderHostDeviceTestService",
811 // The binary is named differently from the module so that PushFilePreparer pushes the binary
812 // directly, not the test module directory.
813 stem: "binderHostDeviceTest-service",
814 defaults: ["binder_test_defaults"],
815 gtest: false,
816 auto_gen_config: false,
817 srcs: ["binderHostDeviceTestService.cpp"],
818 shared_libs: [
819 "libbase",
820 "libbinder",
821 "liblog",
822 "libutils",
823 ],
824 test_suites: ["general-tests"],
825}
Pawanf00fabb2022-08-04 17:56:18 +0000826
827cc_defaults {
828 name: "service_fuzzer_defaults",
829 static_libs: [
830 "libbase",
831 "libbinder_random_parcel",
832 "libcutils",
833 ],
834 target: {
835 android: {
836 shared_libs: [
837 "libbinder_ndk",
838 "libbinder",
839 "libutils",
840 ],
841 },
842 host: {
843 static_libs: [
844 "libbinder_ndk",
845 "libbinder",
846 "libutils",
847 ],
848 },
849 darwin: {
850 enabled: false,
851 },
852 },
853 fuzz_config: {
854 cc: [
855 "smoreland@google.com",
856 "waghpawan@google.com",
857 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000858 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
859 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000860 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000861 },
862}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000863
864cc_defaults {
865 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000866 fuzz_config: {
867 asan_options: [
868 "detect_leaks=0",
869 ],
870 hwasan_options: [
871 "detect_leaks=0",
872 ],
873 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000874}