blob: 642fbf3b562c718208840431cdc30ac82b1288d4 [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",
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -070028 cmake_snapshot_supported: true,
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070029 cflags: [
30 "-Wall",
31 "-Werror",
Tomasz Wasilczyke97f3a82024-04-30 10:37:32 -070032 "-Wformat",
33 "-Wpessimizing-move",
34 "-Wsign-compare",
35 "-Wunused-result",
36 "-Wzero-as-null-pointer-constant",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070037 ],
38}
39
Dan Willemsen59e086f2016-07-25 17:13:45 -070040cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070041 name: "binderDriverInterfaceTest",
42 defaults: ["binder_test_defaults"],
Yifan Hong4e419d82021-04-26 11:32:56 -070043 header_libs: ["libbinder_headers"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070044 srcs: ["binderDriverInterfaceTest.cpp"],
Yu-Ting Tsengd5fc4462024-04-30 15:07:13 -070045 shared_libs: [
46 "libbinder",
47 ],
Steven Morelandea7659e2022-02-03 00:04:06 +000048 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +000049 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +000050 "vts",
51 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070052}
53
Parth Saneb6ed0eb2024-06-25 14:38:42 +000054cc_test {
55 name: "binderCacheUnitTest",
56 target: {
57 darwin: {
58 enabled: false,
59 },
60 },
61 srcs: [
62 "binderCacheUnitTest.cpp",
63 ],
64 shared_libs: [
65 "liblog",
66 "libbinder",
67 "libcutils",
68 "libutils",
69 ],
70 static_libs: [
71 "libfakeservicemanager",
72 ],
Parth Sanedc207542024-11-14 11:49:08 +000073 defaults: [
74 "libbinder_client_cache_flag",
75 "libbinder_addservice_cache_flag",
76 ],
Parth Saneb6ed0eb2024-06-25 14:38:42 +000077 test_suites: ["general-tests"],
78 require_root: true,
79}
80
Steven Morelandcefba612020-11-05 22:57:06 +000081// unit test only, which can run on host and doesn't use /dev/binder
82cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000083 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000084 host_supported: true,
85 target: {
86 darwin: {
87 enabled: false,
88 },
89 },
Steven Morelandea7659e2022-02-03 00:04:06 +000090 srcs: [
91 "binderParcelUnitTest.cpp",
92 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +000093 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -050094 "binderMemoryHeapBaseUnitTest.cpp",
Fabián Cañas08bdc772023-01-02 15:02:56 -050095 "binderRecordedTransactionTest.cpp",
Abhishek Gadewar76f00822024-05-09 17:02:18 -070096 "binderPersistableBundleTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +000097 ],
Steven Morelandcefba612020-11-05 22:57:06 +000098 shared_libs: [
99 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -0700100 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +0000101 "libutils",
102 ],
103 test_suites: ["general-tests"],
104}
105
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800106cc_test {
Steven Morelanda8244b92023-04-20 23:34:11 +0000107 name: "binderRecordReplayTest",
108 srcs: ["binderRecordReplayTest.cpp"],
Pawan Wagh76b18152023-12-01 14:30:26 +0000109 cflags: [
110 "-DBINDER_WITH_KERNEL_IPC",
111 ],
Steven Morelanda8244b92023-04-20 23:34:11 +0000112 shared_libs: [
113 "libbinder",
114 "libcutils",
115 "libutils",
Pawan Wagh76b18152023-12-01 14:30:26 +0000116 "liblog",
Steven Morelanda8244b92023-04-20 23:34:11 +0000117 ],
118 static_libs: [
119 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +0000120 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +0000121 "libbinder_random_parcel_seeds",
122 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +0000123 ],
124 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +0000125 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +0000126}
127
128aidl_interface {
129 name: "binderRecordReplayTestIface",
130 unstable: true,
131 srcs: [
132 "IBinderRecordReplayTest.aidl",
133 ],
Pawan Wagh8da45382023-05-11 08:08:50 +0000134 imports: ["binderReadParcelIface"],
135 backend: {
136 java: {
137 enabled: true,
138 platform_apis: true,
139 },
Steven Moreland59813352024-02-08 23:52:11 +0000140
141 // TODO: switch from FileDescriptor to ParcelFileDescriptor
Pawan Wagh76b18152023-12-01 14:30:26 +0000142 ndk: {
143 enabled: false,
144 },
Steven Moreland59813352024-02-08 23:52:11 +0000145 rust: {
146 enabled: false,
147 },
Pawan Wagh8da45382023-05-11 08:08:50 +0000148 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000149}
150
151cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700152 name: "binderLibTest",
153 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800154
Dan Willemsen59e086f2016-07-25 17:13:45 -0700155 srcs: ["binderLibTest.cpp"],
156 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700157 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700158 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700159 "liblog",
Yu-Ting Tsengd5fc4462024-04-30 15:07:13 -0700160 "libprocessgroup",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700161 "libutils",
162 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700163 static_libs: [
164 "libgmock",
165 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000166 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000167 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000168 "vts",
169 ],
Dan Shi80ada592019-09-13 09:17:17 -0700170 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700171}
172
Steven Moreland37aff182021-03-26 02:04:16 +0000173aidl_interface {
174 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000175 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000176 host_supported: true,
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700177 cmake_snapshot_supported: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000178 unstable: true,
179 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700180 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000181 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700182 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000183 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000184 "IBinderRpcSession.aidl",
185 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700186 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000187 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800188 flags: [
189 "-Werror",
190 "-Wno-mixed-oneway",
191 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000192 backend: {
193 java: {
194 enabled: false,
195 },
196 },
197}
198
Yifan Honge0e53282021-09-23 18:37:21 -0700199cc_library_static {
200 name: "libbinder_tls_test_utils",
201 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000202 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700203 target: {
204 darwin: {
205 enabled: false,
206 },
207 },
208 defaults: [
209 "binder_test_defaults",
210 "libbinder_tls_shared_deps",
211 ],
212 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700213 "libbase",
214 "liblog",
215 ],
216 static_libs: [
217 "libbinder_tls_static",
218 ],
219 srcs: [
220 "RpcTlsTestUtils.cpp",
221 ],
222 export_include_dirs: [
223 "include_tls_test_utils",
224 ],
225 visibility: [
226 ":__subpackages__",
227 ],
228}
229
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700230cc_library_static {
231 name: "libbinder_test_utils",
232 host_supported: true,
233 vendor_available: true,
234 target: {
235 darwin: {
236 enabled: false,
237 },
238 },
239 defaults: [
240 "binder_test_defaults",
241 ],
Tomasz Wasilczykfbfea5b2024-04-30 10:54:23 -0700242 header_libs: [
243 "libbinder_headers_base",
244 ],
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700245 shared_libs: [
246 "libbase",
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700247 ],
248 srcs: [
249 "FileUtils.cpp",
250 ],
251 visibility: [
252 ":__subpackages__",
253 ],
254}
255
Andrei Homescu12106de2022-04-27 04:42:21 +0000256cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000257 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000258 host_supported: true,
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700259 cmake_snapshot_supported: true,
Steven Morelandf6ec4632021-04-01 16:20:47 +0000260 target: {
261 darwin: {
262 enabled: false,
263 },
264 },
Steven Moreland37aff182021-03-26 02:04:16 +0000265 defaults: [
266 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000267 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000268
Devin Moore1df9c5f2024-07-23 22:09:29 +0000269 compile_multilib: "both",
270 multilib: {
271 lib32: {
272 suffix: "32",
273 },
274 lib64: {
275 suffix: "64",
276 },
277 },
278
Andrei Homescu12106de2022-04-27 04:42:21 +0000279 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700280 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000281 "libbinder_tls_static",
282 "libbinder_tls_test_utils",
283 "binderRpcTestIface-cpp",
284 "binderRpcTestIface-ndk",
285 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000286}
287
288cc_defaults {
289 name: "binderRpcTest_service_defaults",
290 defaults: [
291 "binderRpcTest_common_defaults",
292 ],
293 gtest: false,
294 auto_gen_config: false,
295 srcs: [
296 "binderRpcTestCommon.cpp",
297 "binderRpcTestService.cpp",
298 ],
299}
300
301cc_defaults {
302 name: "binderRpcTest_defaults",
303 target: {
304 android: {
305 test_suites: ["vts"],
306 },
307 },
308 defaults: [
309 "binderRpcTest_common_defaults",
310 ],
311
312 srcs: [
313 "binderRpcTest.cpp",
314 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000315 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000316 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000317
Steven Moreland20531612023-04-04 18:03:24 +0000318 // This test uses a lot of resources and takes a long time. Due to
319 // design of several tests, it is also very sensitive to resource
320 // contention on the device. b/276820894
321 test_options: {
322 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000323 test_runner_options: [
324 {
325 name: "native-test-timeout",
326 value: "10m",
327 },
328 ],
Steven Moreland20531612023-04-04 18:03:24 +0000329 },
330
Andrei Homescu12106de2022-04-27 04:42:21 +0000331 test_suites: ["general-tests"],
332 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000333
334 data_bins: [
335 "binder_rpc_test_service",
336 "binder_rpc_test_service_no_kernel",
337 "binder_rpc_test_service_single_threaded",
338 "binder_rpc_test_service_single_threaded_no_kernel",
339 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000340}
341
Andrei Homescu2a298012022-06-15 01:08:54 +0000342cc_defaults {
343 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000344 cflags: [
345 "-DBINDER_WITH_KERNEL_IPC",
346 ],
347
Steven Moreland5553ac42020-11-11 02:14:45 +0000348 shared_libs: [
349 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000350 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000351 "libbase",
352 "libutils",
353 "libcutils",
354 "liblog",
355 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000356}
357
358cc_defaults {
359 name: "binderRpcTest_static_defaults",
360
361 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000362 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000363 "libutils",
364 // libcrypto_static is not visible to this module
365 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000366 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000367 static_libs: [
368 "libbase",
369 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000370 "libssl",
371 ],
372
373 cflags: [
374 // Disable tests that require shared libraries,
375 // e.g., libbinder.so or libbinder_ndk.so
376 "-DBINDER_TEST_NO_SHARED_LIBS",
377 ],
378}
379
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700380cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000381 // The module name cannot start with "binderRpcTest" because
382 // then atest tries to execute it as part of binderRpcTest
383 name: "binder_rpc_test_service",
384 defaults: [
385 "binderRpcTest_service_defaults",
386 "binderRpcTest_shared_defaults",
387 "libbinder_tls_shared_deps",
388 ],
389}
390
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700391cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000392 name: "binder_rpc_test_service_no_kernel",
393 defaults: [
394 "binderRpcTest_service_defaults",
395 "binderRpcTest_static_defaults",
396 ],
397 static_libs: [
398 "libbinder_rpc_no_kernel",
399 ],
400}
401
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700402cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000403 name: "binder_rpc_test_service_single_threaded",
404 defaults: [
405 "binderRpcTest_service_defaults",
406 "binderRpcTest_static_defaults",
407 ],
408 cflags: [
409 "-DBINDER_RPC_SINGLE_THREADED",
410 "-DBINDER_WITH_KERNEL_IPC",
411 ],
412 static_libs: [
413 "libbinder_rpc_single_threaded",
414 ],
415}
416
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700417cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000418 name: "binder_rpc_test_service_single_threaded_no_kernel",
419 defaults: [
420 "binderRpcTest_service_defaults",
421 "binderRpcTest_static_defaults",
422 ],
423 cflags: [
424 "-DBINDER_RPC_SINGLE_THREADED",
425 ],
426 static_libs: [
427 "libbinder_rpc_single_threaded_no_kernel",
428 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700429 shared_libs: [
430 "libbinder_ndk",
431 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000432}
433
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000434cc_binary {
435 name: "binderRpcTestService_on_trusty_mock",
436 defaults: [
437 "trusty_mock_defaults",
438 ],
439
440 srcs: [
441 "binderRpcTestCommon.cpp",
442 "binderRpcTestServiceTrusty.cpp",
443 ],
444
445 shared_libs: [
446 "libbinder_on_trusty_mock",
447 "libbase",
448 "libutils",
449 "libcutils",
450 ],
451
452 static_libs: [
453 "binderRpcTestIface-cpp",
454 ],
455}
456
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000457cc_binary {
458 name: "binderRpcTest_on_trusty_mock",
459 defaults: [
460 "trusty_mock_defaults",
461 ],
462
463 srcs: [
464 "binderRpcUniversalTests.cpp",
465 "binderRpcTestCommon.cpp",
466 "binderRpcTestTrusty.cpp",
467 ],
468
469 shared_libs: [
470 "libbinder_on_trusty_mock",
471 "libbase",
472 "libutils",
473 "libcutils",
474 ],
475
476 static_libs: [
477 "binderRpcTestIface-cpp",
478 "libgtest",
479 ],
480}
481
Andrei Homescu2a298012022-06-15 01:08:54 +0000482cc_test {
483 name: "binderRpcTest",
484 defaults: [
485 "binderRpcTest_defaults",
486 "binderRpcTest_shared_defaults",
487 "libbinder_tls_shared_deps",
488 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000489
490 // Add the Trusty mock library as a fake dependency so it gets built
491 required: [
492 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000493 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000494 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000495 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000496 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000497 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000498}
499
500cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000501 name: "binderRpcTestNoKernel",
502 defaults: [
503 "binderRpcTest_defaults",
504 "binderRpcTest_static_defaults",
505 ],
506 static_libs: [
507 "libbinder_rpc_no_kernel",
508 ],
509}
510
511cc_test {
Tomasz Wasilczyk2265ad92024-05-01 12:54:46 -0700512 name: "binderRpcTestNoKernelAtAll",
513 defaults: [
514 "binderRpcTest_defaults",
515 "binderRpcTest_static_defaults",
516 ],
517 static_libs: [
518 "libbinder_rpc_no_kernel",
519 ],
520 cflags: [
521 "-DBINDER_NO_KERNEL_IPC_TESTING",
522 ],
523}
524
525cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000526 name: "binderRpcTestSingleThreaded",
527 defaults: [
528 "binderRpcTest_defaults",
529 "binderRpcTest_static_defaults",
530 ],
531 cflags: [
532 "-DBINDER_RPC_SINGLE_THREADED",
533 "-DBINDER_WITH_KERNEL_IPC",
534 ],
535 static_libs: [
536 "libbinder_rpc_single_threaded",
537 ],
Devin Moorec370db42024-08-09 23:18:05 +0000538 shared_libs: [
539 "libbinder_ndk",
540 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000541}
542
543cc_test {
544 name: "binderRpcTestSingleThreadedNoKernel",
545 defaults: [
546 "binderRpcTest_defaults",
547 "binderRpcTest_static_defaults",
548 ],
549 cflags: [
550 "-DBINDER_RPC_SINGLE_THREADED",
551 ],
552 static_libs: [
553 "libbinder_rpc_single_threaded_no_kernel",
554 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700555 shared_libs: [
556 "libbinder_ndk",
557 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000558}
559
Yifan Hongff73aa92021-09-17 21:28:01 -0700560cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000561 name: "binderRpcToTrustyTest",
562 vendor: true,
563 host_supported: false,
564 defaults: [
565 "binderRpcTest_common_defaults",
566 "binderRpcTest_static_defaults",
567 ],
568
569 srcs: [
570 "binderRpcTest.cpp",
571 "binderRpcTestCommon.cpp",
572 "binderRpcUniversalTests.cpp",
573 ],
574
575 cflags: [
576 "-DBINDER_RPC_TO_TRUSTY_TEST",
577 ],
578
579 static_libs: [
580 // We want to link libbinder statically so we can push the binary
581 // to the device for testing independently of the library
582 "libbinder_rpc_no_kernel",
583 "libbinder_trusty",
584 "libtrusty",
585 ],
586
587 test_suites: ["device-tests"],
588 require_root: true,
589}
590
591cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700592 name: "RpcTlsUtilsTest",
593 host_supported: true,
594 target: {
595 darwin: {
596 enabled: false,
597 },
598 android: {
599 test_suites: ["vts"],
600 },
601 },
602 defaults: [
603 "binder_test_defaults",
604 "libbinder_tls_shared_deps",
605 ],
606 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700607 "RpcTlsUtilsTest.cpp",
608 ],
609 shared_libs: [
610 "libbinder",
611 "libbase",
612 "libutils",
613 "liblog",
614 ],
615 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700616 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700617 "libbinder_tls_static",
618 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000619 test_suites: [
620 "general-tests",
621 "device-tests",
622 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700623}
624
Steven Morelandcda60852021-04-14 23:45:32 +0000625cc_benchmark {
626 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700627 defaults: [
628 "binder_test_defaults",
629 "libbinder_tls_shared_deps",
630 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000631 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000632 target: {
633 darwin: {
634 enabled: false,
635 },
636 },
Steven Morelandcda60852021-04-14 23:45:32 +0000637 srcs: [
638 "binderRpcBenchmark.cpp",
639 "IBinderRpcBenchmark.aidl",
640 ],
641 shared_libs: [
642 "libbase",
643 "libbinder",
644 "liblog",
645 "libutils",
646 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700647 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700648 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700649 "libbinder_tls_static",
650 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000651}
652
Steven Moreland5553ac42020-11-11 02:14:45 +0000653cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700654 name: "binderRpcWireProtocolTest",
655 host_supported: true,
656 target: {
657 darwin: {
658 enabled: false,
659 },
660 android: {
661 test_suites: ["vts"],
662 },
663 },
664 defaults: [
665 "binder_test_defaults",
666 ],
667 srcs: [
668 "binderRpcWireProtocolTest.cpp",
669 ],
670 shared_libs: [
671 "libbinder",
672 "libbase",
673 "libutils",
674 "libcutils",
675 "liblog",
676 ],
677 test_suites: ["general-tests"],
678}
679
680cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700681 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700682 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700683 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700684 shared_libs: [
685 "libbinder",
686 "libutils",
687 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700688 cflags: [
689 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700690 "-Wno-missing-field-initializers",
691 "-Wno-sign-compare",
692 "-O3",
693 ],
694}
Wei Wang78f2a372016-10-20 23:18:17 -0700695
696cc_test {
697 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700698 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700699 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700700 shared_libs: [
701 "libbinder",
702 "libutils",
703 "libbase",
704 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700705 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700706}
Howard Chenc135dbc2017-03-25 17:12:59 +0800707
708cc_test {
709 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700710 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700711 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800712 shared_libs: [
713 "libbinder",
714 "libutils",
715 "libbase",
716 ],
717}
Dan Stozad630e522016-12-01 15:16:31 -0800718
719cc_test {
720 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700721 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700722 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800723
724 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800725 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800726 ],
727
728 cpp_std: "experimental",
729 gnu_extensions: false,
730
731 shared_libs: [
732 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700733 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800734 "liblog",
735 "libutils",
736 ],
Jim Shargo7693c4a2024-10-11 02:28:18 +0000737 static_libs: [
738 "libgmock",
739 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000740 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000741 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000742 "vts",
743 ],
Dan Shi80ada592019-09-13 09:17:17 -0700744 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800745}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700746
Steven Morelandf23dae22020-10-27 19:34:55 +0000747cc_test {
748 name: "binderClearBufTest",
749 defaults: ["binder_test_defaults"],
750 srcs: [
751 "binderClearBufTest.cpp",
752 ],
753
754 shared_libs: [
755 "libbase",
756 "libbinder",
757 "liblog",
758 "libutils",
759 ],
760
761 test_suites: ["general-tests"],
762 require_root: true,
763}
764
Steven Moreland12300a02019-08-02 13:27:15 -0700765aidl_interface {
766 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900767 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700768 srcs: [
769 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700770 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000771 backend: {
772 java: {
773 enabled: false,
774 },
775 },
Steven Moreland12300a02019-08-02 13:27:15 -0700776}
777
Steven Morelanddea3cf92019-07-16 18:06:55 -0700778cc_test {
779 name: "binderStabilityTest",
780 defaults: ["binder_test_defaults"],
781 srcs: [
782 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700783 ],
784
Steven Moreland13f84662020-07-23 21:30:41 +0000785 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700786 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700787 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700788 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700789 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700790 "libutils",
791 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700792 static_libs: [
793 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900794 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700795 ],
796
Steven Morelandea7659e2022-02-03 00:04:06 +0000797 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000798 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000799 "vts",
800 ],
Dan Shi302709b2019-09-19 15:28:15 -0700801 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700802}
Steven Moreland042ae822020-05-27 17:45:17 +0000803
804cc_test {
805 name: "binderAllocationLimits",
806 defaults: ["binder_test_defaults"],
807 srcs: ["binderAllocationLimits.cpp"],
808 shared_libs: [
809 "libbinder",
810 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000811 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000812 "libutils",
813 "libutilscallstack",
814 "libbase",
815 ],
816 test_suites: ["device-tests"],
817 require_root: true,
818}
Andy Hung73a14702020-11-24 13:04:46 -0800819
820cc_benchmark {
821 name: "binderParcelBenchmark",
822 defaults: ["binder_test_defaults"],
823 srcs: ["binderParcelBenchmark.cpp"],
824 shared_libs: [
825 "libbase",
826 "libbinder",
827 "liblog",
828 "libutils",
829 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000830 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800831}
Yifan Hongaf766e62021-06-14 13:24:19 -0700832
833cc_test_host {
834 name: "binderUtilsHostTest",
835 defaults: ["binder_test_defaults"],
836 srcs: ["binderUtilsHostTest.cpp"],
837 shared_libs: [
838 "libbase",
839 "libbinder",
840 ],
841 static_libs: [
842 "libgmock",
843 ],
844 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700845 target: {
846 darwin: {
847 enabled: false,
848 },
849 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700850}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700851
852cc_test_host {
853 name: "binderHostDeviceTest",
854 defaults: ["binder_test_defaults"],
855 srcs: ["binderHostDeviceTest.cpp"],
856 test_config: "binderHostDeviceTest.xml",
857 shared_libs: [
858 "libbase",
859 "libbinder",
860 "liblog",
861 "libutils",
862 ],
863 static_libs: [
864 "libgmock",
865 ],
866 target_required: [
867 "binderHostDeviceTestService",
868 ],
869 test_suites: ["general-tests"],
870 target: {
871 darwin: {
872 enabled: false,
873 },
874 },
875 test_options: {
876 unit_test: false,
877 },
878}
879
880cc_test {
881 name: "binderHostDeviceTestService",
882 // The binary is named differently from the module so that PushFilePreparer pushes the binary
883 // directly, not the test module directory.
884 stem: "binderHostDeviceTest-service",
885 defaults: ["binder_test_defaults"],
886 gtest: false,
887 auto_gen_config: false,
888 srcs: ["binderHostDeviceTestService.cpp"],
889 shared_libs: [
890 "libbase",
891 "libbinder",
892 "liblog",
893 "libutils",
894 ],
895 test_suites: ["general-tests"],
896}
Pawanf00fabb2022-08-04 17:56:18 +0000897
898cc_defaults {
899 name: "service_fuzzer_defaults",
900 static_libs: [
901 "libbase",
902 "libbinder_random_parcel",
903 "libcutils",
904 ],
905 target: {
906 android: {
907 shared_libs: [
908 "libbinder_ndk",
909 "libbinder",
910 "libutils",
911 ],
912 },
913 host: {
914 static_libs: [
915 "libbinder_ndk",
916 "libbinder",
917 "libutils",
918 ],
919 },
920 darwin: {
921 enabled: false,
922 },
923 },
Pawan Wagh6cee6bd2024-08-28 22:16:56 +0000924 corpus: ["corpus/*"],
Pawanf00fabb2022-08-04 17:56:18 +0000925 fuzz_config: {
926 cc: [
927 "smoreland@google.com",
928 "waghpawan@google.com",
929 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000930 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
931 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000932 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000933 },
934}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000935
936cc_defaults {
937 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000938 fuzz_config: {
939 asan_options: [
940 "detect_leaks=0",
941 ],
942 hwasan_options: [
943 "detect_leaks=0",
944 ],
945 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000946}