blob: 957871379b0aa9454f919147aa53ffadec412cb7 [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
Steven Morelandcefba612020-11-05 22:57:06 +000054// unit test only, which can run on host and doesn't use /dev/binder
55cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000056 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000057 host_supported: true,
58 target: {
59 darwin: {
60 enabled: false,
61 },
62 },
Steven Morelandea7659e2022-02-03 00:04:06 +000063 srcs: [
64 "binderParcelUnitTest.cpp",
65 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +000066 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -050067 "binderMemoryHeapBaseUnitTest.cpp",
Fabián Cañas08bdc772023-01-02 15:02:56 -050068 "binderRecordedTransactionTest.cpp",
Abhishek Gadewar76f00822024-05-09 17:02:18 -070069 "binderPersistableBundleTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +000070 ],
Steven Morelandcefba612020-11-05 22:57:06 +000071 shared_libs: [
72 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -070073 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +000074 "libutils",
75 ],
76 test_suites: ["general-tests"],
77}
78
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080079cc_test {
Steven Morelanda8244b92023-04-20 23:34:11 +000080 name: "binderRecordReplayTest",
81 srcs: ["binderRecordReplayTest.cpp"],
Pawan Wagh76b18152023-12-01 14:30:26 +000082 cflags: [
83 "-DBINDER_WITH_KERNEL_IPC",
84 ],
Steven Morelanda8244b92023-04-20 23:34:11 +000085 shared_libs: [
86 "libbinder",
87 "libcutils",
88 "libutils",
Pawan Wagh76b18152023-12-01 14:30:26 +000089 "liblog",
Steven Morelanda8244b92023-04-20 23:34:11 +000090 ],
91 static_libs: [
92 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +000093 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +000094 "libbinder_random_parcel_seeds",
95 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +000096 ],
97 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +000098 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +000099}
100
101aidl_interface {
102 name: "binderRecordReplayTestIface",
103 unstable: true,
104 srcs: [
105 "IBinderRecordReplayTest.aidl",
106 ],
Pawan Wagh8da45382023-05-11 08:08:50 +0000107 imports: ["binderReadParcelIface"],
108 backend: {
109 java: {
110 enabled: true,
111 platform_apis: true,
112 },
Steven Moreland59813352024-02-08 23:52:11 +0000113
114 // TODO: switch from FileDescriptor to ParcelFileDescriptor
Pawan Wagh76b18152023-12-01 14:30:26 +0000115 ndk: {
116 enabled: false,
117 },
Steven Moreland59813352024-02-08 23:52:11 +0000118 rust: {
119 enabled: false,
120 },
Pawan Wagh8da45382023-05-11 08:08:50 +0000121 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000122}
123
124cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700125 name: "binderLibTest",
126 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800127
Dan Willemsen59e086f2016-07-25 17:13:45 -0700128 srcs: ["binderLibTest.cpp"],
129 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700130 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700131 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700132 "liblog",
Yu-Ting Tsengd5fc4462024-04-30 15:07:13 -0700133 "libprocessgroup",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700134 "libutils",
135 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700136 static_libs: [
137 "libgmock",
138 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000139 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000140 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000141 "vts",
142 ],
Dan Shi80ada592019-09-13 09:17:17 -0700143 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700144}
145
Steven Moreland37aff182021-03-26 02:04:16 +0000146aidl_interface {
147 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000148 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000149 host_supported: true,
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700150 cmake_snapshot_supported: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000151 unstable: true,
152 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700153 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000154 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700155 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000156 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000157 "IBinderRpcSession.aidl",
158 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700159 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000160 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800161 flags: [
162 "-Werror",
163 "-Wno-mixed-oneway",
164 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000165 backend: {
166 java: {
167 enabled: false,
168 },
169 },
170}
171
Yifan Honge0e53282021-09-23 18:37:21 -0700172cc_library_static {
173 name: "libbinder_tls_test_utils",
174 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000175 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700176 target: {
177 darwin: {
178 enabled: false,
179 },
180 },
181 defaults: [
182 "binder_test_defaults",
183 "libbinder_tls_shared_deps",
184 ],
185 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700186 "libbase",
187 "liblog",
188 ],
189 static_libs: [
190 "libbinder_tls_static",
191 ],
192 srcs: [
193 "RpcTlsTestUtils.cpp",
194 ],
195 export_include_dirs: [
196 "include_tls_test_utils",
197 ],
198 visibility: [
199 ":__subpackages__",
200 ],
201}
202
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700203cc_library_static {
204 name: "libbinder_test_utils",
205 host_supported: true,
206 vendor_available: true,
207 target: {
208 darwin: {
209 enabled: false,
210 },
211 },
212 defaults: [
213 "binder_test_defaults",
214 ],
Tomasz Wasilczykfbfea5b2024-04-30 10:54:23 -0700215 header_libs: [
216 "libbinder_headers_base",
217 ],
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700218 shared_libs: [
219 "libbase",
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700220 ],
221 srcs: [
222 "FileUtils.cpp",
223 ],
224 visibility: [
225 ":__subpackages__",
226 ],
227}
228
Andrei Homescu12106de2022-04-27 04:42:21 +0000229cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000230 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000231 host_supported: true,
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700232 cmake_snapshot_supported: true,
Steven Morelandf6ec4632021-04-01 16:20:47 +0000233 target: {
234 darwin: {
235 enabled: false,
236 },
237 },
Steven Moreland37aff182021-03-26 02:04:16 +0000238 defaults: [
239 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000240 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000241
Devin Moore1df9c5f2024-07-23 22:09:29 +0000242 compile_multilib: "both",
243 multilib: {
244 lib32: {
245 suffix: "32",
246 },
247 lib64: {
248 suffix: "64",
249 },
250 },
251
Andrei Homescu12106de2022-04-27 04:42:21 +0000252 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700253 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000254 "libbinder_tls_static",
255 "libbinder_tls_test_utils",
256 "binderRpcTestIface-cpp",
257 "binderRpcTestIface-ndk",
258 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000259}
260
261cc_defaults {
262 name: "binderRpcTest_service_defaults",
263 defaults: [
264 "binderRpcTest_common_defaults",
265 ],
266 gtest: false,
267 auto_gen_config: false,
268 srcs: [
269 "binderRpcTestCommon.cpp",
270 "binderRpcTestService.cpp",
271 ],
272}
273
274cc_defaults {
275 name: "binderRpcTest_defaults",
276 target: {
277 android: {
278 test_suites: ["vts"],
279 },
280 },
281 defaults: [
282 "binderRpcTest_common_defaults",
283 ],
284
285 srcs: [
286 "binderRpcTest.cpp",
287 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000288 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000289 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000290
Steven Moreland20531612023-04-04 18:03:24 +0000291 // This test uses a lot of resources and takes a long time. Due to
292 // design of several tests, it is also very sensitive to resource
293 // contention on the device. b/276820894
294 test_options: {
295 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000296 test_runner_options: [
297 {
298 name: "native-test-timeout",
299 value: "10m",
300 },
301 ],
Steven Moreland20531612023-04-04 18:03:24 +0000302 },
303
Andrei Homescu12106de2022-04-27 04:42:21 +0000304 test_suites: ["general-tests"],
305 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000306
307 data_bins: [
308 "binder_rpc_test_service",
309 "binder_rpc_test_service_no_kernel",
310 "binder_rpc_test_service_single_threaded",
311 "binder_rpc_test_service_single_threaded_no_kernel",
312 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000313}
314
Andrei Homescu2a298012022-06-15 01:08:54 +0000315cc_defaults {
316 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000317 cflags: [
318 "-DBINDER_WITH_KERNEL_IPC",
319 ],
320
Steven Moreland5553ac42020-11-11 02:14:45 +0000321 shared_libs: [
322 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000323 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000324 "libbase",
325 "libutils",
326 "libcutils",
327 "liblog",
328 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000329}
330
331cc_defaults {
332 name: "binderRpcTest_static_defaults",
333
334 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000335 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000336 "libutils",
337 // libcrypto_static is not visible to this module
338 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000339 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000340 static_libs: [
341 "libbase",
342 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000343 "libssl",
344 ],
345
346 cflags: [
347 // Disable tests that require shared libraries,
348 // e.g., libbinder.so or libbinder_ndk.so
349 "-DBINDER_TEST_NO_SHARED_LIBS",
350 ],
351}
352
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700353cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000354 // The module name cannot start with "binderRpcTest" because
355 // then atest tries to execute it as part of binderRpcTest
356 name: "binder_rpc_test_service",
357 defaults: [
358 "binderRpcTest_service_defaults",
359 "binderRpcTest_shared_defaults",
360 "libbinder_tls_shared_deps",
361 ],
362}
363
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700364cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000365 name: "binder_rpc_test_service_no_kernel",
366 defaults: [
367 "binderRpcTest_service_defaults",
368 "binderRpcTest_static_defaults",
369 ],
370 static_libs: [
371 "libbinder_rpc_no_kernel",
372 ],
373}
374
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700375cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000376 name: "binder_rpc_test_service_single_threaded",
377 defaults: [
378 "binderRpcTest_service_defaults",
379 "binderRpcTest_static_defaults",
380 ],
381 cflags: [
382 "-DBINDER_RPC_SINGLE_THREADED",
383 "-DBINDER_WITH_KERNEL_IPC",
384 ],
385 static_libs: [
386 "libbinder_rpc_single_threaded",
387 ],
388}
389
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700390cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000391 name: "binder_rpc_test_service_single_threaded_no_kernel",
392 defaults: [
393 "binderRpcTest_service_defaults",
394 "binderRpcTest_static_defaults",
395 ],
396 cflags: [
397 "-DBINDER_RPC_SINGLE_THREADED",
398 ],
399 static_libs: [
400 "libbinder_rpc_single_threaded_no_kernel",
401 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700402 shared_libs: [
403 "libbinder_ndk",
404 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000405}
406
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000407cc_binary {
408 name: "binderRpcTestService_on_trusty_mock",
409 defaults: [
410 "trusty_mock_defaults",
411 ],
412
413 srcs: [
414 "binderRpcTestCommon.cpp",
415 "binderRpcTestServiceTrusty.cpp",
416 ],
417
418 shared_libs: [
419 "libbinder_on_trusty_mock",
420 "libbase",
421 "libutils",
422 "libcutils",
423 ],
424
425 static_libs: [
426 "binderRpcTestIface-cpp",
427 ],
428}
429
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000430cc_binary {
431 name: "binderRpcTest_on_trusty_mock",
432 defaults: [
433 "trusty_mock_defaults",
434 ],
435
436 srcs: [
437 "binderRpcUniversalTests.cpp",
438 "binderRpcTestCommon.cpp",
439 "binderRpcTestTrusty.cpp",
440 ],
441
442 shared_libs: [
443 "libbinder_on_trusty_mock",
444 "libbase",
445 "libutils",
446 "libcutils",
447 ],
448
449 static_libs: [
450 "binderRpcTestIface-cpp",
451 "libgtest",
452 ],
453}
454
Andrei Homescu2a298012022-06-15 01:08:54 +0000455cc_test {
456 name: "binderRpcTest",
457 defaults: [
458 "binderRpcTest_defaults",
459 "binderRpcTest_shared_defaults",
460 "libbinder_tls_shared_deps",
461 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000462
463 // Add the Trusty mock library as a fake dependency so it gets built
464 required: [
465 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000466 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000467 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000468 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000469 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000470 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000471}
472
473cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000474 name: "binderRpcTestNoKernel",
475 defaults: [
476 "binderRpcTest_defaults",
477 "binderRpcTest_static_defaults",
478 ],
479 static_libs: [
480 "libbinder_rpc_no_kernel",
481 ],
482}
483
484cc_test {
Tomasz Wasilczyk2265ad92024-05-01 12:54:46 -0700485 name: "binderRpcTestNoKernelAtAll",
486 defaults: [
487 "binderRpcTest_defaults",
488 "binderRpcTest_static_defaults",
489 ],
490 static_libs: [
491 "libbinder_rpc_no_kernel",
492 ],
493 cflags: [
494 "-DBINDER_NO_KERNEL_IPC_TESTING",
495 ],
496}
497
498cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000499 name: "binderRpcTestSingleThreaded",
500 defaults: [
501 "binderRpcTest_defaults",
502 "binderRpcTest_static_defaults",
503 ],
504 cflags: [
505 "-DBINDER_RPC_SINGLE_THREADED",
506 "-DBINDER_WITH_KERNEL_IPC",
507 ],
508 static_libs: [
509 "libbinder_rpc_single_threaded",
510 ],
511}
512
513cc_test {
514 name: "binderRpcTestSingleThreadedNoKernel",
515 defaults: [
516 "binderRpcTest_defaults",
517 "binderRpcTest_static_defaults",
518 ],
519 cflags: [
520 "-DBINDER_RPC_SINGLE_THREADED",
521 ],
522 static_libs: [
523 "libbinder_rpc_single_threaded_no_kernel",
524 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700525 shared_libs: [
526 "libbinder_ndk",
527 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000528}
529
Yifan Hongff73aa92021-09-17 21:28:01 -0700530cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000531 name: "binderRpcToTrustyTest",
532 vendor: true,
533 host_supported: false,
534 defaults: [
535 "binderRpcTest_common_defaults",
536 "binderRpcTest_static_defaults",
537 ],
538
539 srcs: [
540 "binderRpcTest.cpp",
541 "binderRpcTestCommon.cpp",
542 "binderRpcUniversalTests.cpp",
543 ],
544
545 cflags: [
546 "-DBINDER_RPC_TO_TRUSTY_TEST",
547 ],
548
549 static_libs: [
550 // We want to link libbinder statically so we can push the binary
551 // to the device for testing independently of the library
552 "libbinder_rpc_no_kernel",
553 "libbinder_trusty",
554 "libtrusty",
555 ],
556
557 test_suites: ["device-tests"],
558 require_root: true,
559}
560
561cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700562 name: "RpcTlsUtilsTest",
563 host_supported: true,
564 target: {
565 darwin: {
566 enabled: false,
567 },
568 android: {
569 test_suites: ["vts"],
570 },
571 },
572 defaults: [
573 "binder_test_defaults",
574 "libbinder_tls_shared_deps",
575 ],
576 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700577 "RpcTlsUtilsTest.cpp",
578 ],
579 shared_libs: [
580 "libbinder",
581 "libbase",
582 "libutils",
583 "liblog",
584 ],
585 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700586 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700587 "libbinder_tls_static",
588 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000589 test_suites: [
590 "general-tests",
591 "device-tests",
592 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700593}
594
Steven Morelandcda60852021-04-14 23:45:32 +0000595cc_benchmark {
596 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700597 defaults: [
598 "binder_test_defaults",
599 "libbinder_tls_shared_deps",
600 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000601 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000602 target: {
603 darwin: {
604 enabled: false,
605 },
606 },
Steven Morelandcda60852021-04-14 23:45:32 +0000607 srcs: [
608 "binderRpcBenchmark.cpp",
609 "IBinderRpcBenchmark.aidl",
610 ],
611 shared_libs: [
612 "libbase",
613 "libbinder",
614 "liblog",
615 "libutils",
616 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700617 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700618 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700619 "libbinder_tls_static",
620 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000621}
622
Steven Moreland5553ac42020-11-11 02:14:45 +0000623cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700624 name: "binderRpcWireProtocolTest",
625 host_supported: true,
626 target: {
627 darwin: {
628 enabled: false,
629 },
630 android: {
631 test_suites: ["vts"],
632 },
633 },
634 defaults: [
635 "binder_test_defaults",
636 ],
637 srcs: [
638 "binderRpcWireProtocolTest.cpp",
639 ],
640 shared_libs: [
641 "libbinder",
642 "libbase",
643 "libutils",
644 "libcutils",
645 "liblog",
646 ],
647 test_suites: ["general-tests"],
648}
649
650cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700651 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700652 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700653 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700654 shared_libs: [
655 "libbinder",
656 "libutils",
657 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700658 cflags: [
659 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700660 "-Wno-missing-field-initializers",
661 "-Wno-sign-compare",
662 "-O3",
663 ],
664}
Wei Wang78f2a372016-10-20 23:18:17 -0700665
666cc_test {
667 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700668 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700669 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700670 shared_libs: [
671 "libbinder",
672 "libutils",
673 "libbase",
674 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700675 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700676}
Howard Chenc135dbc2017-03-25 17:12:59 +0800677
678cc_test {
679 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700680 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700681 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800682 shared_libs: [
683 "libbinder",
684 "libutils",
685 "libbase",
686 ],
687}
Dan Stozad630e522016-12-01 15:16:31 -0800688
689cc_test {
690 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700691 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700692 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800693
694 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800695 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800696 ],
697
698 cpp_std: "experimental",
699 gnu_extensions: false,
700
701 shared_libs: [
702 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700703 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800704 "liblog",
705 "libutils",
706 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000707 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000708 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000709 "vts",
710 ],
Dan Shi80ada592019-09-13 09:17:17 -0700711 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800712}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700713
Steven Morelandf23dae22020-10-27 19:34:55 +0000714cc_test {
715 name: "binderClearBufTest",
716 defaults: ["binder_test_defaults"],
717 srcs: [
718 "binderClearBufTest.cpp",
719 ],
720
721 shared_libs: [
722 "libbase",
723 "libbinder",
724 "liblog",
725 "libutils",
726 ],
727
728 test_suites: ["general-tests"],
729 require_root: true,
730}
731
Steven Moreland12300a02019-08-02 13:27:15 -0700732aidl_interface {
733 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900734 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700735 srcs: [
736 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700737 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000738 backend: {
739 java: {
740 enabled: false,
741 },
742 },
Steven Moreland12300a02019-08-02 13:27:15 -0700743}
744
Steven Morelanddea3cf92019-07-16 18:06:55 -0700745cc_test {
746 name: "binderStabilityTest",
747 defaults: ["binder_test_defaults"],
748 srcs: [
749 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700750 ],
751
Steven Moreland13f84662020-07-23 21:30:41 +0000752 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700753 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700754 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700755 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700756 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700757 "libutils",
758 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700759 static_libs: [
760 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900761 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700762 ],
763
Steven Morelandea7659e2022-02-03 00:04:06 +0000764 test_suites: [
Julien Desprez169452a2024-08-23 04:06:18 +0000765 "general-tests",
Steven Morelandea7659e2022-02-03 00:04:06 +0000766 "vts",
767 ],
Dan Shi302709b2019-09-19 15:28:15 -0700768 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700769}
Steven Moreland042ae822020-05-27 17:45:17 +0000770
771cc_test {
772 name: "binderAllocationLimits",
773 defaults: ["binder_test_defaults"],
774 srcs: ["binderAllocationLimits.cpp"],
775 shared_libs: [
776 "libbinder",
777 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000778 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000779 "libutils",
780 "libutilscallstack",
781 "libbase",
782 ],
783 test_suites: ["device-tests"],
784 require_root: true,
785}
Andy Hung73a14702020-11-24 13:04:46 -0800786
787cc_benchmark {
788 name: "binderParcelBenchmark",
789 defaults: ["binder_test_defaults"],
790 srcs: ["binderParcelBenchmark.cpp"],
791 shared_libs: [
792 "libbase",
793 "libbinder",
794 "liblog",
795 "libutils",
796 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000797 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800798}
Yifan Hongaf766e62021-06-14 13:24:19 -0700799
800cc_test_host {
801 name: "binderUtilsHostTest",
802 defaults: ["binder_test_defaults"],
803 srcs: ["binderUtilsHostTest.cpp"],
804 shared_libs: [
805 "libbase",
806 "libbinder",
807 ],
808 static_libs: [
809 "libgmock",
810 ],
811 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700812 target: {
813 darwin: {
814 enabled: false,
815 },
816 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700817}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700818
819cc_test_host {
820 name: "binderHostDeviceTest",
821 defaults: ["binder_test_defaults"],
822 srcs: ["binderHostDeviceTest.cpp"],
823 test_config: "binderHostDeviceTest.xml",
824 shared_libs: [
825 "libbase",
826 "libbinder",
827 "liblog",
828 "libutils",
829 ],
830 static_libs: [
831 "libgmock",
832 ],
833 target_required: [
834 "binderHostDeviceTestService",
835 ],
836 test_suites: ["general-tests"],
837 target: {
838 darwin: {
839 enabled: false,
840 },
841 },
842 test_options: {
843 unit_test: false,
844 },
845}
846
847cc_test {
848 name: "binderHostDeviceTestService",
849 // The binary is named differently from the module so that PushFilePreparer pushes the binary
850 // directly, not the test module directory.
851 stem: "binderHostDeviceTest-service",
852 defaults: ["binder_test_defaults"],
853 gtest: false,
854 auto_gen_config: false,
855 srcs: ["binderHostDeviceTestService.cpp"],
856 shared_libs: [
857 "libbase",
858 "libbinder",
859 "liblog",
860 "libutils",
861 ],
862 test_suites: ["general-tests"],
863}
Pawanf00fabb2022-08-04 17:56:18 +0000864
865cc_defaults {
866 name: "service_fuzzer_defaults",
867 static_libs: [
868 "libbase",
869 "libbinder_random_parcel",
870 "libcutils",
871 ],
872 target: {
873 android: {
874 shared_libs: [
875 "libbinder_ndk",
876 "libbinder",
877 "libutils",
878 ],
879 },
880 host: {
881 static_libs: [
882 "libbinder_ndk",
883 "libbinder",
884 "libutils",
885 ],
886 },
887 darwin: {
888 enabled: false,
889 },
890 },
891 fuzz_config: {
892 cc: [
893 "smoreland@google.com",
894 "waghpawan@google.com",
895 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000896 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
897 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000898 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000899 },
900}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000901
902cc_defaults {
903 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000904 fuzz_config: {
905 asan_options: [
906 "detect_leaks=0",
907 ],
908 hwasan_options: [
909 "detect_leaks=0",
910 ],
911 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000912}