blob: 5e5c495e792f7e9ad71afbf5acfea32b70f92c97 [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",
101 ],
Steven Morelandcefba612020-11-05 22:57:06 +0000102 shared_libs: [
103 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -0700104 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +0000105 "libutils",
106 ],
107 test_suites: ["general-tests"],
108}
109
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800110cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -0700111 name: "binderLibTest",
112 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +0800113 product_variables: {
114 binder32bit: {
115 cflags: ["-DBINDER_IPC_32BIT=1"],
116 },
117 },
118
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",
138 host_supported: true,
139 unstable: true,
140 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700141 "BinderRpcTestClientInfo.aidl",
142 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000143 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000144 "IBinderRpcSession.aidl",
145 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700146 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000147 ],
148 backend: {
149 java: {
150 enabled: false,
151 },
152 },
153}
154
Yifan Honge0e53282021-09-23 18:37:21 -0700155cc_library_static {
156 name: "libbinder_tls_test_utils",
157 host_supported: true,
158 target: {
159 darwin: {
160 enabled: false,
161 },
162 },
163 defaults: [
164 "binder_test_defaults",
165 "libbinder_tls_shared_deps",
166 ],
167 shared_libs: [
168 "libbinder",
169 "libbase",
170 "liblog",
171 ],
172 static_libs: [
173 "libbinder_tls_static",
174 ],
175 srcs: [
176 "RpcTlsTestUtils.cpp",
177 ],
178 export_include_dirs: [
179 "include_tls_test_utils",
180 ],
181 visibility: [
182 ":__subpackages__",
183 ],
184}
185
Dan Willemsen59e086f2016-07-25 17:13:45 -0700186cc_test {
Steven Moreland5553ac42020-11-11 02:14:45 +0000187 name: "binderRpcTest",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000188 host_supported: true,
189 target: {
190 darwin: {
191 enabled: false,
192 },
Steven Moreland1d448af2021-04-20 01:05:18 +0000193 android: {
194 test_suites: ["vts"],
195 },
Steven Morelandf6ec4632021-04-01 16:20:47 +0000196 },
Steven Moreland37aff182021-03-26 02:04:16 +0000197 defaults: [
198 "binder_test_defaults",
199 "libbinder_ndk_host_user",
Yifan Hong92409752021-07-30 21:25:32 -0700200 "libbinder_tls_shared_deps",
Steven Moreland37aff182021-03-26 02:04:16 +0000201 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000202
203 srcs: [
Steven Moreland5553ac42020-11-11 02:14:45 +0000204 "binderRpcTest.cpp",
205 ],
206 shared_libs: [
207 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000208 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000209 "libbase",
210 "libutils",
211 "libcutils",
212 "liblog",
213 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000214 static_libs: [
Yifan Hong92409752021-07-30 21:25:32 -0700215 "libbinder_tls_static",
Yifan Honge0e53282021-09-23 18:37:21 -0700216 "libbinder_tls_test_utils",
Steven Moreland37aff182021-03-26 02:04:16 +0000217 "binderRpcTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900218 "binderRpcTestIface-ndk",
Steven Moreland37aff182021-03-26 02:04:16 +0000219 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000220 test_suites: ["general-tests"],
221 require_root: true,
222}
223
Yifan Hongff73aa92021-09-17 21:28:01 -0700224cc_test {
225 name: "RpcTlsUtilsTest",
226 host_supported: true,
227 target: {
228 darwin: {
229 enabled: false,
230 },
231 android: {
232 test_suites: ["vts"],
233 },
234 },
235 defaults: [
236 "binder_test_defaults",
237 "libbinder_tls_shared_deps",
238 ],
239 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700240 "RpcTlsUtilsTest.cpp",
241 ],
242 shared_libs: [
243 "libbinder",
244 "libbase",
245 "libutils",
246 "liblog",
247 ],
248 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700249 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700250 "libbinder_tls_static",
251 ],
Steven Morelandea7659e2022-02-03 00:04:06 +0000252 test_suites: [
253 "general-tests",
254 "device-tests",
255 ],
Yifan Hongff73aa92021-09-17 21:28:01 -0700256}
257
Steven Morelandcda60852021-04-14 23:45:32 +0000258cc_benchmark {
259 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700260 defaults: [
261 "binder_test_defaults",
262 "libbinder_tls_shared_deps",
263 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000264 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000265 target: {
266 darwin: {
267 enabled: false,
268 },
269 },
Steven Morelandcda60852021-04-14 23:45:32 +0000270 srcs: [
271 "binderRpcBenchmark.cpp",
272 "IBinderRpcBenchmark.aidl",
273 ],
274 shared_libs: [
275 "libbase",
276 "libbinder",
277 "liblog",
278 "libutils",
279 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700280 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700281 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700282 "libbinder_tls_static",
283 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000284}
285
Steven Moreland5553ac42020-11-11 02:14:45 +0000286cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700287 name: "binderRpcWireProtocolTest",
288 host_supported: true,
289 target: {
290 darwin: {
291 enabled: false,
292 },
293 android: {
294 test_suites: ["vts"],
295 },
296 },
297 defaults: [
298 "binder_test_defaults",
299 ],
300 srcs: [
301 "binderRpcWireProtocolTest.cpp",
302 ],
303 shared_libs: [
304 "libbinder",
305 "libbase",
306 "libutils",
307 "libcutils",
308 "liblog",
309 ],
310 test_suites: ["general-tests"],
311}
312
313cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700314 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700315 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700316 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700317 shared_libs: [
318 "libbinder",
319 "libutils",
320 ],
321 clang: true,
322 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}