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