blob: 2f96d0e0e09759e75bf7fca4ffbfdcbdbc14fe97 [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 {
Hsin-Yi Chen69295752017-06-07 18:05:05 +080035 name: "binderDriverInterfaceTest_IPC_32",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070036 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -070037 srcs: ["binderDriverInterfaceTest.cpp"],
Yifan Hong4e419d82021-04-26 11:32:56 -070038 header_libs: ["libbinder_headers"],
Hsin-Yi Chen69295752017-06-07 18:05:05 +080039 compile_multilib: "32",
Steven Morelandea7659e2022-02-03 00:04:06 +000040 multilib: {
41 lib32: {
42 suffix: "",
43 },
44 },
Hsin-Yi Chen69295752017-06-07 18:05:05 +080045 cflags: ["-DBINDER_IPC_32BIT=1"],
Steven Morelandf9f3de22020-05-06 17:14:39 -070046 test_suites: ["vts"],
Hsin-Yi Chen69295752017-06-07 18:05:05 +080047}
48
49cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070050 name: "binderDriverInterfaceTest",
51 defaults: ["binder_test_defaults"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070052 product_variables: {
53 binder32bit: {
54 cflags: ["-DBINDER_IPC_32BIT=1"],
55 },
56 },
Yifan Hong4e419d82021-04-26 11:32:56 -070057 header_libs: ["libbinder_headers"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070058 srcs: ["binderDriverInterfaceTest.cpp"],
Steven Morelandea7659e2022-02-03 00:04:06 +000059 test_suites: [
60 "device-tests",
61 "vts",
62 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -070063}
64
65cc_test {
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080066 name: "binderLibTest_IPC_32",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070067 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -070068 srcs: ["binderLibTest.cpp"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080069 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -070070 "libbase",
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080071 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -070072 "liblog",
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080073 "libutils",
74 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -070075 static_libs: [
76 "libgmock",
77 ],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080078 compile_multilib: "32",
Steven Morelandea7659e2022-02-03 00:04:06 +000079 multilib: {
80 lib32: {
81 suffix: "",
82 },
83 },
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080084 cflags: ["-DBINDER_IPC_32BIT=1"],
Steven Morelandf9f3de22020-05-06 17:14:39 -070085 test_suites: ["vts"],
86 require_root: true,
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080087}
88
Steven Morelandcefba612020-11-05 22:57:06 +000089// unit test only, which can run on host and doesn't use /dev/binder
90cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000091 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000092 host_supported: true,
93 target: {
94 darwin: {
95 enabled: false,
96 },
97 },
Steven Morelandea7659e2022-02-03 00:04:06 +000098 srcs: [
99 "binderParcelUnitTest.cpp",
100 "binderBinderUnitTest.cpp",
Steven Morelandcf373692022-01-21 23:55:15 +0000101 "binderStatusUnitTest.cpp",
Atneya Nair7ade4f42022-02-07 18:16:48 -0500102 "binderMemoryHeapBaseUnitTest.cpp",
Steven Morelandea7659e2022-02-03 00:04:06 +0000103 ],
Steven Morelandcefba612020-11-05 22:57:06 +0000104 shared_libs: [
105 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -0700106 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +0000107 "libutils",
108 ],
109 test_suites: ["general-tests"],
110}
111
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800112cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700113 name: "binderLibTest",
114 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800115 product_variables: {
116 binder32bit: {
117 cflags: ["-DBINDER_IPC_32BIT=1"],
118 },
119 },
120
Dan Willemsen59e086f2016-07-25 17:13:45 -0700121 srcs: ["binderLibTest.cpp"],
122 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700123 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700124 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700125 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700126 "libutils",
127 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700128 static_libs: [
129 "libgmock",
130 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000131 test_suites: [
132 "device-tests",
133 "vts",
134 ],
Dan Shi80ada592019-09-13 09:17:17 -0700135 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700136}
137
Steven Moreland37aff182021-03-26 02:04:16 +0000138aidl_interface {
139 name: "binderRpcTestIface",
140 host_supported: true,
141 unstable: true,
142 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700143 "BinderRpcTestClientInfo.aidl",
144 "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 ],
150 backend: {
151 java: {
152 enabled: false,
153 },
154 },
155}
156
Yifan Honge0e53282021-09-23 18:37:21 -0700157cc_library_static {
158 name: "libbinder_tls_test_utils",
159 host_supported: true,
160 target: {
161 darwin: {
162 enabled: false,
163 },
164 },
165 defaults: [
166 "binder_test_defaults",
167 "libbinder_tls_shared_deps",
168 ],
169 shared_libs: [
170 "libbinder",
171 "libbase",
172 "liblog",
173 ],
174 static_libs: [
175 "libbinder_tls_static",
176 ],
177 srcs: [
178 "RpcTlsTestUtils.cpp",
179 ],
180 export_include_dirs: [
181 "include_tls_test_utils",
182 ],
183 visibility: [
184 ":__subpackages__",
185 ],
186}
187
Dan Willemsen59e086f2016-07-25 17:13:45 -0700188cc_test {
Steven Moreland5553ac42020-11-11 02:14:45 +0000189 name: "binderRpcTest",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000190 host_supported: true,
191 target: {
192 darwin: {
193 enabled: false,
194 },
Steven Moreland1d448af2021-04-20 01:05:18 +0000195 android: {
196 test_suites: ["vts"],
197 },
Steven Morelandf6ec4632021-04-01 16:20:47 +0000198 },
Steven Moreland37aff182021-03-26 02:04:16 +0000199 defaults: [
200 "binder_test_defaults",
Yifan Hong92409752021-07-30 21:25:32 -0700201 "libbinder_tls_shared_deps",
Steven Moreland37aff182021-03-26 02:04:16 +0000202 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000203
204 srcs: [
Steven Moreland5553ac42020-11-11 02:14:45 +0000205 "binderRpcTest.cpp",
206 ],
207 shared_libs: [
208 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000209 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000210 "libbase",
211 "libutils",
212 "libcutils",
213 "liblog",
214 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000215 static_libs: [
Yifan Hong92409752021-07-30 21:25:32 -0700216 "libbinder_tls_static",
Yifan Honge0e53282021-09-23 18:37:21 -0700217 "libbinder_tls_test_utils",
Steven Moreland37aff182021-03-26 02:04:16 +0000218 "binderRpcTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900219 "binderRpcTestIface-ndk",
Steven Moreland37aff182021-03-26 02:04:16 +0000220 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000221 test_suites: ["general-tests"],
222 require_root: true,
223}
224
Yifan Hongff73aa92021-09-17 21:28:01 -0700225cc_test {
226 name: "RpcTlsUtilsTest",
227 host_supported: true,
228 target: {
229 darwin: {
230 enabled: false,
231 },
232 android: {
233 test_suites: ["vts"],
234 },
235 },
236 defaults: [
237 "binder_test_defaults",
238 "libbinder_tls_shared_deps",
239 ],
240 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700241 "RpcTlsUtilsTest.cpp",
242 ],
243 shared_libs: [
244 "libbinder",
245 "libbase",
246 "libutils",
247 "liblog",
248 ],
249 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700250 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700251 "libbinder_tls_static",
252 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000253 test_suites: [
254 "general-tests",
255 "device-tests",
256 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700257}
258
Steven Morelandcda60852021-04-14 23:45:32 +0000259cc_benchmark {
260 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700261 defaults: [
262 "binder_test_defaults",
263 "libbinder_tls_shared_deps",
264 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000265 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000266 target: {
267 darwin: {
268 enabled: false,
269 },
270 },
Steven Morelandcda60852021-04-14 23:45:32 +0000271 srcs: [
272 "binderRpcBenchmark.cpp",
273 "IBinderRpcBenchmark.aidl",
274 ],
275 shared_libs: [
276 "libbase",
277 "libbinder",
278 "liblog",
279 "libutils",
280 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700281 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700282 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700283 "libbinder_tls_static",
284 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000285}
286
Steven Moreland5553ac42020-11-11 02:14:45 +0000287cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700288 name: "binderRpcWireProtocolTest",
289 host_supported: true,
290 target: {
291 darwin: {
292 enabled: false,
293 },
294 android: {
295 test_suites: ["vts"],
296 },
297 },
298 defaults: [
299 "binder_test_defaults",
300 ],
301 srcs: [
302 "binderRpcWireProtocolTest.cpp",
303 ],
304 shared_libs: [
305 "libbinder",
306 "libbase",
307 "libutils",
308 "libcutils",
309 "liblog",
310 ],
311 test_suites: ["general-tests"],
312}
313
314cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700315 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700316 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700317 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700318 shared_libs: [
319 "libbinder",
320 "libutils",
321 ],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700322 cflags: [
323 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700324 "-Wno-missing-field-initializers",
325 "-Wno-sign-compare",
326 "-O3",
327 ],
328}
Wei Wang78f2a372016-10-20 23:18:17 -0700329
330cc_test {
331 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700332 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700333 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700334 shared_libs: [
335 "libbinder",
336 "libutils",
337 "libbase",
338 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700339 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700340}
Howard Chenc135dbc2017-03-25 17:12:59 +0800341
342cc_test {
343 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700344 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700345 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800346 shared_libs: [
347 "libbinder",
348 "libutils",
349 "libbase",
350 ],
351}
Dan Stozad630e522016-12-01 15:16:31 -0800352
353cc_test {
354 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700355 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700356 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800357
358 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800359 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800360 ],
361
362 cpp_std: "experimental",
363 gnu_extensions: false,
364
365 shared_libs: [
366 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700367 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800368 "liblog",
369 "libutils",
370 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000371 test_suites: [
372 "device-tests",
373 "vts",
374 ],
Dan Shi80ada592019-09-13 09:17:17 -0700375 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800376}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700377
Steven Morelandf23dae22020-10-27 19:34:55 +0000378cc_test {
379 name: "binderClearBufTest",
380 defaults: ["binder_test_defaults"],
381 srcs: [
382 "binderClearBufTest.cpp",
383 ],
384
385 shared_libs: [
386 "libbase",
387 "libbinder",
388 "liblog",
389 "libutils",
390 ],
391
392 test_suites: ["general-tests"],
393 require_root: true,
394}
395
Steven Moreland12300a02019-08-02 13:27:15 -0700396aidl_interface {
397 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900398 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700399 srcs: [
400 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700401 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000402 backend: {
403 java: {
404 enabled: false,
405 },
406 },
Steven Moreland12300a02019-08-02 13:27:15 -0700407}
408
Steven Morelanddea3cf92019-07-16 18:06:55 -0700409cc_test {
410 name: "binderStabilityTest",
411 defaults: ["binder_test_defaults"],
412 srcs: [
413 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700414 ],
415
Steven Moreland13f84662020-07-23 21:30:41 +0000416 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700417 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700418 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700419 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700420 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700421 "libutils",
422 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700423 static_libs: [
424 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900425 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700426 ],
427
Steven Morelandea7659e2022-02-03 00:04:06 +0000428 test_suites: [
429 "device-tests",
430 "vts",
431 ],
Dan Shi302709b2019-09-19 15:28:15 -0700432 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700433}
Steven Moreland042ae822020-05-27 17:45:17 +0000434
435cc_test {
436 name: "binderAllocationLimits",
437 defaults: ["binder_test_defaults"],
438 srcs: ["binderAllocationLimits.cpp"],
439 shared_libs: [
440 "libbinder",
441 "liblog",
442 "libutils",
443 "libutilscallstack",
444 "libbase",
445 ],
446 test_suites: ["device-tests"],
447 require_root: true,
448}
Andy Hung73a14702020-11-24 13:04:46 -0800449
450cc_benchmark {
451 name: "binderParcelBenchmark",
452 defaults: ["binder_test_defaults"],
453 srcs: ["binderParcelBenchmark.cpp"],
454 shared_libs: [
455 "libbase",
456 "libbinder",
457 "liblog",
458 "libutils",
459 ],
460}
Yifan Hongaf766e62021-06-14 13:24:19 -0700461
462cc_test_host {
463 name: "binderUtilsHostTest",
464 defaults: ["binder_test_defaults"],
465 srcs: ["binderUtilsHostTest.cpp"],
466 shared_libs: [
467 "libbase",
468 "libbinder",
469 ],
470 static_libs: [
471 "libgmock",
472 ],
473 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700474 target: {
475 darwin: {
476 enabled: false,
477 },
478 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700479}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700480
481cc_test_host {
482 name: "binderHostDeviceTest",
483 defaults: ["binder_test_defaults"],
484 srcs: ["binderHostDeviceTest.cpp"],
485 test_config: "binderHostDeviceTest.xml",
486 shared_libs: [
487 "libbase",
488 "libbinder",
489 "liblog",
490 "libutils",
491 ],
492 static_libs: [
493 "libgmock",
494 ],
495 target_required: [
496 "binderHostDeviceTestService",
497 ],
498 test_suites: ["general-tests"],
499 target: {
500 darwin: {
501 enabled: false,
502 },
503 },
504 test_options: {
505 unit_test: false,
506 },
507}
508
509cc_test {
510 name: "binderHostDeviceTestService",
511 // The binary is named differently from the module so that PushFilePreparer pushes the binary
512 // directly, not the test module directory.
513 stem: "binderHostDeviceTest-service",
514 defaults: ["binder_test_defaults"],
515 gtest: false,
516 auto_gen_config: false,
517 srcs: ["binderHostDeviceTestService.cpp"],
518 shared_libs: [
519 "libbase",
520 "libbinder",
521 "liblog",
522 "libutils",
523 ],
524 test_suites: ["general-tests"],
525}