blob: e3fb3635a6dfb2c8e0c4b2a4d149d0c006a6a0ad [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: [
49 "device-tests",
50 "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: [
140 "device-tests",
141 "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
Andrei Homescu12106de2022-04-27 04:42:21 +0000242 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700243 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000244 "libbinder_tls_static",
245 "libbinder_tls_test_utils",
246 "binderRpcTestIface-cpp",
247 "binderRpcTestIface-ndk",
248 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000249}
250
251cc_defaults {
252 name: "binderRpcTest_service_defaults",
253 defaults: [
254 "binderRpcTest_common_defaults",
255 ],
256 gtest: false,
257 auto_gen_config: false,
258 srcs: [
259 "binderRpcTestCommon.cpp",
260 "binderRpcTestService.cpp",
261 ],
262}
263
264cc_defaults {
265 name: "binderRpcTest_defaults",
266 target: {
267 android: {
268 test_suites: ["vts"],
269 },
270 },
271 defaults: [
272 "binderRpcTest_common_defaults",
273 ],
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700274 compile_multilib: "first",
Andrei Homescu2a298012022-06-15 01:08:54 +0000275
276 srcs: [
277 "binderRpcTest.cpp",
278 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000279 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000280 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000281
Steven Moreland20531612023-04-04 18:03:24 +0000282 // This test uses a lot of resources and takes a long time. Due to
283 // design of several tests, it is also very sensitive to resource
284 // contention on the device. b/276820894
285 test_options: {
286 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000287 test_runner_options: [
288 {
289 name: "native-test-timeout",
290 value: "10m",
291 },
292 ],
Steven Moreland20531612023-04-04 18:03:24 +0000293 },
294
Andrei Homescu12106de2022-04-27 04:42:21 +0000295 test_suites: ["general-tests"],
296 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000297
298 data_bins: [
299 "binder_rpc_test_service",
300 "binder_rpc_test_service_no_kernel",
301 "binder_rpc_test_service_single_threaded",
302 "binder_rpc_test_service_single_threaded_no_kernel",
303 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000304}
305
Andrei Homescu2a298012022-06-15 01:08:54 +0000306cc_defaults {
307 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000308 cflags: [
309 "-DBINDER_WITH_KERNEL_IPC",
310 ],
311
Steven Moreland5553ac42020-11-11 02:14:45 +0000312 shared_libs: [
313 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000314 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000315 "libbase",
316 "libutils",
317 "libcutils",
318 "liblog",
319 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000320}
321
322cc_defaults {
323 name: "binderRpcTest_static_defaults",
324
325 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000326 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000327 "libutils",
328 // libcrypto_static is not visible to this module
329 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000330 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000331 static_libs: [
332 "libbase",
333 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000334 "libssl",
335 ],
336
337 cflags: [
338 // Disable tests that require shared libraries,
339 // e.g., libbinder.so or libbinder_ndk.so
340 "-DBINDER_TEST_NO_SHARED_LIBS",
341 ],
342}
343
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700344cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000345 // The module name cannot start with "binderRpcTest" because
346 // then atest tries to execute it as part of binderRpcTest
347 name: "binder_rpc_test_service",
348 defaults: [
349 "binderRpcTest_service_defaults",
350 "binderRpcTest_shared_defaults",
351 "libbinder_tls_shared_deps",
352 ],
353}
354
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700355cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000356 name: "binder_rpc_test_service_no_kernel",
357 defaults: [
358 "binderRpcTest_service_defaults",
359 "binderRpcTest_static_defaults",
360 ],
361 static_libs: [
362 "libbinder_rpc_no_kernel",
363 ],
364}
365
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700366cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000367 name: "binder_rpc_test_service_single_threaded",
368 defaults: [
369 "binderRpcTest_service_defaults",
370 "binderRpcTest_static_defaults",
371 ],
372 cflags: [
373 "-DBINDER_RPC_SINGLE_THREADED",
374 "-DBINDER_WITH_KERNEL_IPC",
375 ],
376 static_libs: [
377 "libbinder_rpc_single_threaded",
378 ],
379}
380
Tomasz Wasilczyk75a5dc62024-06-10 14:34:21 -0700381cc_binary {
Andrei Homescu2a298012022-06-15 01:08:54 +0000382 name: "binder_rpc_test_service_single_threaded_no_kernel",
383 defaults: [
384 "binderRpcTest_service_defaults",
385 "binderRpcTest_static_defaults",
386 ],
387 cflags: [
388 "-DBINDER_RPC_SINGLE_THREADED",
389 ],
390 static_libs: [
391 "libbinder_rpc_single_threaded_no_kernel",
392 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700393 shared_libs: [
394 "libbinder_ndk",
395 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000396}
397
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000398cc_binary {
399 name: "binderRpcTestService_on_trusty_mock",
400 defaults: [
401 "trusty_mock_defaults",
402 ],
403
404 srcs: [
405 "binderRpcTestCommon.cpp",
406 "binderRpcTestServiceTrusty.cpp",
407 ],
408
409 shared_libs: [
410 "libbinder_on_trusty_mock",
411 "libbase",
412 "libutils",
413 "libcutils",
414 ],
415
416 static_libs: [
417 "binderRpcTestIface-cpp",
418 ],
419}
420
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000421cc_binary {
422 name: "binderRpcTest_on_trusty_mock",
423 defaults: [
424 "trusty_mock_defaults",
425 ],
426
427 srcs: [
428 "binderRpcUniversalTests.cpp",
429 "binderRpcTestCommon.cpp",
430 "binderRpcTestTrusty.cpp",
431 ],
432
433 shared_libs: [
434 "libbinder_on_trusty_mock",
435 "libbase",
436 "libutils",
437 "libcutils",
438 ],
439
440 static_libs: [
441 "binderRpcTestIface-cpp",
442 "libgtest",
443 ],
444}
445
Andrei Homescu2a298012022-06-15 01:08:54 +0000446cc_test {
447 name: "binderRpcTest",
448 defaults: [
449 "binderRpcTest_defaults",
450 "binderRpcTest_shared_defaults",
451 "libbinder_tls_shared_deps",
452 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000453
454 // Add the Trusty mock library as a fake dependency so it gets built
455 required: [
456 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000457 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000458 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000459 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000460 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000461 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000462}
463
464cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000465 name: "binderRpcTestNoKernel",
466 defaults: [
467 "binderRpcTest_defaults",
468 "binderRpcTest_static_defaults",
469 ],
470 static_libs: [
471 "libbinder_rpc_no_kernel",
472 ],
473}
474
475cc_test {
Tomasz Wasilczyk2265ad92024-05-01 12:54:46 -0700476 name: "binderRpcTestNoKernelAtAll",
477 defaults: [
478 "binderRpcTest_defaults",
479 "binderRpcTest_static_defaults",
480 ],
481 static_libs: [
482 "libbinder_rpc_no_kernel",
483 ],
484 cflags: [
485 "-DBINDER_NO_KERNEL_IPC_TESTING",
486 ],
487}
488
489cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000490 name: "binderRpcTestSingleThreaded",
491 defaults: [
492 "binderRpcTest_defaults",
493 "binderRpcTest_static_defaults",
494 ],
495 cflags: [
496 "-DBINDER_RPC_SINGLE_THREADED",
497 "-DBINDER_WITH_KERNEL_IPC",
498 ],
499 static_libs: [
500 "libbinder_rpc_single_threaded",
501 ],
502}
503
504cc_test {
505 name: "binderRpcTestSingleThreadedNoKernel",
506 defaults: [
507 "binderRpcTest_defaults",
508 "binderRpcTest_static_defaults",
509 ],
510 cflags: [
511 "-DBINDER_RPC_SINGLE_THREADED",
512 ],
513 static_libs: [
514 "libbinder_rpc_single_threaded_no_kernel",
515 ],
Tomasz Wasilczyka32912e2024-04-30 10:55:58 -0700516 shared_libs: [
517 "libbinder_ndk",
518 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000519}
520
Yifan Hongff73aa92021-09-17 21:28:01 -0700521cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000522 name: "binderRpcToTrustyTest",
523 vendor: true,
524 host_supported: false,
525 defaults: [
526 "binderRpcTest_common_defaults",
527 "binderRpcTest_static_defaults",
528 ],
529
530 srcs: [
531 "binderRpcTest.cpp",
532 "binderRpcTestCommon.cpp",
533 "binderRpcUniversalTests.cpp",
534 ],
535
536 cflags: [
537 "-DBINDER_RPC_TO_TRUSTY_TEST",
538 ],
539
540 static_libs: [
541 // We want to link libbinder statically so we can push the binary
542 // to the device for testing independently of the library
543 "libbinder_rpc_no_kernel",
544 "libbinder_trusty",
545 "libtrusty",
546 ],
547
548 test_suites: ["device-tests"],
549 require_root: true,
550}
551
552cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700553 name: "RpcTlsUtilsTest",
554 host_supported: true,
555 target: {
556 darwin: {
557 enabled: false,
558 },
559 android: {
560 test_suites: ["vts"],
561 },
562 },
563 defaults: [
564 "binder_test_defaults",
565 "libbinder_tls_shared_deps",
566 ],
567 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700568 "RpcTlsUtilsTest.cpp",
569 ],
570 shared_libs: [
571 "libbinder",
572 "libbase",
573 "libutils",
574 "liblog",
575 ],
576 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700577 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700578 "libbinder_tls_static",
579 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000580 test_suites: [
581 "general-tests",
582 "device-tests",
583 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700584}
585
Steven Morelandcda60852021-04-14 23:45:32 +0000586cc_benchmark {
587 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700588 defaults: [
589 "binder_test_defaults",
590 "libbinder_tls_shared_deps",
591 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000592 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000593 target: {
594 darwin: {
595 enabled: false,
596 },
597 },
Steven Morelandcda60852021-04-14 23:45:32 +0000598 srcs: [
599 "binderRpcBenchmark.cpp",
600 "IBinderRpcBenchmark.aidl",
601 ],
602 shared_libs: [
603 "libbase",
604 "libbinder",
605 "liblog",
606 "libutils",
607 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700608 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700609 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700610 "libbinder_tls_static",
611 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000612}
613
Steven Moreland5553ac42020-11-11 02:14:45 +0000614cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700615 name: "binderRpcWireProtocolTest",
616 host_supported: true,
617 target: {
618 darwin: {
619 enabled: false,
620 },
621 android: {
622 test_suites: ["vts"],
623 },
624 },
625 defaults: [
626 "binder_test_defaults",
627 ],
628 srcs: [
629 "binderRpcWireProtocolTest.cpp",
630 ],
631 shared_libs: [
632 "libbinder",
633 "libbase",
634 "libutils",
635 "libcutils",
636 "liblog",
637 ],
638 test_suites: ["general-tests"],
639}
640
641cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700642 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700643 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700644 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700645 shared_libs: [
646 "libbinder",
647 "libutils",
648 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700649 cflags: [
650 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700651 "-Wno-missing-field-initializers",
652 "-Wno-sign-compare",
653 "-O3",
654 ],
655}
Wei Wang78f2a372016-10-20 23:18:17 -0700656
657cc_test {
658 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700659 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700660 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700661 shared_libs: [
662 "libbinder",
663 "libutils",
664 "libbase",
665 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700666 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700667}
Howard Chenc135dbc2017-03-25 17:12:59 +0800668
669cc_test {
670 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700671 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700672 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800673 shared_libs: [
674 "libbinder",
675 "libutils",
676 "libbase",
677 ],
678}
Dan Stozad630e522016-12-01 15:16:31 -0800679
680cc_test {
681 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700682 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700683 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800684
685 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800686 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800687 ],
688
689 cpp_std: "experimental",
690 gnu_extensions: false,
691
692 shared_libs: [
693 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700694 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800695 "liblog",
696 "libutils",
697 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000698 test_suites: [
699 "device-tests",
700 "vts",
701 ],
Dan Shi80ada592019-09-13 09:17:17 -0700702 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800703}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700704
Steven Morelandf23dae22020-10-27 19:34:55 +0000705cc_test {
706 name: "binderClearBufTest",
707 defaults: ["binder_test_defaults"],
708 srcs: [
709 "binderClearBufTest.cpp",
710 ],
711
712 shared_libs: [
713 "libbase",
714 "libbinder",
715 "liblog",
716 "libutils",
717 ],
718
719 test_suites: ["general-tests"],
720 require_root: true,
721}
722
Steven Moreland12300a02019-08-02 13:27:15 -0700723aidl_interface {
724 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900725 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700726 srcs: [
727 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700728 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000729 backend: {
730 java: {
731 enabled: false,
732 },
733 },
Steven Moreland12300a02019-08-02 13:27:15 -0700734}
735
Steven Morelanddea3cf92019-07-16 18:06:55 -0700736cc_test {
737 name: "binderStabilityTest",
738 defaults: ["binder_test_defaults"],
739 srcs: [
740 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700741 ],
742
Steven Moreland13f84662020-07-23 21:30:41 +0000743 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700744 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700745 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700746 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700747 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700748 "libutils",
749 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700750 static_libs: [
751 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900752 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700753 ],
754
Steven Morelandea7659e2022-02-03 00:04:06 +0000755 test_suites: [
756 "device-tests",
757 "vts",
758 ],
Dan Shi302709b2019-09-19 15:28:15 -0700759 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700760}
Steven Moreland042ae822020-05-27 17:45:17 +0000761
762cc_test {
763 name: "binderAllocationLimits",
764 defaults: ["binder_test_defaults"],
765 srcs: ["binderAllocationLimits.cpp"],
766 shared_libs: [
767 "libbinder",
768 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000769 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000770 "libutils",
771 "libutilscallstack",
772 "libbase",
773 ],
774 test_suites: ["device-tests"],
775 require_root: true,
776}
Andy Hung73a14702020-11-24 13:04:46 -0800777
778cc_benchmark {
779 name: "binderParcelBenchmark",
780 defaults: ["binder_test_defaults"],
781 srcs: ["binderParcelBenchmark.cpp"],
782 shared_libs: [
783 "libbase",
784 "libbinder",
785 "liblog",
786 "libutils",
787 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000788 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800789}
Yifan Hongaf766e62021-06-14 13:24:19 -0700790
791cc_test_host {
792 name: "binderUtilsHostTest",
793 defaults: ["binder_test_defaults"],
794 srcs: ["binderUtilsHostTest.cpp"],
795 shared_libs: [
796 "libbase",
797 "libbinder",
798 ],
799 static_libs: [
800 "libgmock",
801 ],
802 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700803 target: {
804 darwin: {
805 enabled: false,
806 },
807 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700808}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700809
810cc_test_host {
811 name: "binderHostDeviceTest",
812 defaults: ["binder_test_defaults"],
813 srcs: ["binderHostDeviceTest.cpp"],
814 test_config: "binderHostDeviceTest.xml",
815 shared_libs: [
816 "libbase",
817 "libbinder",
818 "liblog",
819 "libutils",
820 ],
821 static_libs: [
822 "libgmock",
823 ],
824 target_required: [
825 "binderHostDeviceTestService",
826 ],
827 test_suites: ["general-tests"],
828 target: {
829 darwin: {
830 enabled: false,
831 },
832 },
833 test_options: {
834 unit_test: false,
835 },
836}
837
838cc_test {
839 name: "binderHostDeviceTestService",
840 // The binary is named differently from the module so that PushFilePreparer pushes the binary
841 // directly, not the test module directory.
842 stem: "binderHostDeviceTest-service",
843 defaults: ["binder_test_defaults"],
844 gtest: false,
845 auto_gen_config: false,
846 srcs: ["binderHostDeviceTestService.cpp"],
847 shared_libs: [
848 "libbase",
849 "libbinder",
850 "liblog",
851 "libutils",
852 ],
853 test_suites: ["general-tests"],
854}
Pawanf00fabb2022-08-04 17:56:18 +0000855
856cc_defaults {
857 name: "service_fuzzer_defaults",
858 static_libs: [
859 "libbase",
860 "libbinder_random_parcel",
861 "libcutils",
862 ],
863 target: {
864 android: {
865 shared_libs: [
866 "libbinder_ndk",
867 "libbinder",
868 "libutils",
869 ],
870 },
871 host: {
872 static_libs: [
873 "libbinder_ndk",
874 "libbinder",
875 "libutils",
876 ],
877 },
878 darwin: {
879 enabled: false,
880 },
881 },
882 fuzz_config: {
883 cc: [
884 "smoreland@google.com",
885 "waghpawan@google.com",
886 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000887 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
888 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000889 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000890 },
891}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000892
893cc_defaults {
894 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000895 fuzz_config: {
896 asan_options: [
897 "detect_leaks=0",
898 ],
899 hwasan_options: [
900 "detect_leaks=0",
901 ],
902 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000903}