blob: 424ff8448c6f9f9f1a71f33910c497bdd5be3623 [file] [log] [blame]
Dan Willemsen59e086f2016-07-25 17:13:45 -07001//
2// Copyright (C) 2014 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Bob Badour3c538232021-02-12 21:26:48 -080017package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "frameworks_native_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["frameworks_native_license"],
24}
25
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070026cc_defaults {
27 name: "binder_test_defaults",
28 cflags: [
29 "-Wall",
30 "-Werror",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070031 ],
32}
33
Dan Willemsen59e086f2016-07-25 17:13:45 -070034cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070035 name: "binderDriverInterfaceTest",
36 defaults: ["binder_test_defaults"],
Yifan Hong4e419d82021-04-26 11:32:56 -070037 header_libs: ["libbinder_headers"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070038 srcs: ["binderDriverInterfaceTest.cpp"],
Steven Morelandea7659e2022-02-03 00:04:06 +000039 test_suites: [
40 "device-tests",
41 "vts",
42 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070043}
44
Steven Morelandcefba612020-11-05 22:57:06 +000045// unit test only, which can run on host and doesn't use /dev/binder
46cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000047 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000048 host_supported: true,
49 target: {
50 darwin: {
51 enabled: false,
52 },
53 },
Steven Morelandea7659e2022-02-03 00:04:06 +000054 srcs: [
55 "binderParcelUnitTest.cpp",
56 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +000057 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -050058 "binderMemoryHeapBaseUnitTest.cpp",
Fabián Cañas08bdc772023-01-02 15:02:56 -050059 "binderRecordedTransactionTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +000060 ],
Steven Morelandcefba612020-11-05 22:57:06 +000061 shared_libs: [
62 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -070063 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +000064 "libutils",
65 ],
66 test_suites: ["general-tests"],
67}
68
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080069cc_test {
Steven Morelanda8244b92023-04-20 23:34:11 +000070 name: "binderRecordReplayTest",
71 srcs: ["binderRecordReplayTest.cpp"],
Pawan Wagh76b18152023-12-01 14:30:26 +000072 cflags: [
73 "-DBINDER_WITH_KERNEL_IPC",
74 ],
Steven Morelanda8244b92023-04-20 23:34:11 +000075 shared_libs: [
76 "libbinder",
77 "libcutils",
78 "libutils",
Pawan Wagh76b18152023-12-01 14:30:26 +000079 "liblog",
Steven Morelanda8244b92023-04-20 23:34:11 +000080 ],
81 static_libs: [
82 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +000083 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +000084 "libbinder_random_parcel_seeds",
85 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +000086 ],
87 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +000088 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +000089}
90
91aidl_interface {
92 name: "binderRecordReplayTestIface",
93 unstable: true,
94 srcs: [
95 "IBinderRecordReplayTest.aidl",
96 ],
Pawan Wagh8da45382023-05-11 08:08:50 +000097 imports: ["binderReadParcelIface"],
98 backend: {
99 java: {
100 enabled: true,
101 platform_apis: true,
102 },
Steven Moreland59813352024-02-08 23:52:11 +0000103
104 // TODO: switch from FileDescriptor to ParcelFileDescriptor
Pawan Wagh76b18152023-12-01 14:30:26 +0000105 ndk: {
106 enabled: false,
107 },
Steven Moreland59813352024-02-08 23:52:11 +0000108 rust: {
109 enabled: false,
110 },
Pawan Wagh8da45382023-05-11 08:08:50 +0000111 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000112}
113
114cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700115 name: "binderLibTest",
116 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800117
Dan Willemsen59e086f2016-07-25 17:13:45 -0700118 srcs: ["binderLibTest.cpp"],
119 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700120 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700121 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700122 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700123 "libutils",
124 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700125 static_libs: [
126 "libgmock",
127 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000128 test_suites: [
129 "device-tests",
130 "vts",
131 ],
Dan Shi80ada592019-09-13 09:17:17 -0700132 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700133}
134
Steven Moreland37aff182021-03-26 02:04:16 +0000135aidl_interface {
136 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000137 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000138 host_supported: true,
139 unstable: true,
140 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700141 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000142 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700143 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000144 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000145 "IBinderRpcSession.aidl",
146 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700147 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000148 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800149 flags: [
150 "-Werror",
151 "-Wno-mixed-oneway",
152 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000153 backend: {
154 java: {
155 enabled: false,
156 },
157 },
158}
159
Yifan Honge0e53282021-09-23 18:37:21 -0700160cc_library_static {
161 name: "libbinder_tls_test_utils",
162 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000163 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700164 target: {
165 darwin: {
166 enabled: false,
167 },
168 },
169 defaults: [
170 "binder_test_defaults",
171 "libbinder_tls_shared_deps",
172 ],
173 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700174 "libbase",
175 "liblog",
176 ],
177 static_libs: [
178 "libbinder_tls_static",
179 ],
180 srcs: [
181 "RpcTlsTestUtils.cpp",
182 ],
183 export_include_dirs: [
184 "include_tls_test_utils",
185 ],
186 visibility: [
187 ":__subpackages__",
188 ],
189}
190
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700191cc_library_static {
192 name: "libbinder_test_utils",
193 host_supported: true,
194 vendor_available: true,
195 target: {
196 darwin: {
197 enabled: false,
198 },
199 },
200 defaults: [
201 "binder_test_defaults",
202 ],
203 shared_libs: [
204 "libbase",
205 "liblog",
206 ],
207 srcs: [
208 "FileUtils.cpp",
209 ],
210 visibility: [
211 ":__subpackages__",
212 ],
213}
214
Andrei Homescu12106de2022-04-27 04:42:21 +0000215cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000216 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000217 host_supported: true,
218 target: {
219 darwin: {
220 enabled: false,
221 },
222 },
Steven Moreland37aff182021-03-26 02:04:16 +0000223 defaults: [
224 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000225 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000226
Andrei Homescu12106de2022-04-27 04:42:21 +0000227 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700228 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000229 "libbinder_tls_static",
230 "libbinder_tls_test_utils",
231 "binderRpcTestIface-cpp",
232 "binderRpcTestIface-ndk",
233 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000234}
235
236cc_defaults {
237 name: "binderRpcTest_service_defaults",
238 defaults: [
239 "binderRpcTest_common_defaults",
240 ],
241 gtest: false,
242 auto_gen_config: false,
243 srcs: [
244 "binderRpcTestCommon.cpp",
245 "binderRpcTestService.cpp",
246 ],
247}
248
249cc_defaults {
250 name: "binderRpcTest_defaults",
251 target: {
252 android: {
253 test_suites: ["vts"],
254 },
255 },
256 defaults: [
257 "binderRpcTest_common_defaults",
258 ],
259
260 srcs: [
261 "binderRpcTest.cpp",
262 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000263 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000264 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000265
Steven Moreland20531612023-04-04 18:03:24 +0000266 // This test uses a lot of resources and takes a long time. Due to
267 // design of several tests, it is also very sensitive to resource
268 // contention on the device. b/276820894
269 test_options: {
270 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000271 test_runner_options: [
272 {
273 name: "native-test-timeout",
274 value: "10m",
275 },
276 ],
Steven Moreland20531612023-04-04 18:03:24 +0000277 },
278
Andrei Homescu12106de2022-04-27 04:42:21 +0000279 test_suites: ["general-tests"],
280 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000281
282 data_bins: [
283 "binder_rpc_test_service",
284 "binder_rpc_test_service_no_kernel",
285 "binder_rpc_test_service_single_threaded",
286 "binder_rpc_test_service_single_threaded_no_kernel",
287 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000288}
289
Andrei Homescu2a298012022-06-15 01:08:54 +0000290cc_defaults {
291 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000292 cflags: [
293 "-DBINDER_WITH_KERNEL_IPC",
294 ],
295
Steven Moreland5553ac42020-11-11 02:14:45 +0000296 shared_libs: [
297 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000298 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000299 "libbase",
300 "libutils",
301 "libcutils",
302 "liblog",
303 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000304}
305
306cc_defaults {
307 name: "binderRpcTest_static_defaults",
308
309 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000310 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000311 "libutils",
312 // libcrypto_static is not visible to this module
313 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000314 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000315 static_libs: [
316 "libbase",
317 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000318 "libssl",
319 ],
320
321 cflags: [
322 // Disable tests that require shared libraries,
323 // e.g., libbinder.so or libbinder_ndk.so
324 "-DBINDER_TEST_NO_SHARED_LIBS",
325 ],
326}
327
328cc_test {
Andrei Homescu2a298012022-06-15 01:08:54 +0000329 // The module name cannot start with "binderRpcTest" because
330 // then atest tries to execute it as part of binderRpcTest
331 name: "binder_rpc_test_service",
332 defaults: [
333 "binderRpcTest_service_defaults",
334 "binderRpcTest_shared_defaults",
335 "libbinder_tls_shared_deps",
336 ],
337}
338
339cc_test {
340 name: "binder_rpc_test_service_no_kernel",
341 defaults: [
342 "binderRpcTest_service_defaults",
343 "binderRpcTest_static_defaults",
344 ],
345 static_libs: [
346 "libbinder_rpc_no_kernel",
347 ],
348}
349
350cc_test {
351 name: "binder_rpc_test_service_single_threaded",
352 defaults: [
353 "binderRpcTest_service_defaults",
354 "binderRpcTest_static_defaults",
355 ],
356 cflags: [
357 "-DBINDER_RPC_SINGLE_THREADED",
358 "-DBINDER_WITH_KERNEL_IPC",
359 ],
360 static_libs: [
361 "libbinder_rpc_single_threaded",
362 ],
363}
364
365cc_test {
366 name: "binder_rpc_test_service_single_threaded_no_kernel",
367 defaults: [
368 "binderRpcTest_service_defaults",
369 "binderRpcTest_static_defaults",
370 ],
371 cflags: [
372 "-DBINDER_RPC_SINGLE_THREADED",
373 ],
374 static_libs: [
375 "libbinder_rpc_single_threaded_no_kernel",
376 ],
377}
378
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000379cc_binary {
380 name: "binderRpcTestService_on_trusty_mock",
381 defaults: [
382 "trusty_mock_defaults",
383 ],
384
385 srcs: [
386 "binderRpcTestCommon.cpp",
387 "binderRpcTestServiceTrusty.cpp",
388 ],
389
390 shared_libs: [
391 "libbinder_on_trusty_mock",
392 "libbase",
393 "libutils",
394 "libcutils",
395 ],
396
397 static_libs: [
398 "binderRpcTestIface-cpp",
399 ],
400}
401
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000402cc_binary {
403 name: "binderRpcTest_on_trusty_mock",
404 defaults: [
405 "trusty_mock_defaults",
406 ],
407
408 srcs: [
409 "binderRpcUniversalTests.cpp",
410 "binderRpcTestCommon.cpp",
411 "binderRpcTestTrusty.cpp",
412 ],
413
414 shared_libs: [
415 "libbinder_on_trusty_mock",
416 "libbase",
417 "libutils",
418 "libcutils",
419 ],
420
421 static_libs: [
422 "binderRpcTestIface-cpp",
423 "libgtest",
424 ],
425}
426
Andrei Homescu2a298012022-06-15 01:08:54 +0000427cc_test {
428 name: "binderRpcTest",
429 defaults: [
430 "binderRpcTest_defaults",
431 "binderRpcTest_shared_defaults",
432 "libbinder_tls_shared_deps",
433 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000434
435 // Add the Trusty mock library as a fake dependency so it gets built
436 required: [
437 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000438 "libbinder_ndk_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000439 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000440 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000441 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000442}
443
444cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000445 name: "binderRpcTestNoKernel",
446 defaults: [
447 "binderRpcTest_defaults",
448 "binderRpcTest_static_defaults",
449 ],
450 static_libs: [
451 "libbinder_rpc_no_kernel",
452 ],
453}
454
455cc_test {
456 name: "binderRpcTestSingleThreaded",
457 defaults: [
458 "binderRpcTest_defaults",
459 "binderRpcTest_static_defaults",
460 ],
461 cflags: [
462 "-DBINDER_RPC_SINGLE_THREADED",
463 "-DBINDER_WITH_KERNEL_IPC",
464 ],
465 static_libs: [
466 "libbinder_rpc_single_threaded",
467 ],
468}
469
470cc_test {
471 name: "binderRpcTestSingleThreadedNoKernel",
472 defaults: [
473 "binderRpcTest_defaults",
474 "binderRpcTest_static_defaults",
475 ],
476 cflags: [
477 "-DBINDER_RPC_SINGLE_THREADED",
478 ],
479 static_libs: [
480 "libbinder_rpc_single_threaded_no_kernel",
481 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000482}
483
Yifan Hongff73aa92021-09-17 21:28:01 -0700484cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000485 name: "binderRpcToTrustyTest",
486 vendor: true,
487 host_supported: false,
488 defaults: [
489 "binderRpcTest_common_defaults",
490 "binderRpcTest_static_defaults",
491 ],
492
493 srcs: [
494 "binderRpcTest.cpp",
495 "binderRpcTestCommon.cpp",
496 "binderRpcUniversalTests.cpp",
497 ],
498
499 cflags: [
500 "-DBINDER_RPC_TO_TRUSTY_TEST",
501 ],
502
503 static_libs: [
504 // We want to link libbinder statically so we can push the binary
505 // to the device for testing independently of the library
506 "libbinder_rpc_no_kernel",
507 "libbinder_trusty",
508 "libtrusty",
509 ],
510
511 test_suites: ["device-tests"],
512 require_root: true,
513}
514
515cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700516 name: "RpcTlsUtilsTest",
517 host_supported: true,
518 target: {
519 darwin: {
520 enabled: false,
521 },
522 android: {
523 test_suites: ["vts"],
524 },
525 },
526 defaults: [
527 "binder_test_defaults",
528 "libbinder_tls_shared_deps",
529 ],
530 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700531 "RpcTlsUtilsTest.cpp",
532 ],
533 shared_libs: [
534 "libbinder",
535 "libbase",
536 "libutils",
537 "liblog",
538 ],
539 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700540 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700541 "libbinder_tls_static",
542 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000543 test_suites: [
544 "general-tests",
545 "device-tests",
546 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700547}
548
Steven Morelandcda60852021-04-14 23:45:32 +0000549cc_benchmark {
550 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700551 defaults: [
552 "binder_test_defaults",
553 "libbinder_tls_shared_deps",
554 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000555 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000556 target: {
557 darwin: {
558 enabled: false,
559 },
560 },
Steven Morelandcda60852021-04-14 23:45:32 +0000561 srcs: [
562 "binderRpcBenchmark.cpp",
563 "IBinderRpcBenchmark.aidl",
564 ],
565 shared_libs: [
566 "libbase",
567 "libbinder",
568 "liblog",
569 "libutils",
570 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700571 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700572 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700573 "libbinder_tls_static",
574 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000575}
576
Steven Moreland5553ac42020-11-11 02:14:45 +0000577cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700578 name: "binderRpcWireProtocolTest",
579 host_supported: true,
580 target: {
581 darwin: {
582 enabled: false,
583 },
584 android: {
585 test_suites: ["vts"],
586 },
587 },
588 defaults: [
589 "binder_test_defaults",
590 ],
591 srcs: [
592 "binderRpcWireProtocolTest.cpp",
593 ],
594 shared_libs: [
595 "libbinder",
596 "libbase",
597 "libutils",
598 "libcutils",
599 "liblog",
600 ],
601 test_suites: ["general-tests"],
602}
603
604cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700605 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700606 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700607 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700608 shared_libs: [
609 "libbinder",
610 "libutils",
611 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700612 cflags: [
613 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700614 "-Wno-missing-field-initializers",
615 "-Wno-sign-compare",
616 "-O3",
617 ],
618}
Wei Wang78f2a372016-10-20 23:18:17 -0700619
620cc_test {
621 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700622 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700623 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700624 shared_libs: [
625 "libbinder",
626 "libutils",
627 "libbase",
628 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700629 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700630}
Howard Chenc135dbc2017-03-25 17:12:59 +0800631
632cc_test {
633 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700634 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700635 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800636 shared_libs: [
637 "libbinder",
638 "libutils",
639 "libbase",
640 ],
641}
Dan Stozad630e522016-12-01 15:16:31 -0800642
643cc_test {
644 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700645 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700646 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800647
648 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800649 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800650 ],
651
652 cpp_std: "experimental",
653 gnu_extensions: false,
654
655 shared_libs: [
656 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700657 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800658 "liblog",
659 "libutils",
660 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000661 test_suites: [
662 "device-tests",
663 "vts",
664 ],
Dan Shi80ada592019-09-13 09:17:17 -0700665 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800666}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700667
Steven Morelandf23dae22020-10-27 19:34:55 +0000668cc_test {
669 name: "binderClearBufTest",
670 defaults: ["binder_test_defaults"],
671 srcs: [
672 "binderClearBufTest.cpp",
673 ],
674
675 shared_libs: [
676 "libbase",
677 "libbinder",
678 "liblog",
679 "libutils",
680 ],
681
682 test_suites: ["general-tests"],
683 require_root: true,
684}
685
Steven Moreland12300a02019-08-02 13:27:15 -0700686aidl_interface {
687 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900688 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700689 srcs: [
690 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700691 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000692 backend: {
693 java: {
694 enabled: false,
695 },
696 },
Steven Moreland12300a02019-08-02 13:27:15 -0700697}
698
Steven Morelanddea3cf92019-07-16 18:06:55 -0700699cc_test {
700 name: "binderStabilityTest",
701 defaults: ["binder_test_defaults"],
702 srcs: [
703 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700704 ],
705
Steven Moreland13f84662020-07-23 21:30:41 +0000706 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700707 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700708 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700709 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700710 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700711 "libutils",
712 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700713 static_libs: [
714 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900715 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700716 ],
717
Steven Morelandea7659e2022-02-03 00:04:06 +0000718 test_suites: [
719 "device-tests",
720 "vts",
721 ],
Dan Shi302709b2019-09-19 15:28:15 -0700722 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700723}
Steven Moreland042ae822020-05-27 17:45:17 +0000724
725cc_test {
726 name: "binderAllocationLimits",
727 defaults: ["binder_test_defaults"],
728 srcs: ["binderAllocationLimits.cpp"],
729 shared_libs: [
730 "libbinder",
731 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000732 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000733 "libutils",
734 "libutilscallstack",
735 "libbase",
736 ],
737 test_suites: ["device-tests"],
738 require_root: true,
739}
Andy Hung73a14702020-11-24 13:04:46 -0800740
741cc_benchmark {
742 name: "binderParcelBenchmark",
743 defaults: ["binder_test_defaults"],
744 srcs: ["binderParcelBenchmark.cpp"],
745 shared_libs: [
746 "libbase",
747 "libbinder",
748 "liblog",
749 "libutils",
750 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000751 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800752}
Yifan Hongaf766e62021-06-14 13:24:19 -0700753
754cc_test_host {
755 name: "binderUtilsHostTest",
756 defaults: ["binder_test_defaults"],
757 srcs: ["binderUtilsHostTest.cpp"],
758 shared_libs: [
759 "libbase",
760 "libbinder",
761 ],
762 static_libs: [
763 "libgmock",
764 ],
765 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700766 target: {
767 darwin: {
768 enabled: false,
769 },
770 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700771}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700772
773cc_test_host {
774 name: "binderHostDeviceTest",
775 defaults: ["binder_test_defaults"],
776 srcs: ["binderHostDeviceTest.cpp"],
777 test_config: "binderHostDeviceTest.xml",
778 shared_libs: [
779 "libbase",
780 "libbinder",
781 "liblog",
782 "libutils",
783 ],
784 static_libs: [
785 "libgmock",
786 ],
787 target_required: [
788 "binderHostDeviceTestService",
789 ],
790 test_suites: ["general-tests"],
791 target: {
792 darwin: {
793 enabled: false,
794 },
795 },
796 test_options: {
797 unit_test: false,
798 },
799}
800
801cc_test {
802 name: "binderHostDeviceTestService",
803 // The binary is named differently from the module so that PushFilePreparer pushes the binary
804 // directly, not the test module directory.
805 stem: "binderHostDeviceTest-service",
806 defaults: ["binder_test_defaults"],
807 gtest: false,
808 auto_gen_config: false,
809 srcs: ["binderHostDeviceTestService.cpp"],
810 shared_libs: [
811 "libbase",
812 "libbinder",
813 "liblog",
814 "libutils",
815 ],
816 test_suites: ["general-tests"],
817}
Pawanf00fabb2022-08-04 17:56:18 +0000818
819cc_defaults {
820 name: "service_fuzzer_defaults",
821 static_libs: [
822 "libbase",
823 "libbinder_random_parcel",
824 "libcutils",
825 ],
826 target: {
827 android: {
828 shared_libs: [
829 "libbinder_ndk",
830 "libbinder",
831 "libutils",
832 ],
833 },
834 host: {
835 static_libs: [
836 "libbinder_ndk",
837 "libbinder",
838 "libutils",
839 ],
840 },
841 darwin: {
842 enabled: false,
843 },
844 },
845 fuzz_config: {
846 cc: [
847 "smoreland@google.com",
848 "waghpawan@google.com",
849 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000850 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
851 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000852 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000853 },
854}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000855
856cc_defaults {
857 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000858 fuzz_config: {
859 asan_options: [
860 "detect_leaks=0",
861 ],
862 hwasan_options: [
863 "detect_leaks=0",
864 ],
865 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000866}