blob: 54f1f07ad0af91a3a6d870ddc0727a9128178f67 [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: [
Steven Moreland659416d2021-05-11 00:47:50 +0000123 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000124 "IBinderRpcSession.aidl",
125 "IBinderRpcTest.aidl",
126 ],
127 backend: {
128 java: {
129 enabled: false,
130 },
131 },
132}
133
Dan Willemsen59e086f2016-07-25 17:13:45 -0700134cc_test {
Steven Moreland5553ac42020-11-11 02:14:45 +0000135 name: "binderRpcTest",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000136 host_supported: true,
137 target: {
138 darwin: {
139 enabled: false,
140 },
Steven Moreland1d448af2021-04-20 01:05:18 +0000141 android: {
142 test_suites: ["vts"],
143 },
Steven Morelandf6ec4632021-04-01 16:20:47 +0000144 },
Steven Moreland37aff182021-03-26 02:04:16 +0000145 defaults: [
146 "binder_test_defaults",
147 "libbinder_ndk_host_user",
Yifan Hong92409752021-07-30 21:25:32 -0700148 "libbinder_tls_shared_deps",
Steven Moreland37aff182021-03-26 02:04:16 +0000149 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000150
151 srcs: [
Steven Moreland5553ac42020-11-11 02:14:45 +0000152 "binderRpcTest.cpp",
153 ],
154 shared_libs: [
155 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000156 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000157 "libbase",
158 "libutils",
159 "libcutils",
160 "liblog",
161 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000162 static_libs: [
Yifan Hong92409752021-07-30 21:25:32 -0700163 "libbinder_tls_static",
Steven Moreland37aff182021-03-26 02:04:16 +0000164 "binderRpcTestIface-cpp",
165 "binderRpcTestIface-ndk_platform",
166 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000167 test_suites: ["general-tests"],
168 require_root: true,
169}
170
Steven Morelandcda60852021-04-14 23:45:32 +0000171cc_benchmark {
172 name: "binderRpcBenchmark",
173 defaults: ["binder_test_defaults"],
174 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000175 target: {
176 darwin: {
177 enabled: false,
178 },
179 },
Steven Morelandcda60852021-04-14 23:45:32 +0000180 srcs: [
181 "binderRpcBenchmark.cpp",
182 "IBinderRpcBenchmark.aidl",
183 ],
184 shared_libs: [
185 "libbase",
186 "libbinder",
187 "liblog",
188 "libutils",
189 ],
190}
191
Steven Moreland5553ac42020-11-11 02:14:45 +0000192cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700193 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700194 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700195 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700196 shared_libs: [
197 "libbinder",
198 "libutils",
199 ],
200 clang: true,
201 cflags: [
202 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700203 "-Wno-missing-field-initializers",
204 "-Wno-sign-compare",
205 "-O3",
206 ],
207}
Wei Wang78f2a372016-10-20 23:18:17 -0700208
209cc_test {
210 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700211 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700212 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700213 shared_libs: [
214 "libbinder",
215 "libutils",
216 "libbase",
217 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700218 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700219}
Howard Chenc135dbc2017-03-25 17:12:59 +0800220
221cc_test {
222 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700223 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700224 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800225 shared_libs: [
226 "libbinder",
227 "libutils",
228 "libbase",
229 ],
230}
Dan Stozad630e522016-12-01 15:16:31 -0800231
232cc_test {
233 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700234 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700235 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800236
237 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800238 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800239 ],
240
241 cpp_std: "experimental",
242 gnu_extensions: false,
243
244 shared_libs: [
245 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700246 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800247 "liblog",
248 "libutils",
249 ],
Dan Shieb25b672020-03-26 11:43:04 -0700250 test_suites: ["device-tests", "vts"],
Dan Shi80ada592019-09-13 09:17:17 -0700251 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800252}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700253
Steven Morelandf23dae22020-10-27 19:34:55 +0000254cc_test {
255 name: "binderClearBufTest",
256 defaults: ["binder_test_defaults"],
257 srcs: [
258 "binderClearBufTest.cpp",
259 ],
260
261 shared_libs: [
262 "libbase",
263 "libbinder",
264 "liblog",
265 "libutils",
266 ],
267
268 test_suites: ["general-tests"],
269 require_root: true,
270}
271
Steven Moreland12300a02019-08-02 13:27:15 -0700272aidl_interface {
273 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900274 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700275 srcs: [
276 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700277 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000278 backend: {
279 java: {
280 enabled: false,
281 },
282 },
Steven Moreland12300a02019-08-02 13:27:15 -0700283}
284
Steven Morelanddea3cf92019-07-16 18:06:55 -0700285cc_test {
286 name: "binderStabilityTest",
287 defaults: ["binder_test_defaults"],
288 srcs: [
289 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700290 ],
291
Steven Moreland13f84662020-07-23 21:30:41 +0000292 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700293 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700294 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700295 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700296 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700297 "libutils",
298 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700299 static_libs: [
300 "binderStabilityTestIface-cpp",
301 "binderStabilityTestIface-ndk_platform",
302 ],
303
Steven Moreland13f84662020-07-23 21:30:41 +0000304 test_suites: ["device-tests", "vts"],
Dan Shi302709b2019-09-19 15:28:15 -0700305 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700306}
Steven Moreland042ae822020-05-27 17:45:17 +0000307
308cc_test {
309 name: "binderAllocationLimits",
310 defaults: ["binder_test_defaults"],
311 srcs: ["binderAllocationLimits.cpp"],
312 shared_libs: [
313 "libbinder",
314 "liblog",
315 "libutils",
316 "libutilscallstack",
317 "libbase",
318 ],
319 test_suites: ["device-tests"],
320 require_root: true,
321}
Andy Hung73a14702020-11-24 13:04:46 -0800322
323cc_benchmark {
324 name: "binderParcelBenchmark",
325 defaults: ["binder_test_defaults"],
326 srcs: ["binderParcelBenchmark.cpp"],
327 shared_libs: [
328 "libbase",
329 "libbinder",
330 "liblog",
331 "libutils",
332 ],
333}
Yifan Hongaf766e62021-06-14 13:24:19 -0700334
335cc_test_host {
336 name: "binderUtilsHostTest",
337 defaults: ["binder_test_defaults"],
338 srcs: ["binderUtilsHostTest.cpp"],
339 shared_libs: [
340 "libbase",
341 "libbinder",
342 ],
343 static_libs: [
344 "libgmock",
345 ],
346 test_suites: ["general-tests"],
Yifan Hong44dec542021-06-22 10:47:44 -0700347 target: {
348 darwin: {
349 enabled: false,
350 },
351 },
Yifan Hongaf766e62021-06-14 13:24:19 -0700352}
Yifan Hong1b6f12f2021-06-03 20:01:57 -0700353
354cc_test_host {
355 name: "binderHostDeviceTest",
356 defaults: ["binder_test_defaults"],
357 srcs: ["binderHostDeviceTest.cpp"],
358 test_config: "binderHostDeviceTest.xml",
359 shared_libs: [
360 "libbase",
361 "libbinder",
362 "liblog",
363 "libutils",
364 ],
365 static_libs: [
366 "libgmock",
367 ],
368 target_required: [
369 "binderHostDeviceTestService",
370 ],
371 test_suites: ["general-tests"],
372 target: {
373 darwin: {
374 enabled: false,
375 },
376 },
377 test_options: {
378 unit_test: false,
379 },
380}
381
382cc_test {
383 name: "binderHostDeviceTestService",
384 // The binary is named differently from the module so that PushFilePreparer pushes the binary
385 // directly, not the test module directory.
386 stem: "binderHostDeviceTest-service",
387 defaults: ["binder_test_defaults"],
388 gtest: false,
389 auto_gen_config: false,
390 srcs: ["binderHostDeviceTestService.cpp"],
391 shared_libs: [
392 "libbase",
393 "libbinder",
394 "liblog",
395 "libutils",
396 ],
397 test_suites: ["general-tests"],
398}