blob: fb84f04fde86ef0eb6d52cad5d587f64a517f6b0 [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: [
63 "libbinder",
64 "libutils",
65 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -070066 static_libs: [
67 "libgmock",
68 ],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080069 compile_multilib: "32",
Steven Morelandf9f3de22020-05-06 17:14:39 -070070 multilib: { lib32: { suffix: "" } },
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080071 cflags: ["-DBINDER_IPC_32BIT=1"],
Steven Morelandf9f3de22020-05-06 17:14:39 -070072 test_suites: ["vts"],
73 require_root: true,
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080074}
75
Steven Morelandcefba612020-11-05 22:57:06 +000076// unit test only, which can run on host and doesn't use /dev/binder
77cc_test {
78 name: "binderParcelTest",
79 host_supported: true,
80 target: {
81 darwin: {
82 enabled: false,
83 },
84 },
85 srcs: ["binderParcelTest.cpp"],
86 shared_libs: [
87 "libbinder",
88 "libutils",
89 ],
90 test_suites: ["general-tests"],
91}
92
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080093cc_test {
Steven Morelandc7a30c82019-07-10 13:12:23 -070094 name: "binderLibTest",
95 defaults: ["binder_test_defaults"],
Hsin-Yi Chenec18c022017-07-06 11:40:20 +080096 product_variables: {
97 binder32bit: {
98 cflags: ["-DBINDER_IPC_32BIT=1"],
99 },
100 },
101
Dan Willemsen59e086f2016-07-25 17:13:45 -0700102 srcs: ["binderLibTest.cpp"],
103 shared_libs: [
104 "libbinder",
105 "libutils",
106 ],
Yifan Hongbbd2a0d2021-05-07 22:12:23 -0700107 static_libs: [
108 "libgmock",
109 ],
Dan Shieb25b672020-03-26 11:43:04 -0700110 test_suites: ["device-tests", "vts"],
Dan Shi80ada592019-09-13 09:17:17 -0700111 require_root: true,
Dan Willemsen59e086f2016-07-25 17:13:45 -0700112}
113
Steven Moreland37aff182021-03-26 02:04:16 +0000114aidl_interface {
115 name: "binderRpcTestIface",
116 host_supported: true,
117 unstable: true,
118 srcs: [
119 "IBinderRpcSession.aidl",
120 "IBinderRpcTest.aidl",
121 ],
122 backend: {
123 java: {
124 enabled: false,
125 },
126 },
127}
128
Dan Willemsen59e086f2016-07-25 17:13:45 -0700129cc_test {
Steven Moreland5553ac42020-11-11 02:14:45 +0000130 name: "binderRpcTest",
Steven Morelandf6ec4632021-04-01 16:20:47 +0000131 host_supported: true,
132 target: {
133 darwin: {
134 enabled: false,
135 },
136 },
Steven Moreland37aff182021-03-26 02:04:16 +0000137 defaults: [
138 "binder_test_defaults",
139 "libbinder_ndk_host_user",
140 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000141
142 srcs: [
Steven Moreland5553ac42020-11-11 02:14:45 +0000143 "binderRpcTest.cpp",
144 ],
145 shared_libs: [
146 "libbinder",
Steven Moreland37aff182021-03-26 02:04:16 +0000147 "libbinder_ndk",
Steven Moreland5553ac42020-11-11 02:14:45 +0000148 "libbase",
149 "libutils",
150 "libcutils",
151 "liblog",
152 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000153 static_libs: [
154 "binderRpcTestIface-cpp",
155 "binderRpcTestIface-ndk_platform",
156 ],
Steven Moreland5553ac42020-11-11 02:14:45 +0000157 test_suites: ["general-tests"],
158 require_root: true,
Julien Desprez8f128142021-06-01 15:55:49 -0700159 // Prevent the unit test target from running on sc-dev as it's not ready.
160 test_options: {
161 unit_test: false,
162 },
Steven Moreland5553ac42020-11-11 02:14:45 +0000163}
164
Steven Morelandcda60852021-04-14 23:45:32 +0000165cc_benchmark {
166 name: "binderRpcBenchmark",
167 defaults: ["binder_test_defaults"],
168 host_supported: true,
Steven Moreland722b4902021-04-16 16:30:18 +0000169 target: {
170 darwin: {
171 enabled: false,
172 },
173 },
Steven Morelandcda60852021-04-14 23:45:32 +0000174 srcs: [
175 "binderRpcBenchmark.cpp",
176 "IBinderRpcBenchmark.aidl",
177 ],
178 shared_libs: [
179 "libbase",
180 "libbinder",
181 "liblog",
182 "libutils",
183 ],
184}
185
Steven Moreland5553ac42020-11-11 02:14:45 +0000186cc_test {
Dan Willemsen59e086f2016-07-25 17:13:45 -0700187 name: "binderThroughputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700188 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700189 srcs: ["binderThroughputTest.cpp"],
Dan Willemsen59e086f2016-07-25 17:13:45 -0700190 shared_libs: [
191 "libbinder",
192 "libutils",
193 ],
194 clang: true,
195 cflags: [
196 "-g",
Dan Willemsen59e086f2016-07-25 17:13:45 -0700197 "-Wno-missing-field-initializers",
198 "-Wno-sign-compare",
199 "-O3",
200 ],
201}
Wei Wang78f2a372016-10-20 23:18:17 -0700202
203cc_test {
204 name: "binderTextOutputTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700205 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700206 srcs: ["binderTextOutputTest.cpp"],
Wei Wang78f2a372016-10-20 23:18:17 -0700207 shared_libs: [
208 "libbinder",
209 "libutils",
210 "libbase",
211 ],
Steven Moreland67812c22019-07-10 13:50:40 -0700212 test_suites: ["device-tests"],
Wei Wang78f2a372016-10-20 23:18:17 -0700213}
Howard Chenc135dbc2017-03-25 17:12:59 +0800214
215cc_test {
216 name: "schd-dbg",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700217 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700218 srcs: ["schd-dbg.cpp"],
Howard Chenc135dbc2017-03-25 17:12:59 +0800219 shared_libs: [
220 "libbinder",
221 "libutils",
222 "libbase",
223 ],
224}
Dan Stozad630e522016-12-01 15:16:31 -0800225
226cc_test {
227 name: "binderSafeInterfaceTest",
Chih-Hung Hsiehd1acbbc2017-10-05 13:38:28 -0700228 defaults: ["binder_test_defaults"],
Steven Morelandc7a30c82019-07-10 13:12:23 -0700229 srcs: ["binderSafeInterfaceTest.cpp"],
Dan Stozad630e522016-12-01 15:16:31 -0800230
231 cppflags: [
Colin Cross1383d9f2019-11-06 13:33:40 -0800232 "-Wextra",
Dan Stozad630e522016-12-01 15:16:31 -0800233 ],
234
235 cpp_std: "experimental",
236 gnu_extensions: false,
237
238 shared_libs: [
239 "libbinder",
Dan Stoza2537db72017-04-07 16:32:38 -0700240 "libcutils",
Dan Stozad630e522016-12-01 15:16:31 -0800241 "liblog",
242 "libutils",
243 ],
Dan Shieb25b672020-03-26 11:43:04 -0700244 test_suites: ["device-tests", "vts"],
Dan Shi80ada592019-09-13 09:17:17 -0700245 require_root: true,
Dan Stozad630e522016-12-01 15:16:31 -0800246}
Steven Morelanddea3cf92019-07-16 18:06:55 -0700247
Steven Morelandf23dae22020-10-27 19:34:55 +0000248cc_test {
249 name: "binderClearBufTest",
250 defaults: ["binder_test_defaults"],
251 srcs: [
252 "binderClearBufTest.cpp",
253 ],
254
255 shared_libs: [
256 "libbase",
257 "libbinder",
258 "liblog",
259 "libutils",
260 ],
261
262 test_suites: ["general-tests"],
263 require_root: true,
264}
265
Steven Moreland12300a02019-08-02 13:27:15 -0700266aidl_interface {
267 name: "binderStabilityTestIface",
Jiyong Park701fa1a2020-04-13 12:55:44 +0900268 unstable: true,
Steven Moreland12300a02019-08-02 13:27:15 -0700269 srcs: [
270 "IBinderStabilityTest.aidl",
Steven Moreland12300a02019-08-02 13:27:15 -0700271 ],
Steven Moreland37aff182021-03-26 02:04:16 +0000272 backend: {
273 java: {
274 enabled: false,
275 },
276 },
Steven Moreland12300a02019-08-02 13:27:15 -0700277}
278
Steven Morelanddea3cf92019-07-16 18:06:55 -0700279cc_test {
280 name: "binderStabilityTest",
281 defaults: ["binder_test_defaults"],
282 srcs: [
283 "binderStabilityTest.cpp",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700284 ],
285
Steven Moreland13f84662020-07-23 21:30:41 +0000286 // critical that libbinder/libbinder_ndk are shared for VTS
Steven Morelanddea3cf92019-07-16 18:06:55 -0700287 shared_libs: [
Steven Moreland12300a02019-08-02 13:27:15 -0700288 "libbinder_ndk",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700289 "libbinder",
Steven Moreland12300a02019-08-02 13:27:15 -0700290 "liblog",
Steven Morelanddea3cf92019-07-16 18:06:55 -0700291 "libutils",
292 ],
Steven Moreland12300a02019-08-02 13:27:15 -0700293 static_libs: [
294 "binderStabilityTestIface-cpp",
295 "binderStabilityTestIface-ndk_platform",
296 ],
297
Steven Moreland13f84662020-07-23 21:30:41 +0000298 test_suites: ["device-tests", "vts"],
Dan Shi302709b2019-09-19 15:28:15 -0700299 require_root: true,
Steven Morelanddea3cf92019-07-16 18:06:55 -0700300}
Steven Moreland042ae822020-05-27 17:45:17 +0000301
302cc_test {
303 name: "binderAllocationLimits",
304 defaults: ["binder_test_defaults"],
305 srcs: ["binderAllocationLimits.cpp"],
306 shared_libs: [
307 "libbinder",
308 "liblog",
309 "libutils",
310 "libutilscallstack",
311 "libbase",
312 ],
313 test_suites: ["device-tests"],
314 require_root: true,
315}
Andy Hung73a14702020-11-24 13:04:46 -0800316
317cc_benchmark {
318 name: "binderParcelBenchmark",
319 defaults: ["binder_test_defaults"],
320 srcs: ["binderParcelBenchmark.cpp"],
321 shared_libs: [
322 "libbase",
323 "libbinder",
324 "liblog",
325 "libutils",
326 ],
327}