blob: 71c0e86460c6ef2c4b784974d394249390b5d76d [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",
90 "libutils",
91 ],
92 test_suites: ["general-tests"],
93}
94
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080095cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070096 name: "binderLibTest",
97 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080098 product_variables: {
99 binder32bit: {
100 cflags: ["-DBINDER_IPC_32BIT=1"],
101 },
102 },
103
Dan Willemsen59e086f2016-07-25 17:13:45 -0700104 srcs: ["binderLibTest.cpp"],
105 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700106 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700107 "libbinder",
Yifan Hong8b890852021-06-10 13:44:09 -0700108 "liblog",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700109 "libutils",
110 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700111 static_libs: [
112 "libgmock",
113 ],
Dan Shieb25b672020-03-26 11:43:04 -0700114 test_suites: ["device-tests", "vts"],
Dan Shi80ada592019-09-13 09:17:17 -0700115 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700116}
117
Steven Moreland37aff182021-03-26 02:04:16 +0000118aidl_interface {
119 name: "binderRpcTestIface",
120 host_supported: true,
121 unstable: true,
122 srcs: [
Yifan Hong1deca4b2021-09-10 16:16:44 -0700123 "BinderRpcTestClientInfo.aidl",
124 "BinderRpcTestServerInfo.aidl",
Steven Moreland659416d2021-05-11 00:47:50 +0000125 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000126 "IBinderRpcSession.aidl",
127 "IBinderRpcTest.aidl",
Yifan Hong1deca4b2021-09-10 16:16:44 -0700128 "ParcelableCertificateData.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000129 ],
130 backend: {
131 java: {
132 enabled: false,
133 },
134 },
135}
136
Dan Willemsen59e086f2016-07-25 17:13:45 -0700137cc_test {
Steven Moreland5553ac42020-11-11 02:14:45 +0000138 name: "binderRpcTest",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000139 host_supported: true,
140 target: {
141 darwin: {
142 enabled: false,
143 },
Steven Moreland1d448af2021-04-20 01:05:18 +0000144 android: {
145 test_suites: ["vts"],
146 },
Steven Morelandf6ec4632021-04-01 16:20:47 +0000147 },
Steven Moreland37aff182021-03-26 02:04:16 +0000148 defaults: [
149 "binder_test_defaults",
150 "libbinder_ndk_host_user",
Yifan Hong92409752021-07-30 21:25:32 -0700151 "libbinder_tls_shared_deps",
Steven Moreland37aff182021-03-26 02:04:16 +0000152 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000153
154 srcs: [
Steven Moreland5553ac42020-11-11 02:14:45 +0000155 "binderRpcTest.cpp",
Yifan Hongffdaf952021-09-17 18:08:38 -0700156 "RpcAuthTesting.cpp",
Yifan Hong13c90062021-09-09 14:59:53 -0700157 "RpcCertificateVerifierSimple.cpp",
Steven Moreland5553ac42020-11-11 02:14:45 +0000158 ],
159 shared_libs: [
160 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000161 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000162 "libbase",
163 "libutils",
164 "libcutils",
165 "liblog",
166 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000167 static_libs: [
Yifan Hong92409752021-07-30 21:25:32 -0700168 "libbinder_tls_static",
Steven Moreland37aff182021-03-26 02:04:16 +0000169 "binderRpcTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900170 "binderRpcTestIface-ndk",
Steven Moreland37aff182021-03-26 02:04:16 +0000171 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000172 test_suites: ["general-tests"],
173 require_root: true,
174}
175
Yifan Hongff73aa92021-09-17 21:28:01 -0700176cc_test {
177 name: "RpcTlsUtilsTest",
178 host_supported: true,
179 target: {
180 darwin: {
181 enabled: false,
182 },
183 android: {
184 test_suites: ["vts"],
185 },
186 },
187 defaults: [
188 "binder_test_defaults",
189 "libbinder_tls_shared_deps",
190 ],
191 srcs: [
192 "RpcAuthTesting.cpp",
193 "RpcTlsUtilsTest.cpp",
194 ],
195 shared_libs: [
196 "libbinder",
197 "libbase",
198 "libutils",
199 "liblog",
200 ],
201 static_libs: [
202 "libbinder_tls_static",
203 ],
204 test_suites: ["general-tests", "device-tests"],
205}
206
Steven Morelandcda60852021-04-14 23:45:32 +0000207cc_benchmark {
208 name: "binderRpcBenchmark",
Yifan Hongaecdd172021-09-21 14:53:13 -0700209 defaults: [
210 "binder_test_defaults",
211 "libbinder_tls_shared_deps",
212 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000213 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000214 target: {
215 darwin: {
216 enabled: false,
217 },
218 },
Steven Morelandcda60852021-04-14 23:45:32 +0000219 srcs: [
220 "binderRpcBenchmark.cpp",
221 "IBinderRpcBenchmark.aidl",
Yifan Hongaecdd172021-09-21 14:53:13 -0700222 "RpcAuthTesting.cpp",
Steven Morelandcda60852021-04-14 23:45:32 +0000223 ],
224 shared_libs: [
225 "libbase",
226 "libbinder",
227 "liblog",
228 "libutils",
229 ],
Yifan Hongaecdd172021-09-21 14:53:13 -0700230 static_libs: [
231 "libbinder_tls_static",
232 ],
Steven Morelandcda60852021-04-14 23:45:32 +0000233}
234
Steven Moreland5553ac42020-11-11 02:14:45 +0000235cc_test {
Steven Moreland59640db2021-07-22 17:19:31 -0700236 name: "binderRpcWireProtocolTest",
237 host_supported: true,
238 target: {
239 darwin: {
240 enabled: false,
241 },
242 android: {
243 test_suites: ["vts"],
244 },
245 },
246 defaults: [
247 "binder_test_defaults",
248 ],
249 srcs: [
250 "binderRpcWireProtocolTest.cpp",
251 ],
252 shared_libs: [
253 "libbinder",
254 "libbase",
255 "libutils",
256 "libcutils",
257 "liblog",
258 ],
259 test_suites: ["general-tests"],
260}
261
262cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700263 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700264 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700265 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700266 shared_libs: [
267 "libbinder",
268 "libutils",
269 ],
270 clang: true,
271 cflags: [
272 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700273 "-Wno-missing-field-initializers",
274 "-Wno-sign-compare",
275 "-O3",
276 ],
277}
Wei Wang78f2a372016-10-20 23:18:17 -0700278
279cc_test {
280 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700281 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700282 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700283 shared_libs: [
284 "libbinder",
285 "libutils",
286 "libbase",
287 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700288 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700289}
Howard Chenc135dbc2017-03-25 17:12:59 +0800290
291cc_test {
292 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700293 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700294 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800295 shared_libs: [
296 "libbinder",
297 "libutils",
298 "libbase",
299 ],
300}
Dan Stozad630e522016-12-01 15:16:31 -0800301
302cc_test {
303 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700304 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700305 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800306
307 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800308 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800309 ],
310
311 cpp_std: "experimental",
312 gnu_extensions: false,
313
314 shared_libs: [
315 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700316 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800317 "liblog",
318 "libutils",
319 ],
Dan Shieb25b672020-03-26 11:43:04 -0700320 test_suites: ["device-tests", "vts"],
Dan Shi80ada592019-09-13 09:17:17 -0700321 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800322}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700323
Steven Morelandf23dae22020-10-27 19:34:55 +0000324cc_test {
325 name: "binderClearBufTest",
326 defaults: ["binder_test_defaults"],
327 srcs: [
328 "binderClearBufTest.cpp",
329 ],
330
331 shared_libs: [
332 "libbase",
333 "libbinder",
334 "liblog",
335 "libutils",
336 ],
337
338 test_suites: ["general-tests"],
339 require_root: true,
340}
341
Steven Moreland12300a02019-08-02 13:27:15 -0700342aidl_interface {
343 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900344 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700345 srcs: [
346 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700347 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000348 backend: {
349 java: {
350 enabled: false,
351 },
352 },
Steven Moreland12300a02019-08-02 13:27:15 -0700353}
354
Steven Morelanddea3cf92019-07-16 18:06:55 -0700355cc_test {
356 name: "binderStabilityTest",
357 defaults: ["binder_test_defaults"],
358 srcs: [
359 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700360 ],
361
Steven Moreland13f84662020-07-23 21:30:41 +0000362 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700363 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700364 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700365 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700366 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700367 "libutils",
368 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700369 static_libs: [
370 "binderStabilityTestIface-cpp",
Jiyong Park9a9427c2021-08-09 09:01:15 +0900371 "binderStabilityTestIface-ndk",
Steven Moreland12300a02019-08-02 13:27:15 -0700372 ],
373
Steven Moreland13f84662020-07-23 21:30:41 +0000374 test_suites: ["device-tests", "vts"],
Dan Shi302709b2019-09-19 15:28:15 -0700375 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700376}
Steven Moreland042ae822020-05-27 17:45:17 +0000377
378cc_test {
379 name: "binderAllocationLimits",
380 defaults: ["binder_test_defaults"],
381 srcs: ["binderAllocationLimits.cpp"],
382 shared_libs: [
383 "libbinder",
384 "liblog",
385 "libutils",
386 "libutilscallstack",
387 "libbase",
388 ],
389 test_suites: ["device-tests"],
390 require_root: true,
391}
Andy Hung73a14702020-11-24 13:04:46 -0800392
393cc_benchmark {
394 name: "binderParcelBenchmark",
395 defaults: ["binder_test_defaults"],
396 srcs: ["binderParcelBenchmark.cpp"],
397 shared_libs: [
398 "libbase",
399 "libbinder",
400 "liblog",
401 "libutils",
402 ],
403}
Yifan Hongaf766e62021-06-14 13:24:19 -0700404
405cc_test_host {
406 name: "binderUtilsHostTest",
407 defaults: ["binder_test_defaults"],
408 srcs: ["binderUtilsHostTest.cpp"],
409 shared_libs: [
410 "libbase",
411 "libbinder",
412 ],
413 static_libs: [
414 "libgmock",
415 ],
416 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700417 target: {
418 darwin: {
419 enabled: false,
420 },
421 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700422}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700423
424cc_test_host {
425 name: "binderHostDeviceTest",
426 defaults: ["binder_test_defaults"],
427 srcs: ["binderHostDeviceTest.cpp"],
428 test_config: "binderHostDeviceTest.xml",
429 shared_libs: [
430 "libbase",
431 "libbinder",
432 "liblog",
433 "libutils",
434 ],
435 static_libs: [
436 "libgmock",
437 ],
438 target_required: [
439 "binderHostDeviceTestService",
440 ],
441 test_suites: ["general-tests"],
442 target: {
443 darwin: {
444 enabled: false,
445 },
446 },
447 test_options: {
448 unit_test: false,
449 },
450}
451
452cc_test {
453 name: "binderHostDeviceTestService",
454 // The binary is named differently from the module so that PushFilePreparer pushes the binary
455 // directly, not the test module directory.
456 stem: "binderHostDeviceTest-service",
457 defaults: ["binder_test_defaults"],
458 gtest: false,
459 auto_gen_config: false,
460 srcs: ["binderHostDeviceTestService.cpp"],
461 shared_libs: [
462 "libbase",
463 "libbinder",
464 "liblog",
465 "libutils",
466 ],
467 test_suites: ["general-tests"],
468}