blob: 0aa31398998ca54f0e6afd584dd8c96b6d55b8c8 [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",
65 "libutils",
66 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -070067 static_libs: [
68 "libgmock",
69 ],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080070 compile_multilib: "32",
Steven Morelandf9f3de22020-05-06 17:14:39 -070071 multilib: { lib32: { suffix: "" } },
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080072 cflags: ["-DBINDER_IPC_32BIT=1"],
Steven Morelandf9f3de22020-05-06 17:14:39 -070073 test_suites: ["vts"],
74 require_root: true,
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080075}
76
Steven Morelandcefba612020-11-05 22:57:06 +000077// unit test only, which can run on host and doesn't use /dev/binder
78cc_test {
79 name: "binderParcelTest",
80 host_supported: true,
81 target: {
82 darwin: {
83 enabled: false,
84 },
85 },
86 srcs: ["binderParcelTest.cpp"],
87 shared_libs: [
88 "libbinder",
89 "libutils",
90 ],
91 test_suites: ["general-tests"],
92}
93
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080094cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070095 name: "binderLibTest",
96 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080097 product_variables: {
98 binder32bit: {
99 cflags: ["-DBINDER_IPC_32BIT=1"],
100 },
101 },
102
Dan Willemsen59e086f2016-07-25 17:13:45 -0700103 srcs: ["binderLibTest.cpp"],
104 shared_libs: [
Yifan Hong84bedeb2021-04-21 21:37:17 -0700105 "libbase",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700106 "libbinder",
107 "libutils",
108 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700109 static_libs: [
110 "libgmock",
111 ],
Dan Shieb25b672020-03-26 11:43:04 -0700112 test_suites: ["device-tests", "vts"],
Dan Shi80ada592019-09-13 09:17:17 -0700113 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700114}
115
Steven Moreland37aff182021-03-26 02:04:16 +0000116aidl_interface {
117 name: "binderRpcTestIface",
118 host_supported: true,
119 unstable: true,
120 srcs: [
Steven Moreland659416d2021-05-11 00:47:50 +0000121 "IBinderRpcCallback.aidl",
Steven Moreland37aff182021-03-26 02:04:16 +0000122 "IBinderRpcSession.aidl",
123 "IBinderRpcTest.aidl",
124 ],
125 backend: {
126 java: {
127 enabled: false,
128 },
129 },
130}
131
Dan Willemsen59e086f2016-07-25 17:13:45 -0700132cc_test {
Steven Moreland5553ac42020-11-11 02:14:45 +0000133 name: "binderRpcTest",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000134 host_supported: true,
135 target: {
136 darwin: {
137 enabled: false,
138 },
Steven Moreland1d448af2021-04-20 01:05:18 +0000139 android: {
140 test_suites: ["vts"],
141 },
Steven Morelandf6ec4632021-04-01 16:20:47 +0000142 },
Steven Moreland37aff182021-03-26 02:04:16 +0000143 defaults: [
144 "binder_test_defaults",
145 "libbinder_ndk_host_user",
146 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000147
148 srcs: [
Steven Moreland5553ac42020-11-11 02:14:45 +0000149 "binderRpcTest.cpp",
150 ],
151 shared_libs: [
152 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000153 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000154 "libbase",
155 "libutils",
156 "libcutils",
157 "liblog",
158 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000159 static_libs: [
160 "binderRpcTestIface-cpp",
161 "binderRpcTestIface-ndk_platform",
162 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000163 test_suites: ["general-tests"],
164 require_root: true,
165}
166
Steven Morelandcda60852021-04-14 23:45:32 +0000167cc_benchmark {
168 name: "binderRpcBenchmark",
169 defaults: ["binder_test_defaults"],
170 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000171 target: {
172 darwin: {
173 enabled: false,
174 },
175 },
Steven Morelandcda60852021-04-14 23:45:32 +0000176 srcs: [
177 "binderRpcBenchmark.cpp",
178 "IBinderRpcBenchmark.aidl",
179 ],
180 shared_libs: [
181 "libbase",
182 "libbinder",
183 "liblog",
184 "libutils",
185 ],
186}
187
Steven Moreland5553ac42020-11-11 02:14:45 +0000188cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700189 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700190 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700191 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700192 shared_libs: [
193 "libbinder",
194 "libutils",
195 ],
196 clang: true,
197 cflags: [
198 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700199 "-Wno-missing-field-initializers",
200 "-Wno-sign-compare",
201 "-O3",
202 ],
203}
Wei Wang78f2a372016-10-20 23:18:17 -0700204
205cc_test {
206 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700207 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700208 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700209 shared_libs: [
210 "libbinder",
211 "libutils",
212 "libbase",
213 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700214 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700215}
Howard Chenc135dbc2017-03-25 17:12:59 +0800216
217cc_test {
218 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700219 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700220 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800221 shared_libs: [
222 "libbinder",
223 "libutils",
224 "libbase",
225 ],
226}
Dan Stozad630e522016-12-01 15:16:31 -0800227
228cc_test {
229 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700230 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700231 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800232
233 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800234 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800235 ],
236
237 cpp_std: "experimental",
238 gnu_extensions: false,
239
240 shared_libs: [
241 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700242 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800243 "liblog",
244 "libutils",
245 ],
Dan Shieb25b672020-03-26 11:43:04 -0700246 test_suites: ["device-tests", "vts"],
Dan Shi80ada592019-09-13 09:17:17 -0700247 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800248}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700249
Steven Morelandf23dae22020-10-27 19:34:55 +0000250cc_test {
251 name: "binderClearBufTest",
252 defaults: ["binder_test_defaults"],
253 srcs: [
254 "binderClearBufTest.cpp",
255 ],
256
257 shared_libs: [
258 "libbase",
259 "libbinder",
260 "liblog",
261 "libutils",
262 ],
263
264 test_suites: ["general-tests"],
265 require_root: true,
266}
267
Steven Moreland12300a02019-08-02 13:27:15 -0700268aidl_interface {
269 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900270 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700271 srcs: [
272 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700273 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000274 backend: {
275 java: {
276 enabled: false,
277 },
278 },
Steven Moreland12300a02019-08-02 13:27:15 -0700279}
280
Steven Morelanddea3cf92019-07-16 18:06:55 -0700281cc_test {
282 name: "binderStabilityTest",
283 defaults: ["binder_test_defaults"],
284 srcs: [
285 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700286 ],
287
Steven Moreland13f84662020-07-23 21:30:41 +0000288 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700289 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700290 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700291 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700292 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700293 "libutils",
294 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700295 static_libs: [
296 "binderStabilityTestIface-cpp",
297 "binderStabilityTestIface-ndk_platform",
298 ],
299
Steven Moreland13f84662020-07-23 21:30:41 +0000300 test_suites: ["device-tests", "vts"],
Dan Shi302709b2019-09-19 15:28:15 -0700301 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700302}
Steven Moreland042ae822020-05-27 17:45:17 +0000303
304cc_test {
305 name: "binderAllocationLimits",
306 defaults: ["binder_test_defaults"],
307 srcs: ["binderAllocationLimits.cpp"],
308 shared_libs: [
309 "libbinder",
310 "liblog",
311 "libutils",
312 "libutilscallstack",
313 "libbase",
314 ],
315 test_suites: ["device-tests"],
316 require_root: true,
317}
Andy Hung73a14702020-11-24 13:04:46 -0800318
319cc_benchmark {
320 name: "binderParcelBenchmark",
321 defaults: ["binder_test_defaults"],
322 srcs: ["binderParcelBenchmark.cpp"],
323 shared_libs: [
324 "libbase",
325 "libbinder",
326 "liblog",
327 "libutils",
328 ],
329}
Yifan Hongaf766e62021-06-14 13:24:19 -0700330
331cc_test_host {
332 name: "binderUtilsHostTest",
333 defaults: ["binder_test_defaults"],
334 srcs: ["binderUtilsHostTest.cpp"],
335 shared_libs: [
336 "libbase",
337 "libbinder",
338 ],
339 static_libs: [
340 "libgmock",
341 ],
342 test_suites: ["general-tests"],
343}