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