blob: 213d7649e2ffb9a1cf6fb7282d58f5e3a987807f [file] [log] [blame]
Dan Willemsen59e086f2016-07-25 17:13:45 -07001//
2// Copyright (C) 2014 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Bob Badour3c538232021-02-12 21:26:48 -080017package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "frameworks_native_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["frameworks_native_license"],
24}
25
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070026cc_defaults {
27 name: "binder_test_defaults",
28 cflags: [
29 "-Wall",
30 "-Werror",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070031 ],
32}
33
Dan Willemsen59e086f2016-07-25 17:13:45 -070034cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070035 name: "binderDriverInterfaceTest",
36 defaults: ["binder_test_defaults"],
Yifan Hong4e419d82021-04-26 11:32:56 -070037 header_libs: ["libbinder_headers"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070038 srcs: ["binderDriverInterfaceTest.cpp"],
Steven Morelandea7659e2022-02-03 00:04:06 +000039 test_suites: [
40 "device-tests",
41 "vts",
42 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070043}
44
Steven Morelandcefba612020-11-05 22:57:06 +000045// unit test only, which can run on host and doesn't use /dev/binder
46cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000047 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000048 host_supported: true,
49 target: {
50 darwin: {
51 enabled: false,
52 },
53 },
Steven Morelandea7659e2022-02-03 00:04:06 +000054 srcs: [
55 "binderParcelUnitTest.cpp",
56 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +000057 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -050058 "binderMemoryHeapBaseUnitTest.cpp",
Fabián Cañas08bdc772023-01-02 15:02:56 -050059 "binderRecordedTransactionTest.cpp",
Abhishek Gadewar76f00822024-05-09 17:02:18 -070060 "binderPersistableBundleTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +000061 ],
Steven Morelandcefba612020-11-05 22:57:06 +000062 shared_libs: [
63 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -070064 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +000065 "libutils",
66 ],
67 test_suites: ["general-tests"],
68}
69
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080070cc_test {
Steven Morelanda8244b92023-04-20 23:34:11 +000071 name: "binderRecordReplayTest",
72 srcs: ["binderRecordReplayTest.cpp"],
Pawan Wagh76b18152023-12-01 14:30:26 +000073 cflags: [
74 "-DBINDER_WITH_KERNEL_IPC",
75 ],
Steven Morelanda8244b92023-04-20 23:34:11 +000076 shared_libs: [
77 "libbinder",
78 "libcutils",
79 "libutils",
Pawan Wagh76b18152023-12-01 14:30:26 +000080 "liblog",
Steven Morelanda8244b92023-04-20 23:34:11 +000081 ],
82 static_libs: [
83 "binderRecordReplayTestIface-cpp",
Pawan Wagh8da45382023-05-11 08:08:50 +000084 "binderReadParcelIface-cpp",
Pawan Wagh94bf3032023-07-27 17:15:02 +000085 "libbinder_random_parcel_seeds",
86 "libbinder_random_parcel",
Steven Morelanda8244b92023-04-20 23:34:11 +000087 ],
88 test_suites: ["general-tests"],
Steven Moreland4ed688d2023-05-03 23:03:56 +000089 require_root: true,
Steven Morelanda8244b92023-04-20 23:34:11 +000090}
91
92aidl_interface {
93 name: "binderRecordReplayTestIface",
94 unstable: true,
95 srcs: [
96 "IBinderRecordReplayTest.aidl",
97 ],
Pawan Wagh8da45382023-05-11 08:08:50 +000098 imports: ["binderReadParcelIface"],
99 backend: {
100 java: {
101 enabled: true,
102 platform_apis: true,
103 },
Steven Moreland59813352024-02-08 23:52:11 +0000104
105 // TODO: switch from FileDescriptor to ParcelFileDescriptor
Pawan Wagh76b18152023-12-01 14:30:26 +0000106 ndk: {
107 enabled: false,
108 },
Steven Moreland59813352024-02-08 23:52:11 +0000109 rust: {
110 enabled: false,
111 },
Pawan Wagh8da45382023-05-11 08:08:50 +0000112 },
Steven Morelanda8244b92023-04-20 23:34:11 +0000113}
114
115cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700116 name: "binderLibTest",
117 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800118
Dan Willemsen59e086f2016-07-25 17:13:45 -0700119 srcs: ["binderLibTest.cpp"],
120 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700121 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700122 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700123 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700124 "libutils",
125 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700126 static_libs: [
127 "libgmock",
128 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000129 test_suites: [
130 "device-tests",
131 "vts",
132 ],
Dan Shi80ada592019-09-13 09:17:17 -0700133 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700134}
135
Steven Moreland37aff182021-03-26 02:04:16 +0000136aidl_interface {
137 name: "binderRpcTestIface",
Andrei Homescud65666d2023-03-03 07:28:02 +0000138 vendor_available: true,
Steven Moreland37aff182021-03-26 02:04:16 +0000139 host_supported: true,
140 unstable: true,
141 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700142 "BinderRpcTestClientInfo.aidl",
Andrei Homescu2a298012022-06-15 01:08:54 +0000143 "BinderRpcTestServerConfig.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700144 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000145 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000146 "IBinderRpcSession.aidl",
147 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700148 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000149 ],
Tomasz Wasilczyk7c511e92023-12-04 17:00:28 -0800150 flags: [
151 "-Werror",
152 "-Wno-mixed-oneway",
153 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000154 backend: {
155 java: {
156 enabled: false,
157 },
158 },
159}
160
Yifan Honge0e53282021-09-23 18:37:21 -0700161cc_library_static {
162 name: "libbinder_tls_test_utils",
163 host_supported: true,
Andrei Homescud65666d2023-03-03 07:28:02 +0000164 vendor_available: true,
Yifan Honge0e53282021-09-23 18:37:21 -0700165 target: {
166 darwin: {
167 enabled: false,
168 },
169 },
170 defaults: [
171 "binder_test_defaults",
172 "libbinder_tls_shared_deps",
173 ],
174 shared_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700175 "libbase",
176 "liblog",
177 ],
178 static_libs: [
179 "libbinder_tls_static",
180 ],
181 srcs: [
182 "RpcTlsTestUtils.cpp",
183 ],
184 export_include_dirs: [
185 "include_tls_test_utils",
186 ],
187 visibility: [
188 ":__subpackages__",
189 ],
190}
191
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700192cc_library_static {
193 name: "libbinder_test_utils",
194 host_supported: true,
195 vendor_available: true,
196 target: {
197 darwin: {
198 enabled: false,
199 },
200 },
201 defaults: [
202 "binder_test_defaults",
203 ],
Tomasz Wasilczykfbfea5b2024-04-30 10:54:23 -0700204 header_libs: [
205 "libbinder_headers_base",
206 ],
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700207 shared_libs: [
208 "libbase",
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700209 ],
210 srcs: [
211 "FileUtils.cpp",
212 ],
213 visibility: [
214 ":__subpackages__",
215 ],
216}
217
Andrei Homescu12106de2022-04-27 04:42:21 +0000218cc_defaults {
Andrei Homescu2a298012022-06-15 01:08:54 +0000219 name: "binderRpcTest_common_defaults",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000220 host_supported: true,
221 target: {
222 darwin: {
223 enabled: false,
224 },
225 },
Steven Moreland37aff182021-03-26 02:04:16 +0000226 defaults: [
227 "binder_test_defaults",
Steven Moreland37aff182021-03-26 02:04:16 +0000228 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000229
Andrei Homescu12106de2022-04-27 04:42:21 +0000230 static_libs: [
Tomasz Wasilczyk26db5e42023-11-02 11:45:11 -0700231 "libbinder_test_utils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000232 "libbinder_tls_static",
233 "libbinder_tls_test_utils",
234 "binderRpcTestIface-cpp",
235 "binderRpcTestIface-ndk",
236 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000237}
238
239cc_defaults {
240 name: "binderRpcTest_service_defaults",
241 defaults: [
242 "binderRpcTest_common_defaults",
243 ],
244 gtest: false,
245 auto_gen_config: false,
246 srcs: [
247 "binderRpcTestCommon.cpp",
248 "binderRpcTestService.cpp",
249 ],
250}
251
252cc_defaults {
253 name: "binderRpcTest_defaults",
254 target: {
255 android: {
256 test_suites: ["vts"],
257 },
258 },
259 defaults: [
260 "binderRpcTest_common_defaults",
261 ],
262
263 srcs: [
264 "binderRpcTest.cpp",
265 "binderRpcTestCommon.cpp",
Andrei Homescu9a9b1b42022-10-14 01:40:59 +0000266 "binderRpcUniversalTests.cpp",
Andrei Homescu2a298012022-06-15 01:08:54 +0000267 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000268
Steven Moreland20531612023-04-04 18:03:24 +0000269 // This test uses a lot of resources and takes a long time. Due to
270 // design of several tests, it is also very sensitive to resource
271 // contention on the device. b/276820894
272 test_options: {
273 unit_test: false,
Steven Morelandf6b18f22023-12-16 04:46:22 +0000274 test_runner_options: [
275 {
276 name: "native-test-timeout",
277 value: "10m",
278 },
279 ],
Steven Moreland20531612023-04-04 18:03:24 +0000280 },
281
Andrei Homescu12106de2022-04-27 04:42:21 +0000282 test_suites: ["general-tests"],
283 require_root: true,
Andrei Homescu2a298012022-06-15 01:08:54 +0000284
285 data_bins: [
286 "binder_rpc_test_service",
287 "binder_rpc_test_service_no_kernel",
288 "binder_rpc_test_service_single_threaded",
289 "binder_rpc_test_service_single_threaded_no_kernel",
290 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000291}
292
Andrei Homescu2a298012022-06-15 01:08:54 +0000293cc_defaults {
294 name: "binderRpcTest_shared_defaults",
Andrei Homescu12106de2022-04-27 04:42:21 +0000295 cflags: [
296 "-DBINDER_WITH_KERNEL_IPC",
297 ],
298
Steven Moreland5553ac42020-11-11 02:14:45 +0000299 shared_libs: [
300 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000301 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000302 "libbase",
303 "libutils",
304 "libcutils",
305 "liblog",
306 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000307}
308
309cc_defaults {
310 name: "binderRpcTest_static_defaults",
311
312 shared_libs: [
Andrei Homescu68a55612022-08-02 01:25:15 +0000313 "liblog",
Andrei Homescu12106de2022-04-27 04:42:21 +0000314 "libutils",
315 // libcrypto_static is not visible to this module
316 "libcrypto",
Steven Moreland37aff182021-03-26 02:04:16 +0000317 ],
Andrei Homescu12106de2022-04-27 04:42:21 +0000318 static_libs: [
319 "libbase",
320 "libcutils",
Andrei Homescu12106de2022-04-27 04:42:21 +0000321 "libssl",
322 ],
323
324 cflags: [
325 // Disable tests that require shared libraries,
326 // e.g., libbinder.so or libbinder_ndk.so
327 "-DBINDER_TEST_NO_SHARED_LIBS",
328 ],
329}
330
331cc_test {
Andrei Homescu2a298012022-06-15 01:08:54 +0000332 // The module name cannot start with "binderRpcTest" because
333 // then atest tries to execute it as part of binderRpcTest
334 name: "binder_rpc_test_service",
335 defaults: [
336 "binderRpcTest_service_defaults",
337 "binderRpcTest_shared_defaults",
338 "libbinder_tls_shared_deps",
339 ],
340}
341
342cc_test {
343 name: "binder_rpc_test_service_no_kernel",
344 defaults: [
345 "binderRpcTest_service_defaults",
346 "binderRpcTest_static_defaults",
347 ],
348 static_libs: [
349 "libbinder_rpc_no_kernel",
350 ],
351}
352
353cc_test {
354 name: "binder_rpc_test_service_single_threaded",
355 defaults: [
356 "binderRpcTest_service_defaults",
357 "binderRpcTest_static_defaults",
358 ],
359 cflags: [
360 "-DBINDER_RPC_SINGLE_THREADED",
361 "-DBINDER_WITH_KERNEL_IPC",
362 ],
363 static_libs: [
364 "libbinder_rpc_single_threaded",
365 ],
366}
367
368cc_test {
369 name: "binder_rpc_test_service_single_threaded_no_kernel",
370 defaults: [
371 "binderRpcTest_service_defaults",
372 "binderRpcTest_static_defaults",
373 ],
374 cflags: [
375 "-DBINDER_RPC_SINGLE_THREADED",
376 ],
377 static_libs: [
378 "libbinder_rpc_single_threaded_no_kernel",
379 ],
380}
381
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000382cc_binary {
383 name: "binderRpcTestService_on_trusty_mock",
384 defaults: [
385 "trusty_mock_defaults",
386 ],
387
388 srcs: [
389 "binderRpcTestCommon.cpp",
390 "binderRpcTestServiceTrusty.cpp",
391 ],
392
393 shared_libs: [
394 "libbinder_on_trusty_mock",
395 "libbase",
396 "libutils",
397 "libcutils",
398 ],
399
400 static_libs: [
401 "binderRpcTestIface-cpp",
402 ],
403}
404
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000405cc_binary {
406 name: "binderRpcTest_on_trusty_mock",
407 defaults: [
408 "trusty_mock_defaults",
409 ],
410
411 srcs: [
412 "binderRpcUniversalTests.cpp",
413 "binderRpcTestCommon.cpp",
414 "binderRpcTestTrusty.cpp",
415 ],
416
417 shared_libs: [
418 "libbinder_on_trusty_mock",
419 "libbase",
420 "libutils",
421 "libcutils",
422 ],
423
424 static_libs: [
425 "binderRpcTestIface-cpp",
426 "libgtest",
427 ],
428}
429
Andrei Homescu2a298012022-06-15 01:08:54 +0000430cc_test {
431 name: "binderRpcTest",
432 defaults: [
433 "binderRpcTest_defaults",
434 "binderRpcTest_shared_defaults",
435 "libbinder_tls_shared_deps",
436 ],
Andrei Homescu875996f2022-08-24 04:25:11 +0000437
438 // Add the Trusty mock library as a fake dependency so it gets built
439 required: [
440 "libbinder_on_trusty_mock",
Andrei Homescu40dbf252024-03-28 21:19:42 +0000441 "libbinder_ndk_on_trusty_mock",
Andrei Homescu6dfa8c92024-03-29 04:58:32 +0000442 "libbinder_rs_on_trusty_mock",
Andrei Homescu9d8adb12022-08-02 04:38:30 +0000443 "binderRpcTestService_on_trusty_mock",
Andrei Homescu4d9420e2023-01-31 01:38:48 +0000444 "binderRpcTest_on_trusty_mock",
Andrei Homescu875996f2022-08-24 04:25:11 +0000445 ],
Andrei Homescu2a298012022-06-15 01:08:54 +0000446}
447
448cc_test {
Andrei Homescu12106de2022-04-27 04:42:21 +0000449 name: "binderRpcTestNoKernel",
450 defaults: [
451 "binderRpcTest_defaults",
452 "binderRpcTest_static_defaults",
453 ],
454 static_libs: [
455 "libbinder_rpc_no_kernel",
456 ],
457}
458
459cc_test {
460 name: "binderRpcTestSingleThreaded",
461 defaults: [
462 "binderRpcTest_defaults",
463 "binderRpcTest_static_defaults",
464 ],
465 cflags: [
466 "-DBINDER_RPC_SINGLE_THREADED",
467 "-DBINDER_WITH_KERNEL_IPC",
468 ],
469 static_libs: [
470 "libbinder_rpc_single_threaded",
471 ],
472}
473
474cc_test {
475 name: "binderRpcTestSingleThreadedNoKernel",
476 defaults: [
477 "binderRpcTest_defaults",
478 "binderRpcTest_static_defaults",
479 ],
480 cflags: [
481 "-DBINDER_RPC_SINGLE_THREADED",
482 ],
483 static_libs: [
484 "libbinder_rpc_single_threaded_no_kernel",
485 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000486}
487
Yifan Hongff73aa92021-09-17 21:28:01 -0700488cc_test {
Andrei Homescud65666d2023-03-03 07:28:02 +0000489 name: "binderRpcToTrustyTest",
490 vendor: true,
491 host_supported: false,
492 defaults: [
493 "binderRpcTest_common_defaults",
494 "binderRpcTest_static_defaults",
495 ],
496
497 srcs: [
498 "binderRpcTest.cpp",
499 "binderRpcTestCommon.cpp",
500 "binderRpcUniversalTests.cpp",
501 ],
502
503 cflags: [
504 "-DBINDER_RPC_TO_TRUSTY_TEST",
505 ],
506
507 static_libs: [
508 // We want to link libbinder statically so we can push the binary
509 // to the device for testing independently of the library
510 "libbinder_rpc_no_kernel",
511 "libbinder_trusty",
512 "libtrusty",
513 ],
514
515 test_suites: ["device-tests"],
516 require_root: true,
517}
518
519cc_test {
Yifan Hongff73aa92021-09-17 21:28:01 -0700520 name: "RpcTlsUtilsTest",
521 host_supported: true,
522 target: {
523 darwin: {
524 enabled: false,
525 },
526 android: {
527 test_suites: ["vts"],
528 },
529 },
530 defaults: [
531 "binder_test_defaults",
532 "libbinder_tls_shared_deps",
533 ],
534 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700535 "RpcTlsUtilsTest.cpp",
536 ],
537 shared_libs: [
538 "libbinder",
539 "libbase",
540 "libutils",
541 "liblog",
542 ],
543 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700544 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700545 "libbinder_tls_static",
546 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000547 test_suites: [
548 "general-tests",
549 "device-tests",
550 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700551}
552
Steven Morelandcda60852021-04-14 23:45:32 +0000553cc_benchmark {
554 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700555 defaults: [
556 "binder_test_defaults",
557 "libbinder_tls_shared_deps",
558 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000559 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000560 target: {
561 darwin: {
562 enabled: false,
563 },
564 },
Steven Morelandcda60852021-04-14 23:45:32 +0000565 srcs: [
566 "binderRpcBenchmark.cpp",
567 "IBinderRpcBenchmark.aidl",
568 ],
569 shared_libs: [
570 "libbase",
571 "libbinder",
572 "liblog",
573 "libutils",
574 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700575 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700576 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700577 "libbinder_tls_static",
578 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000579}
580
Steven Moreland5553ac42020-11-11 02:14:45 +0000581cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700582 name: "binderRpcWireProtocolTest",
583 host_supported: true,
584 target: {
585 darwin: {
586 enabled: false,
587 },
588 android: {
589 test_suites: ["vts"],
590 },
591 },
592 defaults: [
593 "binder_test_defaults",
594 ],
595 srcs: [
596 "binderRpcWireProtocolTest.cpp",
597 ],
598 shared_libs: [
599 "libbinder",
600 "libbase",
601 "libutils",
602 "libcutils",
603 "liblog",
604 ],
605 test_suites: ["general-tests"],
606}
607
608cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700609 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700610 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700611 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700612 shared_libs: [
613 "libbinder",
614 "libutils",
615 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700616 cflags: [
617 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700618 "-Wno-missing-field-initializers",
619 "-Wno-sign-compare",
620 "-O3",
621 ],
622}
Wei Wang78f2a372016-10-20 23:18:17 -0700623
624cc_test {
625 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700626 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700627 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700628 shared_libs: [
629 "libbinder",
630 "libutils",
631 "libbase",
632 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700633 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700634}
Howard Chenc135dbc2017-03-25 17:12:59 +0800635
636cc_test {
637 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700638 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700639 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800640 shared_libs: [
641 "libbinder",
642 "libutils",
643 "libbase",
644 ],
645}
Dan Stozad630e522016-12-01 15:16:31 -0800646
647cc_test {
648 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700649 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700650 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800651
652 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800653 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800654 ],
655
656 cpp_std: "experimental",
657 gnu_extensions: false,
658
659 shared_libs: [
660 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700661 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800662 "liblog",
663 "libutils",
664 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000665 test_suites: [
666 "device-tests",
667 "vts",
668 ],
Dan Shi80ada592019-09-13 09:17:17 -0700669 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800670}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700671
Steven Morelandf23dae22020-10-27 19:34:55 +0000672cc_test {
673 name: "binderClearBufTest",
674 defaults: ["binder_test_defaults"],
675 srcs: [
676 "binderClearBufTest.cpp",
677 ],
678
679 shared_libs: [
680 "libbase",
681 "libbinder",
682 "liblog",
683 "libutils",
684 ],
685
686 test_suites: ["general-tests"],
687 require_root: true,
688}
689
Steven Moreland12300a02019-08-02 13:27:15 -0700690aidl_interface {
691 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900692 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700693 srcs: [
694 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700695 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000696 backend: {
697 java: {
698 enabled: false,
699 },
700 },
Steven Moreland12300a02019-08-02 13:27:15 -0700701}
702
Steven Morelanddea3cf92019-07-16 18:06:55 -0700703cc_test {
704 name: "binderStabilityTest",
705 defaults: ["binder_test_defaults"],
706 srcs: [
707 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700708 ],
709
Steven Moreland13f84662020-07-23 21:30:41 +0000710 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700711 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700712 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700713 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700714 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700715 "libutils",
716 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700717 static_libs: [
718 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900719 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700720 ],
721
Steven Morelandea7659e2022-02-03 00:04:06 +0000722 test_suites: [
723 "device-tests",
724 "vts",
725 ],
Dan Shi302709b2019-09-19 15:28:15 -0700726 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700727}
Steven Moreland042ae822020-05-27 17:45:17 +0000728
729cc_test {
730 name: "binderAllocationLimits",
731 defaults: ["binder_test_defaults"],
732 srcs: ["binderAllocationLimits.cpp"],
733 shared_libs: [
734 "libbinder",
735 "liblog",
Steven Moreland66acefe2022-09-09 00:34:40 +0000736 "libcutils",
Steven Moreland042ae822020-05-27 17:45:17 +0000737 "libutils",
738 "libutilscallstack",
739 "libbase",
740 ],
741 test_suites: ["device-tests"],
742 require_root: true,
743}
Andy Hung73a14702020-11-24 13:04:46 -0800744
745cc_benchmark {
746 name: "binderParcelBenchmark",
747 defaults: ["binder_test_defaults"],
748 srcs: ["binderParcelBenchmark.cpp"],
749 shared_libs: [
750 "libbase",
751 "libbinder",
752 "liblog",
753 "libutils",
754 ],
Steven Moreland9b254dd2023-05-11 00:37:55 +0000755 test_suites: ["general-tests"],
Andy Hung73a14702020-11-24 13:04:46 -0800756}
Yifan Hongaf766e62021-06-14 13:24:19 -0700757
758cc_test_host {
759 name: "binderUtilsHostTest",
760 defaults: ["binder_test_defaults"],
761 srcs: ["binderUtilsHostTest.cpp"],
762 shared_libs: [
763 "libbase",
764 "libbinder",
765 ],
766 static_libs: [
767 "libgmock",
768 ],
769 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700770 target: {
771 darwin: {
772 enabled: false,
773 },
774 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700775}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700776
777cc_test_host {
778 name: "binderHostDeviceTest",
779 defaults: ["binder_test_defaults"],
780 srcs: ["binderHostDeviceTest.cpp"],
781 test_config: "binderHostDeviceTest.xml",
782 shared_libs: [
783 "libbase",
784 "libbinder",
785 "liblog",
786 "libutils",
787 ],
788 static_libs: [
789 "libgmock",
790 ],
791 target_required: [
792 "binderHostDeviceTestService",
793 ],
794 test_suites: ["general-tests"],
795 target: {
796 darwin: {
797 enabled: false,
798 },
799 },
800 test_options: {
801 unit_test: false,
802 },
803}
804
805cc_test {
806 name: "binderHostDeviceTestService",
807 // The binary is named differently from the module so that PushFilePreparer pushes the binary
808 // directly, not the test module directory.
809 stem: "binderHostDeviceTest-service",
810 defaults: ["binder_test_defaults"],
811 gtest: false,
812 auto_gen_config: false,
813 srcs: ["binderHostDeviceTestService.cpp"],
814 shared_libs: [
815 "libbase",
816 "libbinder",
817 "liblog",
818 "libutils",
819 ],
820 test_suites: ["general-tests"],
821}
Pawanf00fabb2022-08-04 17:56:18 +0000822
823cc_defaults {
824 name: "service_fuzzer_defaults",
825 static_libs: [
826 "libbase",
827 "libbinder_random_parcel",
828 "libcutils",
829 ],
830 target: {
831 android: {
832 shared_libs: [
833 "libbinder_ndk",
834 "libbinder",
835 "libutils",
836 ],
837 },
838 host: {
839 static_libs: [
840 "libbinder_ndk",
841 "libbinder",
842 "libutils",
843 ],
844 },
845 darwin: {
846 enabled: false,
847 },
848 },
849 fuzz_config: {
850 cc: [
851 "smoreland@google.com",
852 "waghpawan@google.com",
853 ],
Pawan Wagh595377b2022-11-16 08:42:20 +0000854 // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer
855 hotlists: ["4637097"],
Pawan Wagh813a06f2023-12-21 23:39:39 +0000856 use_for_presubmit: true,
Pawanf00fabb2022-08-04 17:56:18 +0000857 },
858}
Pawan Wagh475f66c2023-05-05 21:46:07 +0000859
860cc_defaults {
861 name: "fuzzer_disable_leaks",
Pawan Wagh9e2d2962023-06-20 23:43:24 +0000862 fuzz_config: {
863 asan_options: [
864 "detect_leaks=0",
865 ],
866 hwasan_options: [
867 "detect_leaks=0",
868 ],
869 },
Pawan Wagh475f66c2023-05-05 21:46:07 +0000870}