blob: 86da5887a81d15760abeed97374d090dcf02b59e [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 Morelandf9f3de22020-05-06 17:14:39 -070040 multilib: { lib32: { suffix: "" } },
Hsin-Yi Chen69295752017-06-07 18:05:05 +080041 cflags: ["-DBINDER_IPC_32BIT=1"],
Steven Morelandf9f3de22020-05-06 17:14:39 -070042 test_suites: ["vts"],
Hsin-Yi Chen69295752017-06-07 18:05:05 +080043}
44
45cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070046 name: "binderDriverInterfaceTest",
47 defaults: ["binder_test_defaults"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070048 product_variables: {
49 binder32bit: {
50 cflags: ["-DBINDER_IPC_32BIT=1"],
51 },
52 },
Yifan Hong4e419d82021-04-26 11:32:56 -070053 header_libs: ["libbinder_headers"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070054 srcs: ["binderDriverInterfaceTest.cpp"],
Dan Shieb25b672020-03-26 11:43:04 -070055 test_suites: ["device-tests", "vts"],
Dan Willemsen59e086f2016-07-25 17:13:45 -070056}
57
58cc_test {
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080059 name: "binderLibTest_IPC_32",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -070060 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -070061 srcs: ["binderLibTest.cpp"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080062 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -070063 "libbase",
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080064 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -070065 "liblog",
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080066 "libutils",
67 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -070068 static_libs: [
69 "libgmock",
70 ],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080071 compile_multilib: "32",
Steven Morelandf9f3de22020-05-06 17:14:39 -070072 multilib: { lib32: { suffix: "" } },
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080073 cflags: ["-DBINDER_IPC_32BIT=1"],
Steven Morelandf9f3de22020-05-06 17:14:39 -070074 test_suites: ["vts"],
75 require_root: true,
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080076}
77
Steven Morelandcefba612020-11-05 22:57:06 +000078// unit test only, which can run on host and doesn't use /dev/binder
79cc_test {
Steven Moreland28318602021-06-25 01:16:29 +000080 name: "binderUnitTest",
Steven Morelandcefba612020-11-05 22:57:06 +000081 host_supported: true,
82 target: {
83 darwin: {
84 enabled: false,
85 },
86 },
Steven Moreland63a2d512021-06-25 01:10:15 +000087 srcs: ["binderParcelUnitTest.cpp", "binderBinderUnitTest.cpp"],
Steven Morelandcefba612020-11-05 22:57:06 +000088 shared_libs: [
89 "libbinder",
Steven Morelandf80809b2021-10-07 18:09:20 -070090 "libcutils",
Steven Morelandcefba612020-11-05 22:57:06 +000091 "libutils",
92 ],
93 test_suites: ["general-tests"],
94}
95
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080096cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070097 name: "binderLibTest",
98 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080099 product_variables: {
100 binder32bit: {
101 cflags: ["-DBINDER_IPC_32BIT=1"],
102 },
103 },
104
Dan Willemsen59e086f2016-07-25 17:13:45 -0700105 srcs: ["binderLibTest.cpp"],
106 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700107 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700108 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700109 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700110 "libutils",
111 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700112 static_libs: [
113 "libgmock",
114 ],
Dan Shieb25b672020-03-26 11:43:04 -0700115 test_suites: ["device-tests", "vts"],
Dan Shi80ada592019-09-13 09:17:17 -0700116 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700117}
118
Steven Moreland37aff182021-03-26 02:04:16 +0000119aidl_interface {
120 name: "binderRpcTestIface",
121 host_supported: true,
122 unstable: true,
123 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700124 "BinderRpcTestClientInfo.aidl",
125 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000126 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000127 "IBinderRpcSession.aidl",
128 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700129 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000130 ],
131 backend: {
132 java: {
133 enabled: false,
134 },
135 },
136}
137
Yifan Honge0e53282021-09-23 18:37:21 -0700138cc_library_static {
139 name: "libbinder_tls_test_utils",
140 host_supported: true,
141 target: {
142 darwin: {
143 enabled: false,
144 },
145 },
146 defaults: [
147 "binder_test_defaults",
148 "libbinder_tls_shared_deps",
149 ],
150 shared_libs: [
151 "libbinder",
152 "libbase",
153 "liblog",
154 ],
155 static_libs: [
156 "libbinder_tls_static",
157 ],
158 srcs: [
159 "RpcTlsTestUtils.cpp",
160 ],
161 export_include_dirs: [
162 "include_tls_test_utils",
163 ],
164 visibility: [
165 ":__subpackages__",
166 ],
167}
168
Dan Willemsen59e086f2016-07-25 17:13:45 -0700169cc_test {
Steven Moreland5553ac42020-11-11 02:14:45 +0000170 name: "binderRpcTest",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000171 host_supported: true,
172 target: {
173 darwin: {
174 enabled: false,
175 },
Steven Moreland1d448af2021-04-20 01:05:18 +0000176 android: {
177 test_suites: ["vts"],
178 },
Steven Morelandf6ec4632021-04-01 16:20:47 +0000179 },
Steven Moreland37aff182021-03-26 02:04:16 +0000180 defaults: [
181 "binder_test_defaults",
182 "libbinder_ndk_host_user",
Yifan Hong92409752021-07-30 21:25:32 -0700183 "libbinder_tls_shared_deps",
Steven Moreland37aff182021-03-26 02:04:16 +0000184 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000185
186 srcs: [
Steven Moreland5553ac42020-11-11 02:14:45 +0000187 "binderRpcTest.cpp",
188 ],
189 shared_libs: [
190 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000191 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000192 "libbase",
193 "libutils",
194 "libcutils",
195 "liblog",
196 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000197 static_libs: [
Yifan Hong92409752021-07-30 21:25:32 -0700198 "libbinder_tls_static",
Yifan Honge0e53282021-09-23 18:37:21 -0700199 "libbinder_tls_test_utils",
Steven Moreland37aff182021-03-26 02:04:16 +0000200 "binderRpcTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900201 "binderRpcTestIface-ndk",
Steven Moreland37aff182021-03-26 02:04:16 +0000202 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000203 test_suites: ["general-tests"],
204 require_root: true,
205}
206
Yifan Hongff73aa92021-09-17 21:28:01 -0700207cc_test {
208 name: "RpcTlsUtilsTest",
209 host_supported: true,
210 target: {
211 darwin: {
212 enabled: false,
213 },
214 android: {
215 test_suites: ["vts"],
216 },
217 },
218 defaults: [
219 "binder_test_defaults",
220 "libbinder_tls_shared_deps",
221 ],
222 srcs: [
Yifan Hongff73aa92021-09-17 21:28:01 -0700223 "RpcTlsUtilsTest.cpp",
224 ],
225 shared_libs: [
226 "libbinder",
227 "libbase",
228 "libutils",
229 "liblog",
230 ],
231 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700232 "libbinder_tls_test_utils",
Yifan Hongff73aa92021-09-17 21:28:01 -0700233 "libbinder_tls_static",
234 ],
235 test_suites: ["general-tests", "device-tests"],
236}
237
Steven Morelandcda60852021-04-14 23:45:32 +0000238cc_benchmark {
239 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700240 defaults: [
241 "binder_test_defaults",
242 "libbinder_tls_shared_deps",
243 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000244 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000245 target: {
246 darwin: {
247 enabled: false,
248 },
249 },
Steven Morelandcda60852021-04-14 23:45:32 +0000250 srcs: [
251 "binderRpcBenchmark.cpp",
252 "IBinderRpcBenchmark.aidl",
253 ],
254 shared_libs: [
255 "libbase",
256 "libbinder",
257 "liblog",
258 "libutils",
259 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700260 static_libs: [
Yifan Honge0e53282021-09-23 18:37:21 -0700261 "libbinder_tls_test_utils",
Yifan Hongaecdd172021-09-21 14:53:13 -0700262 "libbinder_tls_static",
263 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000264}
265
Steven Moreland5553ac42020-11-11 02:14:45 +0000266cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700267 name: "binderRpcWireProtocolTest",
268 host_supported: true,
269 target: {
270 darwin: {
271 enabled: false,
272 },
273 android: {
274 test_suites: ["vts"],
275 },
276 },
277 defaults: [
278 "binder_test_defaults",
279 ],
280 srcs: [
281 "binderRpcWireProtocolTest.cpp",
282 ],
283 shared_libs: [
284 "libbinder",
285 "libbase",
286 "libutils",
287 "libcutils",
288 "liblog",
289 ],
290 test_suites: ["general-tests"],
291}
292
293cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700294 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700295 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700296 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700297 shared_libs: [
298 "libbinder",
299 "libutils",
300 ],
301 clang: true,
302 cflags: [
303 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700304 "-Wno-missing-field-initializers",
305 "-Wno-sign-compare",
306 "-O3",
307 ],
308}
Wei Wang78f2a372016-10-20 23:18:17 -0700309
310cc_test {
311 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700312 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700313 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700314 shared_libs: [
315 "libbinder",
316 "libutils",
317 "libbase",
318 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700319 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700320}
Howard Chenc135dbc2017-03-25 17:12:59 +0800321
322cc_test {
323 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700324 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700325 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800326 shared_libs: [
327 "libbinder",
328 "libutils",
329 "libbase",
330 ],
331}
Dan Stozad630e522016-12-01 15:16:31 -0800332
333cc_test {
334 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700335 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700336 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800337
338 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800339 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800340 ],
341
342 cpp_std: "experimental",
343 gnu_extensions: false,
344
345 shared_libs: [
346 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700347 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800348 "liblog",
349 "libutils",
350 ],
Dan Shieb25b672020-03-26 11:43:04 -0700351 test_suites: ["device-tests", "vts"],
Dan Shi80ada592019-09-13 09:17:17 -0700352 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800353}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700354
Steven Morelandf23dae22020-10-27 19:34:55 +0000355cc_test {
356 name: "binderClearBufTest",
357 defaults: ["binder_test_defaults"],
358 srcs: [
359 "binderClearBufTest.cpp",
360 ],
361
362 shared_libs: [
363 "libbase",
364 "libbinder",
365 "liblog",
366 "libutils",
367 ],
368
369 test_suites: ["general-tests"],
370 require_root: true,
371}
372
Steven Moreland12300a02019-08-02 13:27:15 -0700373aidl_interface {
374 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900375 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700376 srcs: [
377 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700378 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000379 backend: {
380 java: {
381 enabled: false,
382 },
383 },
Steven Moreland12300a02019-08-02 13:27:15 -0700384}
385
Steven Morelanddea3cf92019-07-16 18:06:55 -0700386cc_test {
387 name: "binderStabilityTest",
388 defaults: ["binder_test_defaults"],
389 srcs: [
390 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700391 ],
392
Steven Moreland13f84662020-07-23 21:30:41 +0000393 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700394 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700395 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700396 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700397 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700398 "libutils",
399 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700400 static_libs: [
401 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900402 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700403 ],
404
Steven Moreland13f84662020-07-23 21:30:41 +0000405 test_suites: ["device-tests", "vts"],
Dan Shi302709b2019-09-19 15:28:15 -0700406 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700407}
Steven Moreland042ae822020-05-27 17:45:17 +0000408
409cc_test {
410 name: "binderAllocationLimits",
411 defaults: ["binder_test_defaults"],
412 srcs: ["binderAllocationLimits.cpp"],
413 shared_libs: [
414 "libbinder",
415 "liblog",
416 "libutils",
417 "libutilscallstack",
418 "libbase",
419 ],
420 test_suites: ["device-tests"],
421 require_root: true,
422}
Andy Hung73a14702020-11-24 13:04:46 -0800423
424cc_benchmark {
425 name: "binderParcelBenchmark",
426 defaults: ["binder_test_defaults"],
427 srcs: ["binderParcelBenchmark.cpp"],
428 shared_libs: [
429 "libbase",
430 "libbinder",
431 "liblog",
432 "libutils",
433 ],
434}
Yifan Hongaf766e62021-06-14 13:24:19 -0700435
436cc_test_host {
437 name: "binderUtilsHostTest",
438 defaults: ["binder_test_defaults"],
439 srcs: ["binderUtilsHostTest.cpp"],
440 shared_libs: [
441 "libbase",
442 "libbinder",
443 ],
444 static_libs: [
445 "libgmock",
446 ],
447 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700448 target: {
449 darwin: {
450 enabled: false,
451 },
452 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700453}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700454
455cc_test_host {
456 name: "binderHostDeviceTest",
457 defaults: ["binder_test_defaults"],
458 srcs: ["binderHostDeviceTest.cpp"],
459 test_config: "binderHostDeviceTest.xml",
460 shared_libs: [
461 "libbase",
462 "libbinder",
463 "liblog",
464 "libutils",
465 ],
466 static_libs: [
467 "libgmock",
468 ],
469 target_required: [
470 "binderHostDeviceTestService",
471 ],
472 test_suites: ["general-tests"],
473 target: {
474 darwin: {
475 enabled: false,
476 },
477 },
478 test_options: {
479 unit_test: false,
480 },
481}
482
483cc_test {
484 name: "binderHostDeviceTestService",
485 // The binary is named differently from the module so that PushFilePreparer pushes the binary
486 // directly, not the test module directory.
487 stem: "binderHostDeviceTest-service",
488 defaults: ["binder_test_defaults"],
489 gtest: false,
490 auto_gen_config: false,
491 srcs: ["binderHostDeviceTestService.cpp"],
492 shared_libs: [
493 "libbase",
494 "libbinder",
495 "liblog",
496 "libutils",
497 ],
498 test_suites: ["general-tests"],
499}