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 { |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 35 | name: "binderDriverInterfaceTest", |
| 36 | defaults: ["binder_test_defaults"], |
Yifan Hong | 4e419d8 | 2021-04-26 11:32:56 -0700 | [diff] [blame] | 37 | header_libs: ["libbinder_headers"], |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 38 | srcs: ["binderDriverInterfaceTest.cpp"], |
Steven Moreland | ea7659e | 2022-02-03 00:04:06 +0000 | [diff] [blame] | 39 | test_suites: [ |
| 40 | "device-tests", |
| 41 | "vts", |
| 42 | ], |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 43 | } |
| 44 | |
Steven Moreland | cefba61 | 2020-11-05 22:57:06 +0000 | [diff] [blame] | 45 | // unit test only, which can run on host and doesn't use /dev/binder |
| 46 | cc_test { |
Steven Moreland | 2831860 | 2021-06-25 01:16:29 +0000 | [diff] [blame] | 47 | name: "binderUnitTest", |
Steven Moreland | cefba61 | 2020-11-05 22:57:06 +0000 | [diff] [blame] | 48 | host_supported: true, |
| 49 | target: { |
| 50 | darwin: { |
| 51 | enabled: false, |
| 52 | }, |
| 53 | }, |
Steven Moreland | ea7659e | 2022-02-03 00:04:06 +0000 | [diff] [blame] | 54 | srcs: [ |
| 55 | "binderParcelUnitTest.cpp", |
| 56 | "binderBinderUnitTest.cpp", |
Steven Moreland | cf37369 | 2022-01-21 23:55:15 +0000 | [diff] [blame] | 57 | "binderStatusUnitTest.cpp", |
Atneya Nair | 7ade4f4 | 2022-02-07 18:16:48 -0500 | [diff] [blame] | 58 | "binderMemoryHeapBaseUnitTest.cpp", |
Fabián Cañas | 08bdc77 | 2023-01-02 15:02:56 -0500 | [diff] [blame] | 59 | "binderRecordedTransactionTest.cpp", |
Steven Moreland | ea7659e | 2022-02-03 00:04:06 +0000 | [diff] [blame] | 60 | ], |
Steven Moreland | cefba61 | 2020-11-05 22:57:06 +0000 | [diff] [blame] | 61 | shared_libs: [ |
| 62 | "libbinder", |
Steven Moreland | f80809b | 2021-10-07 18:09:20 -0700 | [diff] [blame] | 63 | "libcutils", |
Steven Moreland | cefba61 | 2020-11-05 22:57:06 +0000 | [diff] [blame] | 64 | "libutils", |
| 65 | ], |
| 66 | test_suites: ["general-tests"], |
| 67 | } |
| 68 | |
Hsin-Yi Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 69 | cc_test { |
Steven Moreland | a8244b9 | 2023-04-20 23:34:11 +0000 | [diff] [blame] | 70 | name: "binderRecordReplayTest", |
| 71 | srcs: ["binderRecordReplayTest.cpp"], |
Pawan Wagh | 76b1815 | 2023-12-01 14:30:26 +0000 | [diff] [blame^] | 72 | cflags: [ |
| 73 | "-DBINDER_WITH_KERNEL_IPC", |
| 74 | ], |
Steven Moreland | a8244b9 | 2023-04-20 23:34:11 +0000 | [diff] [blame] | 75 | shared_libs: [ |
| 76 | "libbinder", |
| 77 | "libcutils", |
| 78 | "libutils", |
Pawan Wagh | 76b1815 | 2023-12-01 14:30:26 +0000 | [diff] [blame^] | 79 | "liblog", |
Steven Moreland | a8244b9 | 2023-04-20 23:34:11 +0000 | [diff] [blame] | 80 | ], |
| 81 | static_libs: [ |
| 82 | "binderRecordReplayTestIface-cpp", |
Pawan Wagh | 8da4538 | 2023-05-11 08:08:50 +0000 | [diff] [blame] | 83 | "binderReadParcelIface-cpp", |
Pawan Wagh | 94bf303 | 2023-07-27 17:15:02 +0000 | [diff] [blame] | 84 | "libbinder_random_parcel_seeds", |
| 85 | "libbinder_random_parcel", |
Steven Moreland | a8244b9 | 2023-04-20 23:34:11 +0000 | [diff] [blame] | 86 | ], |
| 87 | test_suites: ["general-tests"], |
Steven Moreland | 4ed688d | 2023-05-03 23:03:56 +0000 | [diff] [blame] | 88 | require_root: true, |
Steven Moreland | a8244b9 | 2023-04-20 23:34:11 +0000 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | aidl_interface { |
| 92 | name: "binderRecordReplayTestIface", |
| 93 | unstable: true, |
| 94 | srcs: [ |
| 95 | "IBinderRecordReplayTest.aidl", |
| 96 | ], |
Pawan Wagh | 8da4538 | 2023-05-11 08:08:50 +0000 | [diff] [blame] | 97 | imports: ["binderReadParcelIface"], |
| 98 | backend: { |
| 99 | java: { |
| 100 | enabled: true, |
| 101 | platform_apis: true, |
| 102 | }, |
Pawan Wagh | 76b1815 | 2023-12-01 14:30:26 +0000 | [diff] [blame^] | 103 | ndk: { |
| 104 | enabled: false, |
| 105 | }, |
Pawan Wagh | 8da4538 | 2023-05-11 08:08:50 +0000 | [diff] [blame] | 106 | }, |
Steven Moreland | a8244b9 | 2023-04-20 23:34:11 +0000 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | cc_test { |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 110 | name: "binderLibTest", |
| 111 | defaults: ["binder_test_defaults"], |
Hsin-Yi Chen | ec18c02 | 2017-07-06 11:40:20 +0800 | [diff] [blame] | 112 | |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 113 | srcs: ["binderLibTest.cpp"], |
| 114 | shared_libs: [ |
Yifan Hong | 84bedeb | 2021-04-21 21:37:17 -0700 | [diff] [blame] | 115 | "libbase", |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 116 | "libbinder", |
Yifan Hong | 8b89085 | 2021-06-10 13:44:09 -0700 | [diff] [blame] | 117 | "liblog", |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 118 | "libutils", |
| 119 | ], |
Yifan Hong | bbd2a0d | 2021-05-07 22:12:23 -0700 | [diff] [blame] | 120 | static_libs: [ |
| 121 | "libgmock", |
| 122 | ], |
Steven Moreland | ea7659e | 2022-02-03 00:04:06 +0000 | [diff] [blame] | 123 | test_suites: [ |
| 124 | "device-tests", |
| 125 | "vts", |
| 126 | ], |
Dan Shi | 80ada59 | 2019-09-13 09:17:17 -0700 | [diff] [blame] | 127 | require_root: true, |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 128 | } |
| 129 | |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 130 | aidl_interface { |
| 131 | name: "binderRpcTestIface", |
Andrei Homescu | d65666d | 2023-03-03 07:28:02 +0000 | [diff] [blame] | 132 | vendor_available: true, |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 133 | host_supported: true, |
| 134 | unstable: true, |
| 135 | srcs: [ |
Yifan Hong | 1deca4b | 2021-09-10 16:16:44 -0700 | [diff] [blame] | 136 | "BinderRpcTestClientInfo.aidl", |
Andrei Homescu | 2a29801 | 2022-06-15 01:08:54 +0000 | [diff] [blame] | 137 | "BinderRpcTestServerConfig.aidl", |
Yifan Hong | 1deca4b | 2021-09-10 16:16:44 -0700 | [diff] [blame] | 138 | "BinderRpcTestServerInfo.aidl", |
Steven Moreland | 659416d | 2021-05-11 00:47:50 +0000 | [diff] [blame] | 139 | "IBinderRpcCallback.aidl", |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 140 | "IBinderRpcSession.aidl", |
| 141 | "IBinderRpcTest.aidl", |
Yifan Hong | 1deca4b | 2021-09-10 16:16:44 -0700 | [diff] [blame] | 142 | "ParcelableCertificateData.aidl", |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 143 | ], |
Tomasz Wasilczyk | 7c511e9 | 2023-12-04 17:00:28 -0800 | [diff] [blame] | 144 | flags: [ |
| 145 | "-Werror", |
| 146 | "-Wno-mixed-oneway", |
| 147 | ], |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 148 | backend: { |
| 149 | java: { |
| 150 | enabled: false, |
| 151 | }, |
| 152 | }, |
| 153 | } |
| 154 | |
Yifan Hong | e0e5328 | 2021-09-23 18:37:21 -0700 | [diff] [blame] | 155 | cc_library_static { |
| 156 | name: "libbinder_tls_test_utils", |
| 157 | host_supported: true, |
Andrei Homescu | d65666d | 2023-03-03 07:28:02 +0000 | [diff] [blame] | 158 | vendor_available: true, |
Yifan Hong | e0e5328 | 2021-09-23 18:37:21 -0700 | [diff] [blame] | 159 | target: { |
| 160 | darwin: { |
| 161 | enabled: false, |
| 162 | }, |
| 163 | }, |
| 164 | defaults: [ |
| 165 | "binder_test_defaults", |
| 166 | "libbinder_tls_shared_deps", |
| 167 | ], |
| 168 | shared_libs: [ |
Yifan Hong | e0e5328 | 2021-09-23 18:37:21 -0700 | [diff] [blame] | 169 | "libbase", |
| 170 | "liblog", |
| 171 | ], |
| 172 | static_libs: [ |
| 173 | "libbinder_tls_static", |
| 174 | ], |
| 175 | srcs: [ |
| 176 | "RpcTlsTestUtils.cpp", |
| 177 | ], |
| 178 | export_include_dirs: [ |
| 179 | "include_tls_test_utils", |
| 180 | ], |
| 181 | visibility: [ |
| 182 | ":__subpackages__", |
| 183 | ], |
| 184 | } |
| 185 | |
Tomasz Wasilczyk | 26db5e4 | 2023-11-02 11:45:11 -0700 | [diff] [blame] | 186 | cc_library_static { |
| 187 | name: "libbinder_test_utils", |
| 188 | host_supported: true, |
| 189 | vendor_available: true, |
| 190 | target: { |
| 191 | darwin: { |
| 192 | enabled: false, |
| 193 | }, |
| 194 | }, |
| 195 | defaults: [ |
| 196 | "binder_test_defaults", |
| 197 | ], |
| 198 | shared_libs: [ |
| 199 | "libbase", |
| 200 | "liblog", |
| 201 | ], |
| 202 | srcs: [ |
| 203 | "FileUtils.cpp", |
| 204 | ], |
| 205 | visibility: [ |
| 206 | ":__subpackages__", |
| 207 | ], |
| 208 | } |
| 209 | |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 210 | cc_defaults { |
Andrei Homescu | 2a29801 | 2022-06-15 01:08:54 +0000 | [diff] [blame] | 211 | name: "binderRpcTest_common_defaults", |
Steven Moreland | f6ec463 | 2021-04-01 16:20:47 +0000 | [diff] [blame] | 212 | host_supported: true, |
| 213 | target: { |
| 214 | darwin: { |
| 215 | enabled: false, |
| 216 | }, |
| 217 | }, |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 218 | defaults: [ |
| 219 | "binder_test_defaults", |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 220 | ], |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 221 | |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 222 | static_libs: [ |
Tomasz Wasilczyk | 26db5e4 | 2023-11-02 11:45:11 -0700 | [diff] [blame] | 223 | "libbinder_test_utils", |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 224 | "libbinder_tls_static", |
| 225 | "libbinder_tls_test_utils", |
| 226 | "binderRpcTestIface-cpp", |
| 227 | "binderRpcTestIface-ndk", |
| 228 | ], |
Andrei Homescu | 2a29801 | 2022-06-15 01:08:54 +0000 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | cc_defaults { |
| 232 | name: "binderRpcTest_service_defaults", |
| 233 | defaults: [ |
| 234 | "binderRpcTest_common_defaults", |
| 235 | ], |
| 236 | gtest: false, |
| 237 | auto_gen_config: false, |
| 238 | srcs: [ |
| 239 | "binderRpcTestCommon.cpp", |
| 240 | "binderRpcTestService.cpp", |
| 241 | ], |
| 242 | } |
| 243 | |
| 244 | cc_defaults { |
| 245 | name: "binderRpcTest_defaults", |
| 246 | target: { |
| 247 | android: { |
| 248 | test_suites: ["vts"], |
| 249 | }, |
| 250 | }, |
| 251 | defaults: [ |
| 252 | "binderRpcTest_common_defaults", |
| 253 | ], |
| 254 | |
| 255 | srcs: [ |
| 256 | "binderRpcTest.cpp", |
| 257 | "binderRpcTestCommon.cpp", |
Andrei Homescu | 9a9b1b4 | 2022-10-14 01:40:59 +0000 | [diff] [blame] | 258 | "binderRpcUniversalTests.cpp", |
Andrei Homescu | 2a29801 | 2022-06-15 01:08:54 +0000 | [diff] [blame] | 259 | ], |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 260 | |
Steven Moreland | 2053161 | 2023-04-04 18:03:24 +0000 | [diff] [blame] | 261 | // This test uses a lot of resources and takes a long time. Due to |
| 262 | // design of several tests, it is also very sensitive to resource |
| 263 | // contention on the device. b/276820894 |
| 264 | test_options: { |
| 265 | unit_test: false, |
Steven Moreland | f6b18f2 | 2023-12-16 04:46:22 +0000 | [diff] [blame] | 266 | test_runner_options: [ |
| 267 | { |
| 268 | name: "native-test-timeout", |
| 269 | value: "10m", |
| 270 | }, |
| 271 | ], |
Steven Moreland | 2053161 | 2023-04-04 18:03:24 +0000 | [diff] [blame] | 272 | }, |
| 273 | |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 274 | test_suites: ["general-tests"], |
| 275 | require_root: true, |
Andrei Homescu | 2a29801 | 2022-06-15 01:08:54 +0000 | [diff] [blame] | 276 | |
| 277 | data_bins: [ |
| 278 | "binder_rpc_test_service", |
| 279 | "binder_rpc_test_service_no_kernel", |
| 280 | "binder_rpc_test_service_single_threaded", |
| 281 | "binder_rpc_test_service_single_threaded_no_kernel", |
| 282 | ], |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 283 | } |
| 284 | |
Andrei Homescu | 2a29801 | 2022-06-15 01:08:54 +0000 | [diff] [blame] | 285 | cc_defaults { |
| 286 | name: "binderRpcTest_shared_defaults", |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 287 | cflags: [ |
| 288 | "-DBINDER_WITH_KERNEL_IPC", |
| 289 | ], |
| 290 | |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 291 | shared_libs: [ |
| 292 | "libbinder", |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 293 | "libbinder_ndk", |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 294 | "libbase", |
| 295 | "libutils", |
| 296 | "libcutils", |
| 297 | "liblog", |
| 298 | ], |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | cc_defaults { |
| 302 | name: "binderRpcTest_static_defaults", |
| 303 | |
| 304 | shared_libs: [ |
Andrei Homescu | 68a5561 | 2022-08-02 01:25:15 +0000 | [diff] [blame] | 305 | "liblog", |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 306 | "libutils", |
| 307 | // libcrypto_static is not visible to this module |
| 308 | "libcrypto", |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 309 | ], |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 310 | static_libs: [ |
| 311 | "libbase", |
| 312 | "libcutils", |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 313 | "libssl", |
| 314 | ], |
| 315 | |
| 316 | cflags: [ |
| 317 | // Disable tests that require shared libraries, |
| 318 | // e.g., libbinder.so or libbinder_ndk.so |
| 319 | "-DBINDER_TEST_NO_SHARED_LIBS", |
| 320 | ], |
| 321 | } |
| 322 | |
| 323 | cc_test { |
Andrei Homescu | 2a29801 | 2022-06-15 01:08:54 +0000 | [diff] [blame] | 324 | // The module name cannot start with "binderRpcTest" because |
| 325 | // then atest tries to execute it as part of binderRpcTest |
| 326 | name: "binder_rpc_test_service", |
| 327 | defaults: [ |
| 328 | "binderRpcTest_service_defaults", |
| 329 | "binderRpcTest_shared_defaults", |
| 330 | "libbinder_tls_shared_deps", |
| 331 | ], |
| 332 | } |
| 333 | |
| 334 | cc_test { |
| 335 | name: "binder_rpc_test_service_no_kernel", |
| 336 | defaults: [ |
| 337 | "binderRpcTest_service_defaults", |
| 338 | "binderRpcTest_static_defaults", |
| 339 | ], |
| 340 | static_libs: [ |
| 341 | "libbinder_rpc_no_kernel", |
| 342 | ], |
| 343 | } |
| 344 | |
| 345 | cc_test { |
| 346 | name: "binder_rpc_test_service_single_threaded", |
| 347 | defaults: [ |
| 348 | "binderRpcTest_service_defaults", |
| 349 | "binderRpcTest_static_defaults", |
| 350 | ], |
| 351 | cflags: [ |
| 352 | "-DBINDER_RPC_SINGLE_THREADED", |
| 353 | "-DBINDER_WITH_KERNEL_IPC", |
| 354 | ], |
| 355 | static_libs: [ |
| 356 | "libbinder_rpc_single_threaded", |
| 357 | ], |
| 358 | } |
| 359 | |
| 360 | cc_test { |
| 361 | name: "binder_rpc_test_service_single_threaded_no_kernel", |
| 362 | defaults: [ |
| 363 | "binderRpcTest_service_defaults", |
| 364 | "binderRpcTest_static_defaults", |
| 365 | ], |
| 366 | cflags: [ |
| 367 | "-DBINDER_RPC_SINGLE_THREADED", |
| 368 | ], |
| 369 | static_libs: [ |
| 370 | "libbinder_rpc_single_threaded_no_kernel", |
| 371 | ], |
| 372 | } |
| 373 | |
Andrei Homescu | 9d8adb1 | 2022-08-02 04:38:30 +0000 | [diff] [blame] | 374 | cc_binary { |
| 375 | name: "binderRpcTestService_on_trusty_mock", |
| 376 | defaults: [ |
| 377 | "trusty_mock_defaults", |
| 378 | ], |
| 379 | |
| 380 | srcs: [ |
| 381 | "binderRpcTestCommon.cpp", |
| 382 | "binderRpcTestServiceTrusty.cpp", |
| 383 | ], |
| 384 | |
| 385 | shared_libs: [ |
| 386 | "libbinder_on_trusty_mock", |
| 387 | "libbase", |
| 388 | "libutils", |
| 389 | "libcutils", |
| 390 | ], |
| 391 | |
| 392 | static_libs: [ |
| 393 | "binderRpcTestIface-cpp", |
| 394 | ], |
| 395 | } |
| 396 | |
Andrei Homescu | 4d9420e | 2023-01-31 01:38:48 +0000 | [diff] [blame] | 397 | cc_binary { |
| 398 | name: "binderRpcTest_on_trusty_mock", |
| 399 | defaults: [ |
| 400 | "trusty_mock_defaults", |
| 401 | ], |
| 402 | |
| 403 | srcs: [ |
| 404 | "binderRpcUniversalTests.cpp", |
| 405 | "binderRpcTestCommon.cpp", |
| 406 | "binderRpcTestTrusty.cpp", |
| 407 | ], |
| 408 | |
| 409 | shared_libs: [ |
| 410 | "libbinder_on_trusty_mock", |
| 411 | "libbase", |
| 412 | "libutils", |
| 413 | "libcutils", |
| 414 | ], |
| 415 | |
| 416 | static_libs: [ |
| 417 | "binderRpcTestIface-cpp", |
| 418 | "libgtest", |
| 419 | ], |
| 420 | } |
| 421 | |
Andrei Homescu | 2a29801 | 2022-06-15 01:08:54 +0000 | [diff] [blame] | 422 | cc_test { |
| 423 | name: "binderRpcTest", |
| 424 | defaults: [ |
| 425 | "binderRpcTest_defaults", |
| 426 | "binderRpcTest_shared_defaults", |
| 427 | "libbinder_tls_shared_deps", |
| 428 | ], |
Andrei Homescu | 875996f | 2022-08-24 04:25:11 +0000 | [diff] [blame] | 429 | |
| 430 | // Add the Trusty mock library as a fake dependency so it gets built |
| 431 | required: [ |
| 432 | "libbinder_on_trusty_mock", |
Andrei Homescu | 9d8adb1 | 2022-08-02 04:38:30 +0000 | [diff] [blame] | 433 | "binderRpcTestService_on_trusty_mock", |
Andrei Homescu | 4d9420e | 2023-01-31 01:38:48 +0000 | [diff] [blame] | 434 | "binderRpcTest_on_trusty_mock", |
Andrei Homescu | 875996f | 2022-08-24 04:25:11 +0000 | [diff] [blame] | 435 | ], |
Andrei Homescu | 2a29801 | 2022-06-15 01:08:54 +0000 | [diff] [blame] | 436 | } |
| 437 | |
| 438 | cc_test { |
Andrei Homescu | 12106de | 2022-04-27 04:42:21 +0000 | [diff] [blame] | 439 | name: "binderRpcTestNoKernel", |
| 440 | defaults: [ |
| 441 | "binderRpcTest_defaults", |
| 442 | "binderRpcTest_static_defaults", |
| 443 | ], |
| 444 | static_libs: [ |
| 445 | "libbinder_rpc_no_kernel", |
| 446 | ], |
| 447 | } |
| 448 | |
| 449 | cc_test { |
| 450 | name: "binderRpcTestSingleThreaded", |
| 451 | defaults: [ |
| 452 | "binderRpcTest_defaults", |
| 453 | "binderRpcTest_static_defaults", |
| 454 | ], |
| 455 | cflags: [ |
| 456 | "-DBINDER_RPC_SINGLE_THREADED", |
| 457 | "-DBINDER_WITH_KERNEL_IPC", |
| 458 | ], |
| 459 | static_libs: [ |
| 460 | "libbinder_rpc_single_threaded", |
| 461 | ], |
| 462 | } |
| 463 | |
| 464 | cc_test { |
| 465 | name: "binderRpcTestSingleThreadedNoKernel", |
| 466 | defaults: [ |
| 467 | "binderRpcTest_defaults", |
| 468 | "binderRpcTest_static_defaults", |
| 469 | ], |
| 470 | cflags: [ |
| 471 | "-DBINDER_RPC_SINGLE_THREADED", |
| 472 | ], |
| 473 | static_libs: [ |
| 474 | "libbinder_rpc_single_threaded_no_kernel", |
| 475 | ], |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 476 | } |
| 477 | |
Yifan Hong | ff73aa9 | 2021-09-17 21:28:01 -0700 | [diff] [blame] | 478 | cc_test { |
Andrei Homescu | d65666d | 2023-03-03 07:28:02 +0000 | [diff] [blame] | 479 | name: "binderRpcToTrustyTest", |
| 480 | vendor: true, |
| 481 | host_supported: false, |
| 482 | defaults: [ |
| 483 | "binderRpcTest_common_defaults", |
| 484 | "binderRpcTest_static_defaults", |
| 485 | ], |
| 486 | |
| 487 | srcs: [ |
| 488 | "binderRpcTest.cpp", |
| 489 | "binderRpcTestCommon.cpp", |
| 490 | "binderRpcUniversalTests.cpp", |
| 491 | ], |
| 492 | |
| 493 | cflags: [ |
| 494 | "-DBINDER_RPC_TO_TRUSTY_TEST", |
| 495 | ], |
| 496 | |
| 497 | static_libs: [ |
| 498 | // We want to link libbinder statically so we can push the binary |
| 499 | // to the device for testing independently of the library |
| 500 | "libbinder_rpc_no_kernel", |
| 501 | "libbinder_trusty", |
| 502 | "libtrusty", |
| 503 | ], |
| 504 | |
| 505 | test_suites: ["device-tests"], |
| 506 | require_root: true, |
| 507 | } |
| 508 | |
| 509 | cc_test { |
Yifan Hong | ff73aa9 | 2021-09-17 21:28:01 -0700 | [diff] [blame] | 510 | name: "RpcTlsUtilsTest", |
| 511 | host_supported: true, |
| 512 | target: { |
| 513 | darwin: { |
| 514 | enabled: false, |
| 515 | }, |
| 516 | android: { |
| 517 | test_suites: ["vts"], |
| 518 | }, |
| 519 | }, |
| 520 | defaults: [ |
| 521 | "binder_test_defaults", |
| 522 | "libbinder_tls_shared_deps", |
| 523 | ], |
| 524 | srcs: [ |
Yifan Hong | ff73aa9 | 2021-09-17 21:28:01 -0700 | [diff] [blame] | 525 | "RpcTlsUtilsTest.cpp", |
| 526 | ], |
| 527 | shared_libs: [ |
| 528 | "libbinder", |
| 529 | "libbase", |
| 530 | "libutils", |
| 531 | "liblog", |
| 532 | ], |
| 533 | static_libs: [ |
Yifan Hong | e0e5328 | 2021-09-23 18:37:21 -0700 | [diff] [blame] | 534 | "libbinder_tls_test_utils", |
Yifan Hong | ff73aa9 | 2021-09-17 21:28:01 -0700 | [diff] [blame] | 535 | "libbinder_tls_static", |
| 536 | ], |
Steven Moreland | ea7659e | 2022-02-03 00:04:06 +0000 | [diff] [blame] | 537 | test_suites: [ |
| 538 | "general-tests", |
| 539 | "device-tests", |
| 540 | ], |
Yifan Hong | ff73aa9 | 2021-09-17 21:28:01 -0700 | [diff] [blame] | 541 | } |
| 542 | |
Steven Moreland | cda6085 | 2021-04-14 23:45:32 +0000 | [diff] [blame] | 543 | cc_benchmark { |
| 544 | name: "binderRpcBenchmark", |
Yifan Hong | aecdd17 | 2021-09-21 14:53:13 -0700 | [diff] [blame] | 545 | defaults: [ |
| 546 | "binder_test_defaults", |
| 547 | "libbinder_tls_shared_deps", |
| 548 | ], |
Steven Moreland | cda6085 | 2021-04-14 23:45:32 +0000 | [diff] [blame] | 549 | host_supported: true, |
Steven Moreland | 722b490 | 2021-04-16 16:30:18 +0000 | [diff] [blame] | 550 | target: { |
| 551 | darwin: { |
| 552 | enabled: false, |
| 553 | }, |
| 554 | }, |
Steven Moreland | cda6085 | 2021-04-14 23:45:32 +0000 | [diff] [blame] | 555 | srcs: [ |
| 556 | "binderRpcBenchmark.cpp", |
| 557 | "IBinderRpcBenchmark.aidl", |
| 558 | ], |
| 559 | shared_libs: [ |
| 560 | "libbase", |
| 561 | "libbinder", |
| 562 | "liblog", |
| 563 | "libutils", |
| 564 | ], |
Yifan Hong | aecdd17 | 2021-09-21 14:53:13 -0700 | [diff] [blame] | 565 | static_libs: [ |
Yifan Hong | e0e5328 | 2021-09-23 18:37:21 -0700 | [diff] [blame] | 566 | "libbinder_tls_test_utils", |
Yifan Hong | aecdd17 | 2021-09-21 14:53:13 -0700 | [diff] [blame] | 567 | "libbinder_tls_static", |
| 568 | ], |
Steven Moreland | cda6085 | 2021-04-14 23:45:32 +0000 | [diff] [blame] | 569 | } |
| 570 | |
Steven Moreland | 5553ac4 | 2020-11-11 02:14:45 +0000 | [diff] [blame] | 571 | cc_test { |
Steven Moreland | 59640db | 2021-07-22 17:19:31 -0700 | [diff] [blame] | 572 | name: "binderRpcWireProtocolTest", |
| 573 | host_supported: true, |
| 574 | target: { |
| 575 | darwin: { |
| 576 | enabled: false, |
| 577 | }, |
| 578 | android: { |
| 579 | test_suites: ["vts"], |
| 580 | }, |
| 581 | }, |
| 582 | defaults: [ |
| 583 | "binder_test_defaults", |
| 584 | ], |
| 585 | srcs: [ |
| 586 | "binderRpcWireProtocolTest.cpp", |
| 587 | ], |
| 588 | shared_libs: [ |
| 589 | "libbinder", |
| 590 | "libbase", |
| 591 | "libutils", |
| 592 | "libcutils", |
| 593 | "liblog", |
| 594 | ], |
| 595 | test_suites: ["general-tests"], |
| 596 | } |
| 597 | |
| 598 | cc_test { |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 599 | name: "binderThroughputTest", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 600 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 601 | srcs: ["binderThroughputTest.cpp"], |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 602 | shared_libs: [ |
| 603 | "libbinder", |
| 604 | "libutils", |
| 605 | ], |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 606 | cflags: [ |
| 607 | "-g", |
Dan Willemsen | 59e086f | 2016-07-25 17:13:45 -0700 | [diff] [blame] | 608 | "-Wno-missing-field-initializers", |
| 609 | "-Wno-sign-compare", |
| 610 | "-O3", |
| 611 | ], |
| 612 | } |
Wei Wang | 78f2a37 | 2016-10-20 23:18:17 -0700 | [diff] [blame] | 613 | |
| 614 | cc_test { |
| 615 | name: "binderTextOutputTest", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 616 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 617 | srcs: ["binderTextOutputTest.cpp"], |
Wei Wang | 78f2a37 | 2016-10-20 23:18:17 -0700 | [diff] [blame] | 618 | shared_libs: [ |
| 619 | "libbinder", |
| 620 | "libutils", |
| 621 | "libbase", |
| 622 | ], |
Steven Moreland | 67812c2 | 2019-07-10 13:50:40 -0700 | [diff] [blame] | 623 | test_suites: ["device-tests"], |
Wei Wang | 78f2a37 | 2016-10-20 23:18:17 -0700 | [diff] [blame] | 624 | } |
Howard Chen | c135dbc | 2017-03-25 17:12:59 +0800 | [diff] [blame] | 625 | |
| 626 | cc_test { |
| 627 | name: "schd-dbg", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 628 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 629 | srcs: ["schd-dbg.cpp"], |
Howard Chen | c135dbc | 2017-03-25 17:12:59 +0800 | [diff] [blame] | 630 | shared_libs: [ |
| 631 | "libbinder", |
| 632 | "libutils", |
| 633 | "libbase", |
| 634 | ], |
| 635 | } |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 636 | |
| 637 | cc_test { |
| 638 | name: "binderSafeInterfaceTest", |
Chih-Hung Hsieh | d1acbbc | 2017-10-05 13:38:28 -0700 | [diff] [blame] | 639 | defaults: ["binder_test_defaults"], |
Steven Moreland | c7a30c8 | 2019-07-10 13:12:23 -0700 | [diff] [blame] | 640 | srcs: ["binderSafeInterfaceTest.cpp"], |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 641 | |
| 642 | cppflags: [ |
Colin Cross | 1383d9f | 2019-11-06 13:33:40 -0800 | [diff] [blame] | 643 | "-Wextra", |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 644 | ], |
| 645 | |
| 646 | cpp_std: "experimental", |
| 647 | gnu_extensions: false, |
| 648 | |
| 649 | shared_libs: [ |
| 650 | "libbinder", |
Dan Stoza | 2537db7 | 2017-04-07 16:32:38 -0700 | [diff] [blame] | 651 | "libcutils", |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 652 | "liblog", |
| 653 | "libutils", |
| 654 | ], |
Steven Moreland | ea7659e | 2022-02-03 00:04:06 +0000 | [diff] [blame] | 655 | test_suites: [ |
| 656 | "device-tests", |
| 657 | "vts", |
| 658 | ], |
Dan Shi | 80ada59 | 2019-09-13 09:17:17 -0700 | [diff] [blame] | 659 | require_root: true, |
Dan Stoza | d630e52 | 2016-12-01 15:16:31 -0800 | [diff] [blame] | 660 | } |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 661 | |
Steven Moreland | f23dae2 | 2020-10-27 19:34:55 +0000 | [diff] [blame] | 662 | cc_test { |
| 663 | name: "binderClearBufTest", |
| 664 | defaults: ["binder_test_defaults"], |
| 665 | srcs: [ |
| 666 | "binderClearBufTest.cpp", |
| 667 | ], |
| 668 | |
| 669 | shared_libs: [ |
| 670 | "libbase", |
| 671 | "libbinder", |
| 672 | "liblog", |
| 673 | "libutils", |
| 674 | ], |
| 675 | |
| 676 | test_suites: ["general-tests"], |
| 677 | require_root: true, |
| 678 | } |
| 679 | |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 680 | aidl_interface { |
| 681 | name: "binderStabilityTestIface", |
Jiyong Park | 701fa1a | 2020-04-13 12:55:44 +0900 | [diff] [blame] | 682 | unstable: true, |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 683 | srcs: [ |
| 684 | "IBinderStabilityTest.aidl", |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 685 | ], |
Steven Moreland | 37aff18 | 2021-03-26 02:04:16 +0000 | [diff] [blame] | 686 | backend: { |
| 687 | java: { |
| 688 | enabled: false, |
| 689 | }, |
| 690 | }, |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 691 | } |
| 692 | |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 693 | cc_test { |
| 694 | name: "binderStabilityTest", |
| 695 | defaults: ["binder_test_defaults"], |
| 696 | srcs: [ |
| 697 | "binderStabilityTest.cpp", |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 698 | ], |
| 699 | |
Steven Moreland | 13f8466 | 2020-07-23 21:30:41 +0000 | [diff] [blame] | 700 | // critical that libbinder/libbinder_ndk are shared for VTS |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 701 | shared_libs: [ |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 702 | "libbinder_ndk", |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 703 | "libbinder", |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 704 | "liblog", |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 705 | "libutils", |
| 706 | ], |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 707 | static_libs: [ |
| 708 | "binderStabilityTestIface-cpp", |
Jiyong Park | 9a9427c | 2021-08-09 09:01:15 +0900 | [diff] [blame] | 709 | "binderStabilityTestIface-ndk", |
Steven Moreland | 12300a0 | 2019-08-02 13:27:15 -0700 | [diff] [blame] | 710 | ], |
| 711 | |
Steven Moreland | ea7659e | 2022-02-03 00:04:06 +0000 | [diff] [blame] | 712 | test_suites: [ |
| 713 | "device-tests", |
| 714 | "vts", |
| 715 | ], |
Dan Shi | 302709b | 2019-09-19 15:28:15 -0700 | [diff] [blame] | 716 | require_root: true, |
Steven Moreland | dea3cf9 | 2019-07-16 18:06:55 -0700 | [diff] [blame] | 717 | } |
Steven Moreland | 042ae82 | 2020-05-27 17:45:17 +0000 | [diff] [blame] | 718 | |
| 719 | cc_test { |
| 720 | name: "binderAllocationLimits", |
| 721 | defaults: ["binder_test_defaults"], |
| 722 | srcs: ["binderAllocationLimits.cpp"], |
| 723 | shared_libs: [ |
| 724 | "libbinder", |
| 725 | "liblog", |
Steven Moreland | 66acefe | 2022-09-09 00:34:40 +0000 | [diff] [blame] | 726 | "libcutils", |
Steven Moreland | 042ae82 | 2020-05-27 17:45:17 +0000 | [diff] [blame] | 727 | "libutils", |
| 728 | "libutilscallstack", |
| 729 | "libbase", |
| 730 | ], |
| 731 | test_suites: ["device-tests"], |
| 732 | require_root: true, |
| 733 | } |
Andy Hung | 73a1470 | 2020-11-24 13:04:46 -0800 | [diff] [blame] | 734 | |
| 735 | cc_benchmark { |
| 736 | name: "binderParcelBenchmark", |
| 737 | defaults: ["binder_test_defaults"], |
| 738 | srcs: ["binderParcelBenchmark.cpp"], |
| 739 | shared_libs: [ |
| 740 | "libbase", |
| 741 | "libbinder", |
| 742 | "liblog", |
| 743 | "libutils", |
| 744 | ], |
Steven Moreland | 9b254dd | 2023-05-11 00:37:55 +0000 | [diff] [blame] | 745 | test_suites: ["general-tests"], |
Andy Hung | 73a1470 | 2020-11-24 13:04:46 -0800 | [diff] [blame] | 746 | } |
Yifan Hong | af766e6 | 2021-06-14 13:24:19 -0700 | [diff] [blame] | 747 | |
| 748 | cc_test_host { |
| 749 | name: "binderUtilsHostTest", |
| 750 | defaults: ["binder_test_defaults"], |
| 751 | srcs: ["binderUtilsHostTest.cpp"], |
| 752 | shared_libs: [ |
| 753 | "libbase", |
| 754 | "libbinder", |
| 755 | ], |
| 756 | static_libs: [ |
| 757 | "libgmock", |
| 758 | ], |
| 759 | test_suites: ["general-tests"], |
Yifan Hong | 44dec54 | 2021-06-22 10:47:44 -0700 | [diff] [blame] | 760 | target: { |
| 761 | darwin: { |
| 762 | enabled: false, |
| 763 | }, |
| 764 | }, |
Yifan Hong | af766e6 | 2021-06-14 13:24:19 -0700 | [diff] [blame] | 765 | } |
Yifan Hong | 1b6f12f | 2021-06-03 20:01:57 -0700 | [diff] [blame] | 766 | |
| 767 | cc_test_host { |
| 768 | name: "binderHostDeviceTest", |
| 769 | defaults: ["binder_test_defaults"], |
| 770 | srcs: ["binderHostDeviceTest.cpp"], |
| 771 | test_config: "binderHostDeviceTest.xml", |
| 772 | shared_libs: [ |
| 773 | "libbase", |
| 774 | "libbinder", |
| 775 | "liblog", |
| 776 | "libutils", |
| 777 | ], |
| 778 | static_libs: [ |
| 779 | "libgmock", |
| 780 | ], |
| 781 | target_required: [ |
| 782 | "binderHostDeviceTestService", |
| 783 | ], |
| 784 | test_suites: ["general-tests"], |
| 785 | target: { |
| 786 | darwin: { |
| 787 | enabled: false, |
| 788 | }, |
| 789 | }, |
| 790 | test_options: { |
| 791 | unit_test: false, |
| 792 | }, |
| 793 | } |
| 794 | |
| 795 | cc_test { |
| 796 | name: "binderHostDeviceTestService", |
| 797 | // The binary is named differently from the module so that PushFilePreparer pushes the binary |
| 798 | // directly, not the test module directory. |
| 799 | stem: "binderHostDeviceTest-service", |
| 800 | defaults: ["binder_test_defaults"], |
| 801 | gtest: false, |
| 802 | auto_gen_config: false, |
| 803 | srcs: ["binderHostDeviceTestService.cpp"], |
| 804 | shared_libs: [ |
| 805 | "libbase", |
| 806 | "libbinder", |
| 807 | "liblog", |
| 808 | "libutils", |
| 809 | ], |
| 810 | test_suites: ["general-tests"], |
| 811 | } |
Pawan | f00fabb | 2022-08-04 17:56:18 +0000 | [diff] [blame] | 812 | |
| 813 | cc_defaults { |
| 814 | name: "service_fuzzer_defaults", |
| 815 | static_libs: [ |
| 816 | "libbase", |
| 817 | "libbinder_random_parcel", |
| 818 | "libcutils", |
| 819 | ], |
| 820 | target: { |
| 821 | android: { |
| 822 | shared_libs: [ |
| 823 | "libbinder_ndk", |
| 824 | "libbinder", |
| 825 | "libutils", |
| 826 | ], |
| 827 | }, |
| 828 | host: { |
| 829 | static_libs: [ |
| 830 | "libbinder_ndk", |
| 831 | "libbinder", |
| 832 | "libutils", |
| 833 | ], |
| 834 | }, |
| 835 | darwin: { |
| 836 | enabled: false, |
| 837 | }, |
| 838 | }, |
| 839 | fuzz_config: { |
| 840 | cc: [ |
| 841 | "smoreland@google.com", |
| 842 | "waghpawan@google.com", |
| 843 | ], |
Pawan Wagh | 595377b | 2022-11-16 08:42:20 +0000 | [diff] [blame] | 844 | // Adds bugs to hotlist "AIDL fuzzers bugs" on buganizer |
| 845 | hotlists: ["4637097"], |
Pawan Wagh | 813a06f | 2023-12-21 23:39:39 +0000 | [diff] [blame] | 846 | use_for_presubmit: true, |
Pawan | f00fabb | 2022-08-04 17:56:18 +0000 | [diff] [blame] | 847 | }, |
| 848 | } |
Pawan Wagh | 475f66c | 2023-05-05 21:46:07 +0000 | [diff] [blame] | 849 | |
| 850 | cc_defaults { |
| 851 | name: "fuzzer_disable_leaks", |
Pawan Wagh | 9e2d296 | 2023-06-20 23:43:24 +0000 | [diff] [blame] | 852 | fuzz_config: { |
| 853 | asan_options: [ |
| 854 | "detect_leaks=0", |
| 855 | ], |
| 856 | hwasan_options: [ |
| 857 | "detect_leaks=0", |
| 858 | ], |
| 859 | }, |
Pawan Wagh | 475f66c | 2023-05-05 21:46:07 +0000 | [diff] [blame] | 860 | } |