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