Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 1 | // |
| 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 Badour | 3c53823 | 2021-02-12 21:26:48 -0800 | [diff] [blame] | 17 | package { |
| 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 Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 26 | cc_defaults { |
| 27 | name: "binder_test_defaults", |
| 28 | cflags: [ |
| 29 | "-Wall", |
| 30 | "-Werror", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 31 | ], |
| 32 | } |
| 33 | |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 34 | cc_test { |
Hsin-Yi Chen | 6929575 | 2017-06-07 18:05:05 +0800 | [diff] [blame] | 35 | name: "binderDriverInterfaceTest_IPC_32", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 36 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 37 | srcs: ["binderDriverInterfaceTest.cpp"], |
Yifan Hong | 4e419d8 | 2021-04-26 11:32:56 -0700 | [diff] [blame] | 38 | header_libs: ["libbinder_headers"], |
Hsin-Yi Chen | 6929575 | 2017-06-07 18:05:05 +0800 | [diff] [blame] | 39 | compile_multilib: "32", |
Steven Moreland | f9f3de2 | 2020-05-06 17:14:39 -0700 | [diff] [blame] | 40 | multilib: { lib32: { suffix: "" } }, |
Hsin-Yi Chen | 6929575 | 2017-06-07 18:05:05 +0800 | [diff] [blame] | 41 | cflags: ["-DBINDER_IPC_32BIT=1"], |
Steven Moreland | f9f3de2 | 2020-05-06 17:14:39 -0700 | [diff] [blame] | 42 | test_suites: ["vts"], |
Hsin-Yi Chen | 6929575 | 2017-06-07 18:05:05 +0800 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | cc_test { |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 46 | name: "binderDriverInterfaceTest", |
| 47 | defaults: ["binder_test_defaults"], |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 48 | product_variables: { |
| 49 | binder32bit: { |
| 50 | cflags: ["-DBINDER_IPC_32BIT=1"], |
| 51 | }, |
| 52 | }, |
Yifan Hong | 4e419d8 | 2021-04-26 11:32:56 -0700 | [diff] [blame] | 53 | header_libs: ["libbinder_headers"], |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 54 | srcs: ["binderDriverInterfaceTest.cpp"], |
Dan Shi | eb25b67 | 2020-03-26 11:43:04 -0700 | [diff] [blame] | 55 | test_suites: ["device-tests", "vts"], |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | cc_test { |
Hsin-Yi Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 59 | name: "binderLibTest_IPC_32", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 60 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 61 | srcs: ["binderLibTest.cpp"], |
Hsin-Yi Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 62 | shared_libs: [ |
Yifan Hong | 84bedeb | 2021-04-21 21:37:17 -0700 | [diff] [blame] | 63 | "libbase", |
Hsin-Yi Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 64 | "libbinder", |
| 65 | "libutils", |
| 66 | ], |
Yifan Hong | bbd2a0d | 2021-05-07 22:12:23 -0700 | [diff] [blame] | 67 | static_libs: [ |
| 68 | "libgmock", |
| 69 | ], |
Hsin-Yi Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 70 | compile_multilib: "32", |
Steven Moreland | f9f3de2 | 2020-05-06 17:14:39 -0700 | [diff] [blame] | 71 | multilib: { lib32: { suffix: "" } }, |
Hsin-Yi Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 72 | cflags: ["-DBINDER_IPC_32BIT=1"], |
Steven Moreland | f9f3de2 | 2020-05-06 17:14:39 -0700 | [diff] [blame] | 73 | test_suites: ["vts"], |
| 74 | require_root: true, |
Hsin-Yi Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 75 | } |
| 76 | |
Steven Moreland | cefba61 | 2020-11-05 22:57:06 +0000 | [diff] [blame] | 77 | // unit test only, which can run on host and doesn't use /dev/binder |
| 78 | cc_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 Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 94 | cc_test { |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 95 | name: "binderLibTest", |
| 96 | defaults: ["binder_test_defaults"], |
Hsin-Yi Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 97 | product_variables: { |
| 98 | binder32bit: { |
| 99 | cflags: ["-DBINDER_IPC_32BIT=1"], |
| 100 | }, |
| 101 | }, |
| 102 | |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 103 | srcs: ["binderLibTest.cpp"], |
| 104 | shared_libs: [ |
Yifan Hong | 84bedeb | 2021-04-21 21:37:17 -0700 | [diff] [blame] | 105 | "libbase", |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 106 | "libbinder", |
| 107 | "libutils", |
| 108 | ], |
Yifan Hong | bbd2a0d | 2021-05-07 22:12:23 -0700 | [diff] [blame] | 109 | static_libs: [ |
| 110 | "libgmock", |
| 111 | ], |
Dan Shi | eb25b67 | 2020-03-26 11:43:04 -0700 | [diff] [blame] | 112 | test_suites: ["device-tests", "vts"], |
Dan Shi | 80ada59 | 2019-09-13 09:17:17 -0700 | [diff] [blame] | 113 | require_root: true, |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 114 | } |
| 115 | |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 116 | aidl_interface { |
| 117 | name: "binderRpcTestIface", |
| 118 | host_supported: true, |
| 119 | unstable: true, |
| 120 | srcs: [ |
Steven Moreland | 659416d | 2021-05-11 00:47:50 +0000 | [diff] [blame^] | 121 | "IBinderRpcCallback.aidl", |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 122 | "IBinderRpcSession.aidl", |
| 123 | "IBinderRpcTest.aidl", |
| 124 | ], |
| 125 | backend: { |
| 126 | java: { |
| 127 | enabled: false, |
| 128 | }, |
| 129 | }, |
| 130 | } |
| 131 | |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 132 | cc_test { |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 133 | name: "binderRpcTest", |
Steven Moreland | f6ec463 | 2021-04-01 16:20:47 +0000 | [diff] [blame] | 134 | host_supported: true, |
| 135 | target: { |
| 136 | darwin: { |
| 137 | enabled: false, |
| 138 | }, |
Steven Moreland | 1d448af | 2021-04-20 01:05:18 +0000 | [diff] [blame] | 139 | android: { |
| 140 | test_suites: ["vts"], |
| 141 | }, |
Steven Moreland | f6ec463 | 2021-04-01 16:20:47 +0000 | [diff] [blame] | 142 | }, |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 143 | defaults: [ |
| 144 | "binder_test_defaults", |
| 145 | "libbinder_ndk_host_user", |
| 146 | ], |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 147 | |
| 148 | srcs: [ |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 149 | "binderRpcTest.cpp", |
| 150 | ], |
| 151 | shared_libs: [ |
| 152 | "libbinder", |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 153 | "libbinder_ndk", |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 154 | "libbase", |
| 155 | "libutils", |
| 156 | "libcutils", |
| 157 | "liblog", |
| 158 | ], |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 159 | static_libs: [ |
| 160 | "binderRpcTestIface-cpp", |
| 161 | "binderRpcTestIface-ndk_platform", |
| 162 | ], |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 163 | test_suites: ["general-tests"], |
| 164 | require_root: true, |
| 165 | } |
| 166 | |
Steven Moreland | cda6085 | 2021-04-14 23:45:32 +0000 | [diff] [blame] | 167 | cc_benchmark { |
| 168 | name: "binderRpcBenchmark", |
| 169 | defaults: ["binder_test_defaults"], |
| 170 | host_supported: true, |
Steven Moreland | 722b490 | 2021-04-16 16:30:18 +0000 | [diff] [blame] | 171 | target: { |
| 172 | darwin: { |
| 173 | enabled: false, |
| 174 | }, |
| 175 | }, |
Steven Moreland | cda6085 | 2021-04-14 23:45:32 +0000 | [diff] [blame] | 176 | srcs: [ |
| 177 | "binderRpcBenchmark.cpp", |
| 178 | "IBinderRpcBenchmark.aidl", |
| 179 | ], |
| 180 | shared_libs: [ |
| 181 | "libbase", |
| 182 | "libbinder", |
| 183 | "liblog", |
| 184 | "libutils", |
| 185 | ], |
| 186 | } |
| 187 | |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 188 | cc_test { |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 189 | name: "binderThroughputTest", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 190 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 191 | srcs: ["binderThroughputTest.cpp"], |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 192 | shared_libs: [ |
| 193 | "libbinder", |
| 194 | "libutils", |
| 195 | ], |
| 196 | clang: true, |
| 197 | cflags: [ |
| 198 | "-g", |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 199 | "-Wno-missing-field-initializers", |
| 200 | "-Wno-sign-compare", |
| 201 | "-O3", |
| 202 | ], |
| 203 | } |
Wei Wang | 78f2a37 | 2016-10-20 23:18:17 -0700 | [diff] [blame] | 204 | |
| 205 | cc_test { |
| 206 | name: "binderTextOutputTest", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 207 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 208 | srcs: ["binderTextOutputTest.cpp"], |
Wei Wang | 78f2a37 | 2016-10-20 23:18:17 -0700 | [diff] [blame] | 209 | shared_libs: [ |
| 210 | "libbinder", |
| 211 | "libutils", |
| 212 | "libbase", |
| 213 | ], |
Steven Moreland | 67812c2 | 2019-07-10 13:50:40 -0700 | [diff] [blame] | 214 | test_suites: ["device-tests"], |
Wei Wang | 78f2a37 | 2016-10-20 23:18:17 -0700 | [diff] [blame] | 215 | } |
Howard Chen | c135dbc | 2017-03-25 17:12:59 +0800 | [diff] [blame] | 216 | |
| 217 | cc_test { |
| 218 | name: "schd-dbg", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 219 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 220 | srcs: ["schd-dbg.cpp"], |
Howard Chen | c135dbc | 2017-03-25 17:12:59 +0800 | [diff] [blame] | 221 | shared_libs: [ |
| 222 | "libbinder", |
| 223 | "libutils", |
| 224 | "libbase", |
| 225 | ], |
| 226 | } |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 227 | |
| 228 | cc_test { |
| 229 | name: "binderSafeInterfaceTest", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 230 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 231 | srcs: ["binderSafeInterfaceTest.cpp"], |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 232 | |
| 233 | cppflags: [ |
Colin Cross | 1383d9f | 2019-11-06 13:33:40 -0800 | [diff] [blame] | 234 | "-Wextra", |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 235 | ], |
| 236 | |
| 237 | cpp_std: "experimental", |
| 238 | gnu_extensions: false, |
| 239 | |
| 240 | shared_libs: [ |
| 241 | "libbinder", |
Dan Stoza | 2537db7 | 2017-04-07 16:32:38 -0700 | [diff] [blame] | 242 | "libcutils", |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 243 | "liblog", |
| 244 | "libutils", |
| 245 | ], |
Dan Shi | eb25b67 | 2020-03-26 11:43:04 -0700 | [diff] [blame] | 246 | test_suites: ["device-tests", "vts"], |
Dan Shi | 80ada59 | 2019-09-13 09:17:17 -0700 | [diff] [blame] | 247 | require_root: true, |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 248 | } |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 249 | |
Steven Moreland | f23dae2 | 2020-10-27 19:34:55 +0000 | [diff] [blame] | 250 | cc_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 Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 268 | aidl_interface { |
| 269 | name: "binderStabilityTestIface", |
Jiyong Park | 701fa1a | 2020-04-13 12:55:44 +0900 | [diff] [blame] | 270 | unstable: true, |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 271 | srcs: [ |
| 272 | "IBinderStabilityTest.aidl", |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 273 | ], |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 274 | backend: { |
| 275 | java: { |
| 276 | enabled: false, |
| 277 | }, |
| 278 | }, |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 279 | } |
| 280 | |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 281 | cc_test { |
| 282 | name: "binderStabilityTest", |
| 283 | defaults: ["binder_test_defaults"], |
| 284 | srcs: [ |
| 285 | "binderStabilityTest.cpp", |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 286 | ], |
| 287 | |
Steven Moreland | 13f8466 | 2020-07-23 21:30:41 +0000 | [diff] [blame] | 288 | // critical that libbinder/libbinder_ndk are shared for VTS |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 289 | shared_libs: [ |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 290 | "libbinder_ndk", |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 291 | "libbinder", |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 292 | "liblog", |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 293 | "libutils", |
| 294 | ], |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 295 | static_libs: [ |
| 296 | "binderStabilityTestIface-cpp", |
| 297 | "binderStabilityTestIface-ndk_platform", |
| 298 | ], |
| 299 | |
Steven Moreland | 13f8466 | 2020-07-23 21:30:41 +0000 | [diff] [blame] | 300 | test_suites: ["device-tests", "vts"], |
Dan Shi | 302709b | 2019-09-19 15:28:15 -0700 | [diff] [blame] | 301 | require_root: true, |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 302 | } |
Steven Moreland | 042ae82 | 2020-05-27 17:45:17 +0000 | [diff] [blame] | 303 | |
| 304 | cc_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 Hung | 73a1470 | 2020-11-24 13:04:46 -0800 | [diff] [blame] | 318 | |
| 319 | cc_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 | } |