blob: 8771af52f341eb0c4fb902241676b7d94d9e78f2 [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",
Abhishek Gadewar76f00822024-05-09 17:02:18 -070065 "binderPersistableBundleTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +000066 ],
Steven Morelandcefba612020-11-05 22:57:06 +000067 shared_libs: [
68 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -070069 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +000070 "libutils",
71 ],
72 test_suites: ["general-tests"],
73}
74
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080075cc_test {
Steven Morelanda8244b92023-04-20 23:34:11 +000076 name: "binderRecordReplayTest",
77 srcs: ["binderRecordReplayTest.cpp"],
Pawan Wagh76b18152023-12-01 14:30:26 +000078 cflags: [
79 "-DBINDER_WITH_KERNEL_IPC",
80 ],
Steven Morelanda8244b92023-04-20 23:34:11 +000081 shared_libs: [
82 "libbinder",
83 "libcutils",
84 "libutils",
Pawan Wagh76b18152023-12-01 14:30:26 +000085 "liblog",
Steven Morelanda8244b92023-04-20 23:34:11 +000086 ],
87 static_libs: [
88 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +000089 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +000090 "libbinder_random_parcel_seeds",
91 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +000092 ],
93 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +000094 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +000095}
96
97aidl_interface {
98 name: "binderRecordReplayTestIface",
99 unstable: true,
100 srcs: [
101 "IBinderRecordReplayTest.aidl",
102 ],
Pawan Wagh8da45382023-05-11 08:08:50 +0000103 imports: ["binderReadParcelIface"],
104 backend: {
105 java: {
106 enabled: true,
107 platform_apis: true,
108 },
Steven Moreland59813352024-02-08 23:52:11 +0000109
110 // TODO: switch from FileDescriptor to ParcelFileDescriptor
Pawan Wagh76b18152023-12-01 14:30:26 +0000111 ndk: {
112 enabled: false,
113 },
Steven Moreland59813352024-02-08 23:52:11 +0000114 rust: {
115 enabled: false,
116 },
Pawan Wagh8da45382023-05-11 08:08:50 +0000117 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000118}
119
120cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700121 name: "binderLibTest",
122 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800123
Dan Willemsen59e086f2016-07-25 17:13:45 -0700124 srcs: ["binderLibTest.cpp"],
125 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700126 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700127 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700128 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700129 "libutils",
130 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700131 static_libs: [
132 "libgmock",
133 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000134 test_suites: [
135 "device-tests",
136 "vts",
137 ],
Dan Shi80ada592019-09-13 09:17:17 -0700138 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700139}
140
Steven Moreland37aff182021-03-26 02:04:16 +0000141aidl_interface {
142 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000143 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000144 host_supported: true,
145 unstable: true,
146 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700147 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000148 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700149 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000150 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000151 "IBinderRpcSession.aidl",
152 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700153 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000154 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800155 flags: [
156 "-Werror",
157 "-Wno-mixed-oneway",
158 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000159 backend: {
160 java: {
161 enabled: false,
162 },
163 },
164}
165
Yifan Honge0e53282021-09-23 18:37:21 -0700166cc_library_static {
167 name: "libbinder_tls_test_utils",
168 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000169 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700170 target: {
171 darwin: {
172 enabled: false,
173 },
174 },
175 defaults: [
176 "binder_test_defaults",
177 "libbinder_tls_shared_deps",
178 ],
179 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700180 "libbase",
181 "liblog",
182 ],
183 static_libs: [
184 "libbinder_tls_static",
185 ],
186 srcs: [
187 "RpcTlsTestUtils.cpp",
188 ],
189 export_include_dirs: [
190 "include_tls_test_utils",
191 ],
192 visibility: [
193 ":__subpackages__",
194 ],
195}
196
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700197cc_library_static {
198 name: "libbinder_test_utils",
199 host_supported: true,
200 vendor_available: true,
201 target: {
202 darwin: {
203 enabled: false,
204 },
205 },
206 defaults: [
207 "binder_test_defaults",
208 ],
Tomasz Wasilczykfbfea5b2024-04-30 10:54:23 -0700209 header_libs: [
210 "libbinder_headers_base",
211 ],
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700212 shared_libs: [
213 "libbase",
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700214 ],
215 srcs: [
216 "FileUtils.cpp",
217 ],
218 visibility: [
219 ":__subpackages__",
220 ],
221}
222
Andrei Homescu12106de2022-04-27 04:42:21 +0000223cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000224 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000225 host_supported: true,
226 target: {
227 darwin: {
228 enabled: false,
229 },
230 },
Steven Moreland37aff182021-03-26 02:04:16 +0000231 defaults: [
232 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000233 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000234
Andrei Homescu12106de2022-04-27 04:42:21 +0000235 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700236 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000237 "libbinder_tls_static",
238 "libbinder_tls_test_utils",
239 "binderRpcTestIface-cpp",
240 "binderRpcTestIface-ndk",
241 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000242}
243
244cc_defaults {
245 name: "binderRpcTest_service_defaults",
246 defaults: [
247 "binderRpcTest_common_defaults",
248 ],
249 gtest: false,
250 auto_gen_config: false,
251 srcs: [
252 "binderRpcTestCommon.cpp",
253 "binderRpcTestService.cpp",
254 ],
255}
256
257cc_defaults {
258 name: "binderRpcTest_defaults",
259 target: {
260 android: {
261 test_suites: ["vts"],
262 },
263 },
264 defaults: [
265 "binderRpcTest_common_defaults",
266 ],
267
268 srcs: [
269 "binderRpcTest.cpp",
270 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000271 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000272 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000273
Steven Moreland20531612023-04-04 18:03:24 +0000274 // This test uses a lot of resources and takes a long time. Due to
275 // design of several tests, it is also very sensitive to resource
276 // contention on the device. b/276820894
277 test_options: {
278 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000279 test_runner_options: [
280 {
281 name: "native-test-timeout",
282 value: "10m",
283 },
284 ],
Steven Moreland20531612023-04-04 18:03:24 +0000285 },
286
Andrei Homescu12106de2022-04-27 04:42:21 +0000287 test_suites: ["general-tests"],
288 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000289
290 data_bins: [
291 "binder_rpc_test_service",
292 "binder_rpc_test_service_no_kernel",
293 "binder_rpc_test_service_single_threaded",
294 "binder_rpc_test_service_single_threaded_no_kernel",
295 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000296}
297
Andrei Homescu2a298012022-06-15 01:08:54 +0000298cc_defaults {
299 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000300 cflags: [
301 "-DBINDER_WITH_KERNEL_IPC",
302 ],
303
Steven Moreland5553ac42020-11-11 02:14:45 +0000304 shared_libs: [
305 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000306 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000307 "libbase",
308 "libutils",
309 "libcutils",
310 "liblog",
311 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000312}
313
314cc_defaults {
315 name: "binderRpcTest_static_defaults",
316
317 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000318 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000319 "libutils",
320 // libcrypto_static is not visible to this module
321 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000322 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000323 static_libs: [
324 "libbase",
325 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000326 "libssl",
327 ],
328
329 cflags: [
330 // Disable tests that require shared libraries,
331 // e.g., libbinder.so or libbinder_ndk.so
332 "-DBINDER_TEST_NO_SHARED_LIBS",
333 ],
334}
335
336cc_test {
Andrei Homescu2a298012022-06-15 01:08:54 +0000337 // The module name cannot start with "binderRpcTest" because
338 // then atest tries to execute it as part of binderRpcTest
339 name: "binder_rpc_test_service",
340 defaults: [
341 "binderRpcTest_service_defaults",
342 "binderRpcTest_shared_defaults",
343 "libbinder_tls_shared_deps",
344 ],
345}
346
347cc_test {
348 name: "binder_rpc_test_service_no_kernel",
349 defaults: [
350 "binderRpcTest_service_defaults",
351 "binderRpcTest_static_defaults",
352 ],
353 static_libs: [
354 "libbinder_rpc_no_kernel",
355 ],
356}
357
358cc_test {
359 name: "binder_rpc_test_service_single_threaded",
360 defaults: [
361 "binderRpcTest_service_defaults",
362 "binderRpcTest_static_defaults",
363 ],
364 cflags: [
365 "-DBINDER_RPC_SINGLE_THREADED",
366 "-DBINDER_WITH_KERNEL_IPC",
367 ],
368 static_libs: [
369 "libbinder_rpc_single_threaded",
370 ],
371}
372
373cc_test {
374 name: "binder_rpc_test_service_single_threaded_no_kernel",
375 defaults: [
376 "binderRpcTest_service_defaults",
377 "binderRpcTest_static_defaults",
378 ],
379 cflags: [
380 "-DBINDER_RPC_SINGLE_THREADED",
381 ],
382 static_libs: [
383 "libbinder_rpc_single_threaded_no_kernel",
384 ],
385}
386
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000387cc_binary {
388 name: "binderRpcTestService_on_trusty_mock",
389 defaults: [
390 "trusty_mock_defaults",
391 ],
392
393 srcs: [
394 "binderRpcTestCommon.cpp",
395 "binderRpcTestServiceTrusty.cpp",
396 ],
397
398 shared_libs: [
399 "libbinder_on_trusty_mock",
400 "libbase",
401 "libutils",
402 "libcutils",
403 ],
404
405 static_libs: [
406 "binderRpcTestIface-cpp",
407 ],
408}
409
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000410cc_binary {
411 name: "binderRpcTest_on_trusty_mock",
412 defaults: [
413 "trusty_mock_defaults",
414 ],
415
416 srcs: [
417 "binderRpcUniversalTests.cpp",
418 "binderRpcTestCommon.cpp",
419 "binderRpcTestTrusty.cpp",
420 ],
421
422 shared_libs: [
423 "libbinder_on_trusty_mock",
424 "libbase",
425 "libutils",
426 "libcutils",
427 ],
428
429 static_libs: [
430 "binderRpcTestIface-cpp",
431 "libgtest",
432 ],
433}
434
Andrei Homescu2a298012022-06-15 01:08:54 +0000435cc_test {
436 name: "binderRpcTest",
437 defaults: [
438 "binderRpcTest_defaults",
439 "binderRpcTest_shared_defaults",
440 "libbinder_tls_shared_deps",
441 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000442
443 // Add the Trusty mock library as a fake dependency so it gets built
444 required: [
445 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000446 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000447 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000448 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000449 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000450 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000451}
452
453cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000454 name: "binderRpcTestNoKernel",
455 defaults: [
456 "binderRpcTest_defaults",
457 "binderRpcTest_static_defaults",
458 ],
459 static_libs: [
460 "libbinder_rpc_no_kernel",
461 ],
462}
463
464cc_test {
Tomasz Wasilczyk2265ad92024-05-01 12:54:46 -0700465 name: "binderRpcTestNoKernelAtAll",
466 defaults: [
467 "binderRpcTest_defaults",
468 "binderRpcTest_static_defaults",
469 ],
470 static_libs: [
471 "libbinder_rpc_no_kernel",
472 ],
473 cflags: [
474 "-DBINDER_NO_KERNEL_IPC_TESTING",
475 ],
476}
477
478cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000479 name: "binderRpcTestSingleThreaded",
480 defaults: [
481 "binderRpcTest_defaults",
482 "binderRpcTest_static_defaults",
483 ],
484 cflags: [
485 "-DBINDER_RPC_SINGLE_THREADED",
486 "-DBINDER_WITH_KERNEL_IPC",
487 ],
488 static_libs: [
489 "libbinder_rpc_single_threaded",
490 ],
491}
492
493cc_test {
494 name: "binderRpcTestSingleThreadedNoKernel",
495 defaults: [
496 "binderRpcTest_defaults",
497 "binderRpcTest_static_defaults",
498 ],
499 cflags: [
500 "-DBINDER_RPC_SINGLE_THREADED",
501 ],
502 static_libs: [
503 "libbinder_rpc_single_threaded_no_kernel",
504 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000505}
506
Yifan Hongff73aa92021-09-17 21:28:01 -0700507cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000508 name: "binderRpcToTrustyTest",
509 vendor: true,
510 host_supported: false,
511 defaults: [
512 "binderRpcTest_common_defaults",
513 "binderRpcTest_static_defaults",
514 ],
515
516 srcs: [
517 "binderRpcTest.cpp",
518 "binderRpcTestCommon.cpp",
519 "binderRpcUniversalTests.cpp",
520 ],
521
522 cflags: [
523 "-DBINDER_RPC_TO_TRUSTY_TEST",
524 ],
525
526 static_libs: [
527 // We want to link libbinder statically so we can push the binary
528 // to the device for testing independently of the library
529 "libbinder_rpc_no_kernel",
530 "libbinder_trusty",
531 "libtrusty",
532 ],
533
534 test_suites: ["device-tests"],
535 require_root: true,
536}
537
538cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700539 name: "RpcTlsUtilsTest",
540 host_supported: true,
541 target: {
542 darwin: {
543 enabled: false,
544 },
545 android: {
546 test_suites: ["vts"],
547 },
548 },
549 defaults: [
550 "binder_test_defaults",
551 "libbinder_tls_shared_deps",
552 ],
553 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700554 "RpcTlsUtilsTest.cpp",
555 ],
556 shared_libs: [
557 "libbinder",
558 "libbase",
559 "libutils",
560 "liblog",
561 ],
562 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700563 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700564 "libbinder_tls_static",
565 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000566 test_suites: [
567 "general-tests",
568 "device-tests",
569 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700570}
571
Steven Morelandcda60852021-04-14 23:45:32 +0000572cc_benchmark {
573 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700574 defaults: [
575 "binder_test_defaults",
576 "libbinder_tls_shared_deps",
577 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000578 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000579 target: {
580 darwin: {
581 enabled: false,
582 },
583 },
Steven Morelandcda60852021-04-14 23:45:32 +0000584 srcs: [
585 "binderRpcBenchmark.cpp",
586 "IBinderRpcBenchmark.aidl",
587 ],
588 shared_libs: [
589 "libbase",
590 "libbinder",
591 "liblog",
592 "libutils",
593 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700594 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700595 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700596 "libbinder_tls_static",
597 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000598}
599
Steven Moreland5553ac42020-11-11 02:14:45 +0000600cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700601 name: "binderRpcWireProtocolTest",
602 host_supported: true,
603 target: {
604 darwin: {
605 enabled: false,
606 },
607 android: {
608 test_suites: ["vts"],
609 },
610 },
611 defaults: [
612 "binder_test_defaults",
613 ],
614 srcs: [
615 "binderRpcWireProtocolTest.cpp",
616 ],
617 shared_libs: [
618 "libbinder",
619 "libbase",
620 "libutils",
621 "libcutils",
622 "liblog",
623 ],
624 test_suites: ["general-tests"],
625}
626
627cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700628 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700629 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700630 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700631 shared_libs: [
632 "libbinder",
633 "libutils",
634 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700635 cflags: [
636 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700637 "-Wno-missing-field-initializers",
638 "-Wno-sign-compare",
639 "-O3",
640 ],
641}
Wei Wang78f2a372016-10-20 23:18:17 -0700642
643cc_test {
644 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700645 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700646 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700647 shared_libs: [
648 "libbinder",
649 "libutils",
650 "libbase",
651 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700652 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700653}
Howard Chenc135dbc2017-03-25 17:12:59 +0800654
655cc_test {
656 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700657 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700658 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800659 shared_libs: [
660 "libbinder",
661 "libutils",
662 "libbase",
663 ],
664}
Dan Stozad630e522016-12-01 15:16:31 -0800665
666cc_test {
667 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700668 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700669 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800670
671 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800672 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800673 ],
674
675 cpp_std: "experimental",
676 gnu_extensions: false,
677
678 shared_libs: [
679 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700680 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800681 "liblog",
682 "libutils",
683 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000684 test_suites: [
685 "device-tests",
686 "vts",
687 ],
Dan Shi80ada592019-09-13 09:17:17 -0700688 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800689}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700690
Steven Morelandf23dae22020-10-27 19:34:55 +0000691cc_test {
692 name: "binderClearBufTest",
693 defaults: ["binder_test_defaults"],
694 srcs: [
695 "binderClearBufTest.cpp",
696 ],
697
698 shared_libs: [
699 "libbase",
700 "libbinder",
701 "liblog",
702 "libutils",
703 ],
704
705 test_suites: ["general-tests"],
706 require_root: true,
707}
708
Steven Moreland12300a02019-08-02 13:27:15 -0700709aidl_interface {
710 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900711 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700712 srcs: [
713 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700714 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000715 backend: {
716 java: {
717 enabled: false,
718 },
719 },
Steven Moreland12300a02019-08-02 13:27:15 -0700720}
721
Steven Morelanddea3cf92019-07-16 18:06:55 -0700722cc_test {
723 name: "binderStabilityTest",
724 defaults: ["binder_test_defaults"],
725 srcs: [
726 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700727 ],
728
Steven Moreland13f84662020-07-23 21:30:41 +0000729 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700730 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700731 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700732 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700733 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700734 "libutils",
735 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700736 static_libs: [
737 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900738 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700739 ],
740
Steven Morelandea7659e2022-02-03 00:04:06 +0000741 test_suites: [
742 "device-tests",
743 "vts",
744 ],
Dan Shi302709b2019-09-19 15:28:15 -0700745 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700746}
Steven Moreland042ae822020-05-27 17:45:17 +0000747
748cc_test {
749 name: "binderAllocationLimits",
750 defaults: ["binder_test_defaults"],
751 srcs: ["binderAllocationLimits.cpp"],
752 shared_libs: [
753 "libbinder",
754 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000755 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000756 "libutils",
757 "libutilscallstack",
758 "libbase",
759 ],
760 test_suites: ["device-tests"],
761 require_root: true,
762}
Andy Hung73a14702020-11-24 13:04:46 -0800763
764cc_benchmark {
765 name: "binderParcelBenchmark",
766 defaults: ["binder_test_defaults"],
767 srcs: ["binderParcelBenchmark.cpp"],
768 shared_libs: [
769 "libbase",
770 "libbinder",
771 "liblog",
772 "libutils",
773 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000774 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800775}
Yifan Hongaf766e62021-06-14 13:24:19 -0700776
777cc_test_host {
778 name: "binderUtilsHostTest",
779 defaults: ["binder_test_defaults"],
780 srcs: ["binderUtilsHostTest.cpp"],
781 shared_libs: [
782 "libbase",
783 "libbinder",
784 ],
785 static_libs: [
786 "libgmock",
787 ],
788 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700789 target: {
790 darwin: {
791 enabled: false,
792 },
793 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700794}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700795
796cc_test_host {
797 name: "binderHostDeviceTest",
798 defaults: ["binder_test_defaults"],
799 srcs: ["binderHostDeviceTest.cpp"],
800 test_config: "binderHostDeviceTest.xml",
801 shared_libs: [
802 "libbase",
803 "libbinder",
804 "liblog",
805 "libutils",
806 ],
807 static_libs: [
808 "libgmock",
809 ],
810 target_required: [
811 "binderHostDeviceTestService",
812 ],
813 test_suites: ["general-tests"],
814 target: {
815 darwin: {
816 enabled: false,
817 },
818 },
819 test_options: {
820 unit_test: false,
821 },
822}
823
824cc_test {
825 name: "binderHostDeviceTestService",
826 // The binary is named differently from the module so that PushFilePreparer pushes the binary
827 // directly, not the test module directory.
828 stem: "binderHostDeviceTest-service",
829 defaults: ["binder_test_defaults"],
830 gtest: false,
831 auto_gen_config: false,
832 srcs: ["binderHostDeviceTestService.cpp"],
833 shared_libs: [
834 "libbase",
835 "libbinder",
836 "liblog",
837 "libutils",
838 ],
839 test_suites: ["general-tests"],
840}
Pawanf00fabb2022-08-04 17:56:18 +0000841
842cc_defaults {
843 name: "service_fuzzer_defaults",
844 static_libs: [
845 "libbase",
846 "libbinder_random_parcel",
847 "libcutils",
848 ],
849 target: {
850 android: {
851 shared_libs: [
852 "libbinder_ndk",
853 "libbinder",
854 "libutils",
855 ],
856 },
857 host: {
858 static_libs: [
859 "libbinder_ndk",
860 "libbinder",
861 "libutils",
862 ],
863 },
864 darwin: {
865 enabled: false,
866 },
867 },
868 fuzz_config: {
869 cc: [
870 "smoreland@google.com",
871 "waghpawan@google.com",
872 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000873 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
874 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000875 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000876 },
877}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000878
879cc_defaults {
880 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000881 fuzz_config: {
882 asan_options: [
883 "detect_leaks=0",
884 ],
885 hwasan_options: [
886 "detect_leaks=0",
887 ],
888 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000889}