Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2012 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 | aa7d835 | 2021-02-19 13:06:22 -0800 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["bionic_tests_license"], |
| 19 | } |
| 20 | |
| 21 | license { |
| 22 | name: "bionic_tests_license", |
| 23 | visibility: [":__subpackages__"], |
| 24 | license_kinds: [ |
| 25 | "SPDX-license-identifier-Apache-2.0", |
| 26 | "SPDX-license-identifier-BSD", |
| 27 | ], |
| 28 | license_text: [ |
| 29 | "NOTICE", |
| 30 | ], |
| 31 | } |
| 32 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 33 | cc_defaults { |
| 34 | name: "bionic_tests_defaults", |
| 35 | host_supported: true, |
| 36 | target: { |
| 37 | darwin: { |
| 38 | enabled: false, |
| 39 | }, |
Martin Stjernholm | a276343 | 2020-04-23 16:47:19 +0100 | [diff] [blame] | 40 | android: { |
| 41 | header_libs: ["bionic_libc_platform_headers"], |
| 42 | }, |
| 43 | linux_bionic: { |
| 44 | header_libs: ["bionic_libc_platform_headers"], |
| 45 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 46 | }, |
| 47 | cflags: [ |
| 48 | "-fstack-protector-all", |
| 49 | "-g", |
| 50 | "-Wall", |
| 51 | "-Wextra", |
| 52 | "-Wunused", |
| 53 | "-Werror", |
| 54 | "-fno-builtin", |
| 55 | |
| 56 | // We want to test deprecated API too. |
| 57 | "-Wno-deprecated-declarations", |
| 58 | |
Peter Collingbourne | 4edf74a | 2020-10-02 13:47:03 -0700 | [diff] [blame] | 59 | // Needed to test pthread_internal_t layout. |
| 60 | "-Wno-invalid-offsetof", |
| 61 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 62 | // For glibc. |
| 63 | "-D__STDC_LIMIT_MACROS", |
| 64 | ], |
Mitch Phillips | e6997d5 | 2020-11-30 15:04:14 -0800 | [diff] [blame] | 65 | header_libs: [ |
| 66 | "libcutils_headers", |
| 67 | "gwp_asan_headers" |
| 68 | ], |
Tamas Petz | d901ec6 | 2020-02-25 11:25:48 +0100 | [diff] [blame] | 69 | // Ensure that the tests exercise shadow call stack support and |
| 70 | // the hint space PAC/BTI instructions. |
Peter Collingbourne | 7b70e27 | 2018-11-12 20:09:14 -0800 | [diff] [blame] | 71 | arch: { |
| 72 | arm64: { |
Tamas Petz | d901ec6 | 2020-02-25 11:25:48 +0100 | [diff] [blame] | 73 | cflags: [ |
| 74 | "-fsanitize=shadow-call-stack", |
Christopher Ferris | 140220b | 2020-03-12 17:09:38 -0700 | [diff] [blame] | 75 | // Disable this option for now: see b/151372823 |
| 76 | //"-mbranch-protection=standard", |
Tamas Petz | d901ec6 | 2020-02-25 11:25:48 +0100 | [diff] [blame] | 77 | ], |
Peter Collingbourne | 7b70e27 | 2018-11-12 20:09:14 -0800 | [diff] [blame] | 78 | }, |
| 79 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 80 | stl: "libc++", |
| 81 | sanitize: { |
Evgenii Stepanov | 7cc6706 | 2019-02-05 18:43:34 -0800 | [diff] [blame] | 82 | address: false, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 83 | }, |
Ryan Prichard | 3c5dff4 | 2020-03-31 17:34:03 -0700 | [diff] [blame] | 84 | |
| 85 | // Use the bootstrap version of bionic because some tests call private APIs |
| 86 | // that aren't exposed by the APEX bionic stubs. |
Jiyong Park | c45fe9f | 2018-12-13 18:26:48 +0900 | [diff] [blame] | 87 | bootstrap: true, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | // ----------------------------------------------------------------------------- |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 91 | // Prebuilt shared libraries for use in tests. |
| 92 | // ----------------------------------------------------------------------------- |
| 93 | |
| 94 | cc_prebuilt_test_library_shared { |
| 95 | name: "libtest_invalid-rw_load_segment", |
| 96 | strip: { |
| 97 | none: true, |
| 98 | }, |
| 99 | check_elf_files: false, |
| 100 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 101 | arch: { |
| 102 | arm: { |
| 103 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-rw_load_segment.so"], |
| 104 | }, |
| 105 | arm64: { |
| 106 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-rw_load_segment.so"], |
| 107 | }, |
Elliott Hughes | ec9f023 | 2022-11-16 00:23:21 +0000 | [diff] [blame^] | 108 | riscv64: { |
| 109 | srcs: ["prebuilt-elf-files/riscv64/libtest_invalid-rw_load_segment.so"], |
| 110 | }, |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 111 | x86: { |
| 112 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-rw_load_segment.so"], |
| 113 | }, |
| 114 | x86_64: { |
| 115 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-rw_load_segment.so"], |
| 116 | }, |
| 117 | }, |
| 118 | } |
| 119 | |
| 120 | cc_prebuilt_test_library_shared { |
| 121 | name: "libtest_invalid-unaligned_shdr_offset", |
| 122 | strip: { |
| 123 | none: true, |
| 124 | }, |
| 125 | check_elf_files: false, |
| 126 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 127 | arch: { |
| 128 | arm: { |
| 129 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-unaligned_shdr_offset.so"], |
| 130 | }, |
| 131 | arm64: { |
| 132 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-unaligned_shdr_offset.so"], |
| 133 | }, |
Elliott Hughes | ec9f023 | 2022-11-16 00:23:21 +0000 | [diff] [blame^] | 134 | riscv64: { |
| 135 | srcs: ["prebuilt-elf-files/riscv64/libtest_invalid-unaligned_shdr_offset.so"], |
| 136 | }, |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 137 | x86: { |
| 138 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-unaligned_shdr_offset.so"], |
| 139 | }, |
| 140 | x86_64: { |
| 141 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-unaligned_shdr_offset.so"], |
| 142 | }, |
| 143 | }, |
| 144 | } |
| 145 | |
| 146 | cc_prebuilt_test_library_shared { |
| 147 | name: "libtest_invalid-zero_shentsize", |
| 148 | strip: { |
| 149 | none: true, |
| 150 | }, |
| 151 | check_elf_files: false, |
| 152 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 153 | arch: { |
| 154 | arm: { |
| 155 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-zero_shentsize.so"], |
| 156 | }, |
| 157 | arm64: { |
| 158 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-zero_shentsize.so"], |
| 159 | }, |
Elliott Hughes | ec9f023 | 2022-11-16 00:23:21 +0000 | [diff] [blame^] | 160 | riscv64: { |
| 161 | srcs: ["prebuilt-elf-files/riscv64/libtest_invalid-zero_shentsize.so"], |
| 162 | }, |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 163 | x86: { |
| 164 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-zero_shentsize.so"], |
| 165 | }, |
| 166 | x86_64: { |
| 167 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-zero_shentsize.so"], |
| 168 | }, |
| 169 | }, |
| 170 | } |
| 171 | |
| 172 | cc_prebuilt_test_library_shared { |
| 173 | name: "libtest_invalid-zero_shstrndx", |
| 174 | strip: { |
| 175 | none: true, |
| 176 | }, |
| 177 | check_elf_files: false, |
| 178 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 179 | arch: { |
| 180 | arm: { |
| 181 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-zero_shstrndx.so"], |
| 182 | }, |
| 183 | arm64: { |
| 184 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-zero_shstrndx.so"], |
| 185 | }, |
Elliott Hughes | ec9f023 | 2022-11-16 00:23:21 +0000 | [diff] [blame^] | 186 | riscv64: { |
| 187 | srcs: ["prebuilt-elf-files/riscv64/libtest_invalid-zero_shstrndx.so"], |
| 188 | }, |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 189 | x86: { |
| 190 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-zero_shstrndx.so"], |
| 191 | }, |
| 192 | x86_64: { |
| 193 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-zero_shstrndx.so"], |
| 194 | }, |
| 195 | }, |
| 196 | } |
| 197 | |
| 198 | cc_prebuilt_test_library_shared { |
| 199 | name: "libtest_invalid-empty_shdr_table", |
| 200 | strip: { |
| 201 | none: true, |
| 202 | }, |
| 203 | check_elf_files: false, |
| 204 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 205 | arch: { |
| 206 | arm: { |
| 207 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-empty_shdr_table.so"], |
| 208 | }, |
| 209 | arm64: { |
| 210 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-empty_shdr_table.so"], |
| 211 | }, |
Elliott Hughes | ec9f023 | 2022-11-16 00:23:21 +0000 | [diff] [blame^] | 212 | riscv64: { |
| 213 | srcs: ["prebuilt-elf-files/riscv64/libtest_invalid-empty_shdr_table.so"], |
| 214 | }, |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 215 | x86: { |
| 216 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-empty_shdr_table.so"], |
| 217 | }, |
| 218 | x86_64: { |
| 219 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-empty_shdr_table.so"], |
| 220 | }, |
| 221 | }, |
| 222 | } |
| 223 | |
| 224 | cc_prebuilt_test_library_shared { |
| 225 | name: "libtest_invalid-zero_shdr_table_offset", |
| 226 | strip: { |
| 227 | none: true, |
| 228 | }, |
| 229 | check_elf_files: false, |
| 230 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 231 | arch: { |
| 232 | arm: { |
| 233 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-zero_shdr_table_offset.so"], |
| 234 | }, |
| 235 | arm64: { |
| 236 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-zero_shdr_table_offset.so"], |
| 237 | }, |
Elliott Hughes | ec9f023 | 2022-11-16 00:23:21 +0000 | [diff] [blame^] | 238 | riscv64: { |
| 239 | srcs: ["prebuilt-elf-files/riscv64/libtest_invalid-zero_shdr_table_offset.so"], |
| 240 | }, |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 241 | x86: { |
| 242 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-zero_shdr_table_offset.so"], |
| 243 | }, |
| 244 | x86_64: { |
| 245 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-zero_shdr_table_offset.so"], |
| 246 | }, |
| 247 | }, |
| 248 | } |
| 249 | |
| 250 | cc_prebuilt_test_library_shared { |
| 251 | name: "libtest_invalid-zero_shdr_table_content", |
| 252 | strip: { |
| 253 | none: true, |
| 254 | }, |
| 255 | check_elf_files: false, |
| 256 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 257 | arch: { |
| 258 | arm: { |
| 259 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-zero_shdr_table_content.so"], |
| 260 | }, |
| 261 | arm64: { |
| 262 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-zero_shdr_table_content.so"], |
| 263 | }, |
Elliott Hughes | ec9f023 | 2022-11-16 00:23:21 +0000 | [diff] [blame^] | 264 | riscv64: { |
| 265 | srcs: ["prebuilt-elf-files/riscv64/libtest_invalid-zero_shdr_table_content.so"], |
| 266 | }, |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 267 | x86: { |
| 268 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-zero_shdr_table_content.so"], |
| 269 | }, |
| 270 | x86_64: { |
| 271 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-zero_shdr_table_content.so"], |
| 272 | }, |
| 273 | }, |
| 274 | } |
| 275 | |
| 276 | cc_prebuilt_test_library_shared { |
| 277 | name: "libtest_invalid-textrels", |
| 278 | strip: { |
| 279 | none: true, |
| 280 | }, |
| 281 | check_elf_files: false, |
| 282 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 283 | arch: { |
| 284 | arm: { |
| 285 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-textrels.so"], |
| 286 | }, |
| 287 | arm64: { |
| 288 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-textrels.so"], |
| 289 | }, |
Elliott Hughes | ec9f023 | 2022-11-16 00:23:21 +0000 | [diff] [blame^] | 290 | riscv64: { |
| 291 | srcs: ["prebuilt-elf-files/riscv64/libtest_invalid-textrels.so"], |
| 292 | }, |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 293 | x86: { |
| 294 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-textrels.so"], |
| 295 | }, |
| 296 | x86_64: { |
| 297 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-textrels.so"], |
| 298 | }, |
| 299 | }, |
| 300 | } |
| 301 | |
| 302 | cc_prebuilt_test_library_shared { |
| 303 | name: "libtest_invalid-textrels2", |
| 304 | strip: { |
| 305 | none: true, |
| 306 | }, |
| 307 | check_elf_files: false, |
| 308 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 309 | arch: { |
| 310 | arm: { |
| 311 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-textrels2.so"], |
| 312 | }, |
| 313 | arm64: { |
| 314 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-textrels2.so"], |
| 315 | }, |
Elliott Hughes | ec9f023 | 2022-11-16 00:23:21 +0000 | [diff] [blame^] | 316 | riscv64: { |
| 317 | srcs: ["prebuilt-elf-files/riscv64/libtest_invalid-textrels2.so"], |
| 318 | }, |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 319 | x86: { |
| 320 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-textrels2.so"], |
| 321 | }, |
| 322 | x86_64: { |
| 323 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-textrels2.so"], |
| 324 | }, |
| 325 | }, |
| 326 | } |
| 327 | |
Ryan Prichard | 8ea6af5 | 2022-03-24 21:14:27 -0700 | [diff] [blame] | 328 | cc_prebuilt_test_library_shared { |
| 329 | name: "libtest_invalid-local-tls", |
| 330 | strip: { |
| 331 | none: true, |
| 332 | }, |
| 333 | check_elf_files: false, |
| 334 | relative_install_path: "bionic-loader-test-libs/prebuilt-elf-files", |
| 335 | arch: { |
| 336 | arm: { |
| 337 | srcs: ["prebuilt-elf-files/arm/libtest_invalid-local-tls.so"], |
| 338 | }, |
| 339 | arm64: { |
| 340 | srcs: ["prebuilt-elf-files/arm64/libtest_invalid-local-tls.so"], |
| 341 | }, |
| 342 | x86: { |
| 343 | srcs: ["prebuilt-elf-files/x86/libtest_invalid-local-tls.so"], |
| 344 | }, |
| 345 | x86_64: { |
| 346 | srcs: ["prebuilt-elf-files/x86_64/libtest_invalid-local-tls.so"], |
| 347 | }, |
| 348 | }, |
| 349 | } |
| 350 | |
Chris Parsons | cab794c | 2020-06-15 18:22:10 -0400 | [diff] [blame] | 351 | // ----------------------------------------------------------------------------- |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 352 | // All standard tests. |
| 353 | // ----------------------------------------------------------------------------- |
| 354 | |
George Burgess IV | de45dcb | 2018-03-16 14:15:01 -0700 | [diff] [blame] | 355 | // Test diagnostics emitted by clang. The library that results is useless; we |
| 356 | // just want to run '-Xclang -verify', which will fail if the diagnostics don't |
| 357 | // match up with what the source file says they should be. |
| 358 | cc_test_library { |
| 359 | name: "clang_diagnostic_tests", |
| 360 | cflags: [ |
Alix | d256925 | 2022-04-21 02:54:27 +0000 | [diff] [blame] | 361 | "-Xclang", |
| 362 | "-verify", |
George Burgess IV | de45dcb | 2018-03-16 14:15:01 -0700 | [diff] [blame] | 363 | ], |
| 364 | srcs: ["sys_ioctl_diag_test.cpp"], |
| 365 | } |
| 366 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 367 | cc_test_library { |
| 368 | name: "libBionicStandardTests", |
| 369 | defaults: ["bionic_tests_defaults"], |
| 370 | srcs: [ |
Ryan Prichard | 45024fe | 2018-12-30 21:10:26 -0800 | [diff] [blame] | 371 | "__aeabi_read_tp_test.cpp", |
Ryan Prichard | afa983c | 2020-02-04 15:46:15 -0800 | [diff] [blame] | 372 | "__cxa_atexit_test.cpp", |
Elliott Hughes | 413817f | 2020-10-26 15:05:35 -0700 | [diff] [blame] | 373 | "__cxa_demangle_test.cpp", |
Aleksandra Tsvetkova | 608b451 | 2015-02-27 15:01:59 +0300 | [diff] [blame] | 374 | "alloca_test.cpp", |
Elliott Hughes | ce934e3 | 2018-09-06 13:26:08 -0700 | [diff] [blame] | 375 | "android_get_device_api_level.cpp", |
Christopher Ferris | bbf9cd8 | 2022-04-11 16:01:37 -0700 | [diff] [blame] | 376 | "android_set_abort_message_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 377 | "arpa_inet_test.cpp", |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 378 | "async_safe_test.cpp", |
Elliott Hughes | f6495c7 | 2016-07-25 09:20:57 -0700 | [diff] [blame] | 379 | "assert_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 380 | "buffer_tests.cpp", |
| 381 | "bug_26110743_test.cpp", |
Aleksandra Tsvetkova | 608b451 | 2015-02-27 15:01:59 +0300 | [diff] [blame] | 382 | "byteswap_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 383 | "complex_test.cpp", |
Elliott Hughes | 50cda38 | 2017-09-14 15:30:08 -0700 | [diff] [blame] | 384 | "complex_force_long_double_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 385 | "ctype_test.cpp", |
| 386 | "dirent_test.cpp", |
Elliott Hughes | d390df1 | 2017-04-30 22:56:10 -0700 | [diff] [blame] | 387 | "elf_test.cpp", |
Elliott Hughes | ba267f4 | 2017-02-24 16:19:53 -0800 | [diff] [blame] | 388 | "endian_test.cpp", |
Elliott Hughes | e452cb1 | 2017-06-13 14:43:53 -0700 | [diff] [blame] | 389 | "errno_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 390 | "error_test.cpp", |
| 391 | "eventfd_test.cpp", |
| 392 | "fcntl_test.cpp", |
Josh Gao | f6e5b58 | 2018-06-01 15:30:54 -0700 | [diff] [blame] | 393 | "fdsan_test.cpp", |
Josh Gao | 9727192 | 2019-11-06 13:15:00 -0800 | [diff] [blame] | 394 | "fdtrack_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 395 | "fenv_test.cpp", |
Elliott Hughes | 09e77f3 | 2020-01-29 19:20:45 -0800 | [diff] [blame] | 396 | "_FILE_OFFSET_BITS_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 397 | "float_test.cpp", |
Elliott Hughes | 6675ad3 | 2020-11-20 16:51:21 -0800 | [diff] [blame] | 398 | "fnmatch_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 399 | "ftw_test.cpp", |
| 400 | "getauxval_test.cpp", |
| 401 | "getcwd_test.cpp", |
Elliott Hughes | f1c568d | 2017-09-26 17:09:07 -0700 | [diff] [blame] | 402 | "glob_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 403 | "grp_pwd_test.cpp", |
Tom Cherry | 6034ef8 | 2018-02-02 16:10:07 -0800 | [diff] [blame] | 404 | "grp_pwd_file_test.cpp", |
Peter Collingbourne | d306001 | 2020-04-01 19:54:48 -0700 | [diff] [blame] | 405 | "heap_tagging_level_test.cpp", |
Elliott Hughes | a648733 | 2017-08-15 23:16:48 -0700 | [diff] [blame] | 406 | "iconv_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 407 | "ifaddrs_test.cpp", |
Peter Collingbourne | 7a0f04c | 2019-01-23 17:56:24 -0800 | [diff] [blame] | 408 | "ifunc_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 409 | "inttypes_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 410 | "iso646_test.c", |
Elliott Hughes | fc8e688 | 2016-11-18 16:27:29 -0800 | [diff] [blame] | 411 | "langinfo_test.cpp", |
Josh Gao | 7d15dc3 | 2017-03-13 17:10:46 -0700 | [diff] [blame] | 412 | "leak_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 413 | "libgen_basename_test.cpp", |
| 414 | "libgen_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 415 | "limits_test.cpp", |
Christopher Ferris | ee1e0a3 | 2017-04-20 13:38:49 -0700 | [diff] [blame] | 416 | "linux_swab_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 417 | "locale_test.cpp", |
Christopher Ferris | bfd3dc4 | 2018-10-15 10:02:38 -0700 | [diff] [blame] | 418 | "malloc_iterate_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 419 | "malloc_test.cpp", |
| 420 | "math_test.cpp", |
Elliott Hughes | 50cda38 | 2017-09-14 15:30:08 -0700 | [diff] [blame] | 421 | "math_force_long_double_test.cpp", |
Orion Hodson | 6ba6694 | 2018-08-30 11:10:23 +0100 | [diff] [blame] | 422 | "membarrier_test.cpp", |
Florian Mayer | c82d7fc | 2022-08-31 20:57:03 +0000 | [diff] [blame] | 423 | "memtag_stack_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 424 | "mntent_test.cpp", |
Peter Collingbourne | 6f1fd68 | 2020-01-29 16:27:31 -0800 | [diff] [blame] | 425 | "mte_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 426 | "netdb_test.cpp", |
| 427 | "net_if_test.cpp", |
| 428 | "netinet_ether_test.cpp", |
| 429 | "netinet_in_test.cpp", |
Elliott Hughes | e5a5eec | 2018-06-27 12:29:06 -0700 | [diff] [blame] | 430 | "netinet_ip_icmp_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 431 | "netinet_udp_test.cpp", |
| 432 | "nl_types_test.cpp", |
Josh Gao | 3de1915 | 2021-02-22 18:09:48 -0800 | [diff] [blame] | 433 | "pidfd_test.cpp", |
Elliott Hughes | eab6572 | 2018-08-30 12:15:56 -0700 | [diff] [blame] | 434 | "poll_test.cpp", |
Matthew Maurer | de30635 | 2020-10-23 09:55:33 -0700 | [diff] [blame] | 435 | "prio_ctor_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 436 | "pthread_test.cpp", |
| 437 | "pty_test.cpp", |
| 438 | "regex_test.cpp", |
| 439 | "resolv_test.cpp", |
| 440 | "sched_test.cpp", |
Peter Collingbourne | 734beec | 2018-11-14 12:41:41 -0800 | [diff] [blame] | 441 | "scs_test.cpp", |
Elliott Hughes | 5059939 | 2017-05-25 17:13:32 -0700 | [diff] [blame] | 442 | "scsi_sg_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 443 | "search_test.cpp", |
| 444 | "semaphore_test.cpp", |
| 445 | "setjmp_test.cpp", |
| 446 | "signal_test.cpp", |
Elliott Hughes | 14e3ff9 | 2017-10-06 16:58:36 -0700 | [diff] [blame] | 447 | "spawn_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 448 | "stack_protector_test.cpp", |
| 449 | "stack_protector_test_helper.cpp", |
| 450 | "stack_unwinding_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 451 | "stdalign_test.cpp", |
| 452 | "stdarg_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 453 | "stdatomic_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 454 | "stdbool_test.c", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 455 | "stdint_test.cpp", |
| 456 | "stdio_nofortify_test.cpp", |
| 457 | "stdio_test.cpp", |
| 458 | "stdio_ext_test.cpp", |
| 459 | "stdlib_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 460 | "stdnoreturn_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 461 | "string_nofortify_test.cpp", |
| 462 | "string_test.cpp", |
| 463 | "string_posix_strerror_r_test.cpp", |
Colin Cross | 4408b8a | 2021-07-29 22:45:34 -0700 | [diff] [blame] | 464 | "string_posix_strerror_r_wrapper.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 465 | "strings_nofortify_test.cpp", |
| 466 | "strings_test.cpp", |
Peter Collingbourne | 4edf74a | 2020-10-02 13:47:03 -0700 | [diff] [blame] | 467 | "struct_layout_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 468 | "sstream_test.cpp", |
Elliott Hughes | c5d9036 | 2020-02-24 09:52:14 -0800 | [diff] [blame] | 469 | "sys_auxv_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 470 | "sys_epoll_test.cpp", |
| 471 | "sys_mman_test.cpp", |
Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 472 | "sys_msg_test.cpp", |
Nick Kralevich | c50b6a2 | 2019-03-21 14:04:33 -0700 | [diff] [blame] | 473 | "sys_param_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 474 | "sys_personality_test.cpp", |
| 475 | "sys_prctl_test.cpp", |
| 476 | "sys_procfs_test.cpp", |
| 477 | "sys_ptrace_test.cpp", |
| 478 | "sys_quota_test.cpp", |
Elliott Hughes | 8465e96 | 2017-09-27 16:33:35 -0700 | [diff] [blame] | 479 | "sys_random_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 480 | "sys_resource_test.cpp", |
| 481 | "sys_select_test.cpp", |
Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 482 | "sys_sem_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 483 | "sys_sendfile_test.cpp", |
Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 484 | "sys_shm_test.cpp", |
Elliott Hughes | 5905d6f | 2018-01-30 15:09:51 -0800 | [diff] [blame] | 485 | "sys_signalfd_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 486 | "sys_socket_test.cpp", |
| 487 | "sys_stat_test.cpp", |
| 488 | "sys_statvfs_test.cpp", |
| 489 | "sys_syscall_test.cpp", |
| 490 | "sys_sysinfo_test.cpp", |
| 491 | "sys_sysmacros_test.cpp", |
| 492 | "sys_time_test.cpp", |
| 493 | "sys_timex_test.cpp", |
Elliott Hughes | 02fdd05 | 2017-07-06 10:33:15 -0700 | [diff] [blame] | 494 | "sys_ttydefaults_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 495 | "sys_types_test.cpp", |
| 496 | "sys_uio_test.cpp", |
Elliott Hughes | e7d185f | 2018-06-27 13:30:02 -0700 | [diff] [blame] | 497 | "sys_un_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 498 | "sys_vfs_test.cpp", |
Elliott Hughes | 7cebf83 | 2020-08-12 14:25:41 -0700 | [diff] [blame] | 499 | "sys_wait_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 500 | "sys_xattr_test.cpp", |
| 501 | "system_properties_test.cpp", |
Dimitry Ivanov | 16b2a4d | 2017-01-24 20:43:29 +0000 | [diff] [blame] | 502 | "system_properties_test2.cpp", |
Elliott Hughes | 5da9646 | 2017-12-14 09:43:59 -0800 | [diff] [blame] | 503 | "termios_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 504 | "tgmath_test.c", |
Elliott Hughes | 4206711 | 2019-04-18 14:27:24 -0700 | [diff] [blame] | 505 | "threads_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 506 | "time_test.cpp", |
| 507 | "uchar_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 508 | "unistd_nofortify_test.cpp", |
| 509 | "unistd_test.cpp", |
Mitch Phillips | 9634c36 | 2022-06-23 11:07:00 -0700 | [diff] [blame] | 510 | "utils.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 511 | "utmp_test.cpp", |
| 512 | "wchar_test.cpp", |
| 513 | "wctype_test.cpp", |
| 514 | ], |
| 515 | |
| 516 | include_dirs: [ |
| 517 | "bionic/libc", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 518 | ], |
| 519 | |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 520 | target: { |
Dan Willemsen | 268ae36 | 2017-09-21 16:56:06 -0700 | [diff] [blame] | 521 | bionic: { |
Tom Cherry | e275d6d | 2017-12-11 23:31:33 -0800 | [diff] [blame] | 522 | whole_static_libs: [ |
| 523 | "libasync_safe", |
Christopher Ferris | bfd3dc4 | 2018-10-15 10:02:38 -0700 | [diff] [blame] | 524 | "libprocinfo", |
Tom Cherry | e275d6d | 2017-12-11 23:31:33 -0800 | [diff] [blame] | 525 | "libsystemproperties", |
| 526 | ], |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 527 | }, |
Colin Cross | 7da2034 | 2021-07-28 11:18:11 -0700 | [diff] [blame] | 528 | musl: { |
| 529 | exclude_srcs: [ |
| 530 | // musl doesn't have error.h |
| 531 | "error_test.cpp", |
| 532 | |
| 533 | // musl doesn't define noreturn for C++ |
| 534 | "stdnoreturn_test.cpp", |
| 535 | |
| 536 | // unsupported relocation type 37 |
| 537 | "ifunc_test.cpp", |
| 538 | ], |
| 539 | }, |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 540 | }, |
| 541 | |
Dan Willemsen | 4156770 | 2016-08-31 16:35:01 -0700 | [diff] [blame] | 542 | static_libs: [ |
| 543 | "libtinyxml2", |
| 544 | "liblog", |
| 545 | "libbase", |
| 546 | ], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 547 | shared: { |
| 548 | enabled: false, |
| 549 | }, |
Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 550 | |
| 551 | generated_headers: ["generated_android_ids"], |
Pirama Arumuga Nainar | fef519b | 2022-02-22 15:01:27 -0800 | [diff] [blame] | 552 | |
| 553 | // Bug: http://b/218788252 IR verifier too strict for ifunc resolver that |
| 554 | // accept parameters. |
| 555 | lto: { |
| 556 | never: true, |
| 557 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 558 | } |
| 559 | |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 560 | cc_test_library { |
| 561 | name: "libBionicElfTlsTests", |
| 562 | defaults: ["bionic_tests_defaults"], |
| 563 | srcs: [ |
| 564 | "elftls_test.cpp", |
| 565 | ], |
| 566 | include_dirs: [ |
| 567 | "bionic/libc", |
| 568 | ], |
| 569 | shared: { |
| 570 | enabled: false, |
| 571 | }, |
| 572 | cflags: [ |
| 573 | "-fno-emulated-tls", |
| 574 | ], |
Mitch Phillips | 2f1bdef | 2019-05-01 14:26:13 -0700 | [diff] [blame] | 575 | // With fuzzer builds, compiler instrumentation generates a reference to the |
| 576 | // __sancov_lowest_stack variable, which (for now) is defined by the fuzzer |
| 577 | // library as an emutls symbol. The -fno-emulated-tls flag above configures |
| 578 | // the compiler to reference an ordinary ELF TLS __sancov_lowest_stack |
| 579 | // symbol instead, which isn't defined. Disable the fuzzer for this test |
| 580 | // until the platform is switched to ELF TLS. |
| 581 | sanitize: { |
| 582 | fuzzer: false, |
| 583 | }, |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 584 | } |
| 585 | |
| 586 | cc_test_library { |
| 587 | name: "libBionicElfTlsLoaderTests", |
| 588 | defaults: ["bionic_tests_defaults"], |
| 589 | srcs: [ |
| 590 | "elftls_dl_test.cpp", |
| 591 | ], |
| 592 | include_dirs: [ |
| 593 | "bionic/libc", |
| 594 | ], |
| 595 | static_libs: [ |
| 596 | "liblog", |
| 597 | "libbase", |
| 598 | ], |
| 599 | shared: { |
| 600 | enabled: false, |
| 601 | }, |
| 602 | cflags: [ |
| 603 | "-fno-emulated-tls", |
| 604 | ], |
Mitch Phillips | 2f1bdef | 2019-05-01 14:26:13 -0700 | [diff] [blame] | 605 | // With fuzzer builds, compiler instrumentation generates a reference to the |
| 606 | // __sancov_lowest_stack variable, which (for now) is defined by the fuzzer |
| 607 | // library as an emutls symbol. The -fno-emulated-tls flag above configures |
| 608 | // the compiler to reference an ordinary ELF TLS __sancov_lowest_stack |
| 609 | // symbol instead, which isn't defined. Disable the fuzzer for this test |
| 610 | // until the platform is switched to ELF TLS. |
| 611 | sanitize: { |
| 612 | fuzzer: false, |
| 613 | }, |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 614 | } |
| 615 | |
Peter Collingbourne | 5f45c18 | 2020-01-14 17:59:41 -0800 | [diff] [blame] | 616 | cc_test_library { |
| 617 | name: "libBionicFramePointerTests", |
| 618 | defaults: ["bionic_tests_defaults"], |
| 619 | srcs: [ |
| 620 | "android_unsafe_frame_pointer_chase_test.cpp", |
| 621 | ], |
| 622 | include_dirs: [ |
| 623 | "bionic/libc", |
| 624 | ], |
| 625 | cflags: [ |
| 626 | "-fno-omit-frame-pointer", |
| 627 | ], |
| 628 | } |
| 629 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 630 | // ----------------------------------------------------------------------------- |
| 631 | // Fortify tests. |
| 632 | // ----------------------------------------------------------------------------- |
| 633 | |
| 634 | cc_defaults { |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 635 | name: "bionic_clang_fortify_tests_w_flags", |
| 636 | cflags: [ |
| 637 | "-Wno-builtin-memcpy-chk-size", |
George Burgess IV | 26d25a2 | 2019-06-06 17:45:05 -0700 | [diff] [blame] | 638 | "-Wno-format-security", |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 639 | "-Wno-format-zero-length", |
Yi Kong | bf67ea5 | 2019-08-03 18:26:05 -0700 | [diff] [blame] | 640 | "-Wno-fortify-source", |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 641 | "-Wno-memset-transposed-args", |
George Burgess IV | 77f99aa | 2019-06-06 14:14:52 -0700 | [diff] [blame] | 642 | "-Wno-strlcpy-strlcat-size", |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 643 | "-Wno-strncat-size", |
| 644 | ], |
Elliott Hughes | 141b917 | 2021-04-09 17:13:09 -0700 | [diff] [blame] | 645 | static_libs: [ |
| 646 | "libbase", |
| 647 | ], |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 648 | } |
| 649 | |
| 650 | cc_defaults { |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 651 | name: "bionic_fortify_tests_defaults", |
| 652 | cflags: [ |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 653 | "-U_FORTIFY_SOURCE", |
| 654 | ], |
| 655 | srcs: ["fortify_test_main.cpp"], |
Elliott Hughes | 141b917 | 2021-04-09 17:13:09 -0700 | [diff] [blame] | 656 | static_libs: [ |
| 657 | "libbase", |
| 658 | ], |
Chih-Hung Hsieh | 247892e | 2021-01-27 12:28:20 -0800 | [diff] [blame] | 659 | tidy: false, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 660 | target: { |
Colin Cross | a48237b | 2022-02-03 10:28:12 -0800 | [diff] [blame] | 661 | musl: { |
| 662 | // Musl doesn't have fortify |
| 663 | enabled: false, |
| 664 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 665 | }, |
| 666 | } |
| 667 | |
George Burgess IV | 8a0cdb1 | 2019-10-21 13:27:57 -0700 | [diff] [blame] | 668 | // Ensures that FORTIFY checks aren't run when ASAN is on. |
| 669 | cc_test { |
| 670 | name: "bionic-fortify-runtime-asan-test", |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 671 | defaults: [ |
| 672 | "bionic_clang_fortify_tests_w_flags", |
| 673 | ], |
George Burgess IV | d9551db | 2017-08-17 18:51:02 -0700 | [diff] [blame] | 674 | cflags: [ |
| 675 | "-Werror", |
| 676 | "-D_FORTIFY_SOURCE=2", |
George Burgess IV | d9551db | 2017-08-17 18:51:02 -0700 | [diff] [blame] | 677 | ], |
George Burgess IV | 8a0cdb1 | 2019-10-21 13:27:57 -0700 | [diff] [blame] | 678 | sanitize: { |
| 679 | address: true, |
| 680 | }, |
| 681 | srcs: ["clang_fortify_asan.cpp"], |
George Burgess IV | d9551db | 2017-08-17 18:51:02 -0700 | [diff] [blame] | 682 | } |
| 683 | |
George Burgess IV | e5d66eb | 2017-10-30 21:41:22 -0700 | [diff] [blame] | 684 | // Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy: |
| 685 | // it can confuse these tools pretty easily. If this builds successfully, then |
| 686 | // __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly |
| 687 | // enabled. The library that results from building this is meant to be unused. |
| 688 | cc_test_library { |
| 689 | name: "fortify_disabled_for_tidy", |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 690 | defaults: [ |
| 691 | "bionic_clang_fortify_tests_w_flags", |
| 692 | ], |
George Burgess IV | e5d66eb | 2017-10-30 21:41:22 -0700 | [diff] [blame] | 693 | cflags: [ |
| 694 | "-Werror", |
| 695 | "-D_FORTIFY_SOURCE=2", |
| 696 | "-D__clang_analyzer__", |
| 697 | ], |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 698 | srcs: ["clang_fortify_tests.cpp"], |
Chih-Hung Hsieh | 247892e | 2021-01-27 12:28:20 -0800 | [diff] [blame] | 699 | tidy: false, |
George Burgess IV | e5d66eb | 2017-10-30 21:41:22 -0700 | [diff] [blame] | 700 | } |
| 701 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 702 | cc_test_library { |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 703 | name: "libfortify1-tests-clang", |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 704 | defaults: [ |
| 705 | "bionic_fortify_tests_defaults", |
| 706 | "bionic_tests_defaults", |
| 707 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 708 | cflags: [ |
| 709 | "-D_FORTIFY_SOURCE=1", |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 710 | "-DTEST_NAME=Fortify1_clang", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 711 | ], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 712 | shared: { |
| 713 | enabled: false, |
| 714 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 715 | } |
| 716 | |
| 717 | cc_test_library { |
| 718 | name: "libfortify2-tests-clang", |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 719 | defaults: [ |
| 720 | "bionic_fortify_tests_defaults", |
| 721 | "bionic_tests_defaults", |
| 722 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 723 | cflags: [ |
| 724 | "-D_FORTIFY_SOURCE=2", |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 725 | "-DTEST_NAME=Fortify2_clang", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 726 | ], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 727 | shared: { |
| 728 | enabled: false, |
| 729 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 730 | } |
| 731 | |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 732 | cc_defaults { |
| 733 | name: "bionic_new_fortify_tests_defaults", |
| 734 | defaults: [ |
| 735 | "bionic_clang_fortify_tests_w_flags", |
| 736 | ], |
| 737 | cflags: [ |
| 738 | "-U_FORTIFY_SOURCE", |
| 739 | ], |
| 740 | srcs: ["clang_fortify_tests.cpp"], |
Chih-Hung Hsieh | 247892e | 2021-01-27 12:28:20 -0800 | [diff] [blame] | 741 | tidy: false, |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 742 | target: { |
| 743 | host: { |
Alix | d256925 | 2022-04-21 02:54:27 +0000 | [diff] [blame] | 744 | cflags: ["-D__clang__"], |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 745 | }, |
| 746 | }, |
| 747 | } |
| 748 | |
| 749 | cc_test_library { |
| 750 | name: "libfortify1-new-tests-clang", |
| 751 | defaults: [ |
| 752 | "bionic_new_fortify_tests_defaults", |
| 753 | "bionic_tests_defaults", |
| 754 | ], |
| 755 | cflags: [ |
| 756 | "-D_FORTIFY_SOURCE=1", |
| 757 | "-DTEST_NAME=Fortify1_clang_new", |
| 758 | ], |
| 759 | shared: { |
| 760 | enabled: false, |
| 761 | }, |
| 762 | } |
| 763 | |
| 764 | cc_test_library { |
| 765 | name: "libfortify2-new-tests-clang", |
| 766 | defaults: [ |
| 767 | "bionic_new_fortify_tests_defaults", |
| 768 | "bionic_tests_defaults", |
| 769 | ], |
| 770 | cflags: [ |
| 771 | "-D_FORTIFY_SOURCE=2", |
| 772 | "-DTEST_NAME=Fortify2_clang_new", |
| 773 | ], |
| 774 | shared: { |
| 775 | enabled: false, |
| 776 | }, |
| 777 | } |
| 778 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 779 | // ----------------------------------------------------------------------------- |
| 780 | // Library of all tests (excluding the dynamic linker tests). |
| 781 | // ----------------------------------------------------------------------------- |
| 782 | cc_test_library { |
| 783 | name: "libBionicTests", |
| 784 | defaults: ["bionic_tests_defaults"], |
Colin Cross | a48237b | 2022-02-03 10:28:12 -0800 | [diff] [blame] | 785 | host_supported: false, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 786 | whole_static_libs: [ |
| 787 | "libBionicStandardTests", |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 788 | "libBionicElfTlsTests", |
Peter Collingbourne | 5f45c18 | 2020-01-14 17:59:41 -0800 | [diff] [blame] | 789 | "libBionicFramePointerTests", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 790 | "libfortify1-tests-clang", |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 791 | "libfortify1-new-tests-clang", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 792 | "libfortify2-tests-clang", |
George Burgess IV | 9a27410 | 2019-06-04 15:39:52 -0700 | [diff] [blame] | 793 | "libfortify2-new-tests-clang", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 794 | ], |
Dan Willemsen | 4156770 | 2016-08-31 16:35:01 -0700 | [diff] [blame] | 795 | shared: { |
| 796 | enabled: false, |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 797 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 798 | } |
| 799 | |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 800 | cc_test_library { |
| 801 | name: "libBionicLoaderTests", |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 802 | defaults: [ |
| 803 | "bionic_tests_defaults", |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 804 | ], |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 805 | srcs: [ |
| 806 | "atexit_test.cpp", |
| 807 | "dl_test.cpp", |
Dimitry Ivanov | 708589f | 2016-09-19 10:50:28 -0700 | [diff] [blame] | 808 | "dlfcn_symlink_support.cpp", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 809 | "dlfcn_test.cpp", |
Christopher Ferris | 11526e2 | 2021-10-14 22:44:47 +0000 | [diff] [blame] | 810 | "execinfo_test.cpp", |
Elliott Hughes | 7c10abb | 2017-04-21 17:15:41 -0700 | [diff] [blame] | 811 | "link_test.cpp", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 812 | "pthread_dlfcn_test.cpp", |
| 813 | ], |
| 814 | static_libs: [ |
| 815 | "libbase", |
| 816 | ], |
| 817 | include_dirs: [ |
| 818 | "bionic/libc", |
| 819 | ], |
| 820 | shared: { |
| 821 | enabled: false, |
| 822 | }, |
| 823 | target: { |
| 824 | android: { |
| 825 | srcs: [ |
Evgenii Stepanov | 0a3637d | 2016-07-06 13:20:59 -0700 | [diff] [blame] | 826 | "cfi_test.cpp", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 827 | "dlext_test.cpp", |
| 828 | "libdl_test.cpp", |
| 829 | ], |
| 830 | static_libs: [ |
Sandeep Patil | e3f39a0 | 2019-01-21 14:22:05 -0800 | [diff] [blame] | 831 | "libmeminfo", |
Torne (Richard Coles) | efbe9a5 | 2018-10-17 15:59:38 -0400 | [diff] [blame] | 832 | "libprocinfo", |
Andreas Gampe | b9797fe | 2017-07-05 22:36:20 -0700 | [diff] [blame] | 833 | "libziparchive", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 834 | ], |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 835 | }, |
Jiyong Park | 02586a2 | 2017-05-20 01:01:24 +0900 | [diff] [blame] | 836 | }, |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 837 | } |
| 838 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 839 | // ----------------------------------------------------------------------------- |
| 840 | // Library of bionic customized gtest main function, with normal gtest output format, |
| 841 | // which is needed by bionic cts test. |
| 842 | // ----------------------------------------------------------------------------- |
| 843 | cc_test_library { |
| 844 | name: "libBionicCtsGtestMain", |
| 845 | defaults: ["bionic_tests_defaults"], |
Dimitry Ivanov | 927877c | 2016-09-21 11:17:13 -0700 | [diff] [blame] | 846 | srcs: [ |
Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 847 | "gtest_globals.cpp", |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 848 | "gtest_main.cpp", |
Dimitry Ivanov | 927877c | 2016-09-21 11:17:13 -0700 | [diff] [blame] | 849 | ], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 850 | shared: { |
| 851 | enabled: false, |
| 852 | }, |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 853 | whole_static_libs: [ |
Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 854 | "libbase", |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 855 | "libgtest_isolated", |
| 856 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 857 | } |
| 858 | |
| 859 | // ----------------------------------------------------------------------------- |
| 860 | // Tests for the device using bionic's .so. Run with: |
Bernie Innocenti | b664724 | 2018-06-18 14:14:43 +0900 | [diff] [blame] | 861 | // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests |
| 862 | // adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 863 | // ----------------------------------------------------------------------------- |
| 864 | cc_defaults { |
| 865 | name: "bionic_unit_tests_defaults", |
| 866 | host_supported: false, |
Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 867 | gtest: false, |
| 868 | |
| 869 | defaults: [ |
| 870 | "bionic_tests_defaults", |
| 871 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 872 | |
| 873 | whole_static_libs: [ |
| 874 | "libBionicTests", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 875 | "libBionicLoaderTests", |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 876 | "libBionicElfTlsLoaderTests", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 877 | ], |
| 878 | |
| 879 | static_libs: [ |
| 880 | "libtinyxml2", |
| 881 | "liblog", |
| 882 | "libbase", |
Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 883 | "libgtest_isolated", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 884 | ], |
| 885 | |
| 886 | srcs: [ |
| 887 | // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+) |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 888 | "__cxa_thread_atexit_test.cpp", |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 889 | "gtest_globals.cpp", |
Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 890 | "gtest_main.cpp", |
Mitch Phillips | 9634c36 | 2022-06-23 11:07:00 -0700 | [diff] [blame] | 891 | "gwp_asan_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 892 | "thread_local_test.cpp", |
| 893 | ], |
| 894 | |
| 895 | conlyflags: [ |
| 896 | "-fexceptions", |
| 897 | "-fnon-call-exceptions", |
| 898 | ], |
| 899 | |
| 900 | ldflags: ["-Wl,--export-dynamic"], |
| 901 | |
| 902 | include_dirs: ["bionic/libc"], |
| 903 | |
Yabin Cui | 1f553ea | 2017-01-13 12:31:59 -0800 | [diff] [blame] | 904 | stl: "libc++_static", |
| 905 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 906 | target: { |
| 907 | android: { |
| 908 | shared_libs: [ |
dimitry | 321476a | 2018-01-29 15:32:37 +0100 | [diff] [blame] | 909 | "ld-android", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 910 | "libdl", |
dimitry | 2d6be9a | 2019-03-19 13:01:42 +0100 | [diff] [blame] | 911 | "libdl_android", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 912 | "libdl_preempt_test_1", |
| 913 | "libdl_preempt_test_2", |
| 914 | "libdl_test_df_1_global", |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 915 | "libtest_elftls_shared_var", |
| 916 | "libtest_elftls_tprel", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 917 | ], |
| 918 | static_libs: [ |
| 919 | // The order of these libraries matters, do not shuffle them. |
Sandeep Patil | e3f39a0 | 2019-01-21 14:22:05 -0800 | [diff] [blame] | 920 | "libmeminfo", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 921 | "libziparchive", |
| 922 | "libz", |
| 923 | "libutils", |
| 924 | ], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 925 | ldflags: [ |
Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 926 | "-Wl,--rpath,${ORIGIN}/bionic-loader-test-libs", |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 927 | "-Wl,--enable-new-dtags", |
| 928 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 929 | }, |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 930 | }, |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 931 | |
Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 932 | data_bins: [ |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 933 | "cfi_test_helper", |
| 934 | "cfi_test_helper2", |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 935 | "elftls_dlopen_ie_error_helper", |
Ryan Prichard | 8f639a4 | 2018-10-01 23:10:05 -0700 | [diff] [blame] | 936 | "exec_linker_helper", |
| 937 | "exec_linker_helper_lib", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 938 | "heap_tagging_async_helper", |
| 939 | "heap_tagging_disabled_helper", |
| 940 | "heap_tagging_static_async_helper", |
| 941 | "heap_tagging_static_disabled_helper", |
| 942 | "heap_tagging_static_sync_helper", |
| 943 | "heap_tagging_sync_helper", |
Florian Mayer | c82d7fc | 2022-08-31 20:57:03 +0000 | [diff] [blame] | 944 | "stack_tagging_helper", |
| 945 | "stack_tagging_static_helper", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 946 | "ld_config_test_helper", |
| 947 | "ld_config_test_helper_lib1", |
| 948 | "ld_config_test_helper_lib2", |
| 949 | "ld_config_test_helper_lib3", |
| 950 | "ld_preload_test_helper", |
| 951 | "ld_preload_test_helper_lib1", |
| 952 | "ld_preload_test_helper_lib2", |
Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 953 | "ns_hidden_child_helper", |
| 954 | "preinit_getauxval_test_helper", |
| 955 | "preinit_syscall_test_helper", |
| 956 | "thread_exit_cb_helper", |
| 957 | "tls_properties_helper", |
| 958 | ], |
| 959 | |
| 960 | data_libs: [ |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 961 | "libatest_simple_zip", |
| 962 | "libcfi-test", |
| 963 | "libcfi-test-bad", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 964 | "libdl_preempt_test_1", |
| 965 | "libdl_preempt_test_2", |
| 966 | "libdl_test_df_1_global", |
| 967 | "libdlext_test", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 968 | "libdlext_test_different_soname", |
| 969 | "libdlext_test_fd", |
| 970 | "libdlext_test_norelro", |
Torne (Richard Coles) | efbe9a5 | 2018-10-17 15:59:38 -0400 | [diff] [blame] | 971 | "libdlext_test_recursive", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 972 | "libdlext_test_zip", |
Dimitry Ivanov | f1db837 | 2017-04-19 11:58:52 -0700 | [diff] [blame] | 973 | "libgnu-hash-table-library", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 974 | "libns_hidden_child_app", |
| 975 | "libns_hidden_child_global", |
| 976 | "libns_hidden_child_internal", |
| 977 | "libns_hidden_child_public", |
| 978 | "libnstest_dlopened", |
| 979 | "libnstest_ns_a_public1", |
| 980 | "libnstest_ns_a_public1_internal", |
| 981 | "libnstest_ns_b_public2", |
| 982 | "libnstest_ns_b_public3", |
| 983 | "libnstest_private", |
| 984 | "libnstest_private_external", |
| 985 | "libnstest_public", |
| 986 | "libnstest_public_internal", |
| 987 | "libnstest_root", |
| 988 | "libnstest_root_not_isolated", |
Elliott Hughes | 6dd1f58 | 2020-01-28 12:18:35 -0800 | [diff] [blame] | 989 | "librelocations-ANDROID_REL", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 990 | "librelocations-ANDROID_RELR", |
Elliott Hughes | 6dd1f58 | 2020-01-28 12:18:35 -0800 | [diff] [blame] | 991 | "librelocations-RELR", |
| 992 | "librelocations-fat", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 993 | "libsegment_gap_inner", |
| 994 | "libsegment_gap_outer", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 995 | "libsysv-hash-table-library", |
| 996 | "libtest_atexit", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 997 | "libtest_check_order_dlsym", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 998 | "libtest_check_order_dlsym_1_left", |
| 999 | "libtest_check_order_dlsym_2_right", |
| 1000 | "libtest_check_order_dlsym_3_c", |
| 1001 | "libtest_check_order_dlsym_a", |
| 1002 | "libtest_check_order_dlsym_b", |
| 1003 | "libtest_check_order_dlsym_d", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1004 | "libtest_check_order_reloc_root", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1005 | "libtest_check_order_reloc_root_1", |
| 1006 | "libtest_check_order_reloc_root_2", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1007 | "libtest_check_order_reloc_siblings", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1008 | "libtest_check_order_reloc_siblings_1", |
| 1009 | "libtest_check_order_reloc_siblings_2", |
| 1010 | "libtest_check_order_reloc_siblings_3", |
| 1011 | "libtest_check_order_reloc_siblings_a", |
| 1012 | "libtest_check_order_reloc_siblings_b", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1013 | "libtest_check_order_reloc_siblings_c", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1014 | "libtest_check_order_reloc_siblings_c_1", |
| 1015 | "libtest_check_order_reloc_siblings_c_2", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1016 | "libtest_check_order_reloc_siblings_d", |
| 1017 | "libtest_check_order_reloc_siblings_e", |
| 1018 | "libtest_check_order_reloc_siblings_f", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1019 | "libtest_check_rtld_next_from_library", |
Pirama Arumuga Nainar | c53e8b8 | 2018-03-27 10:32:19 -0700 | [diff] [blame] | 1020 | "libtest_dlopen_df_1_global", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1021 | "libtest_dlopen_from_ctor", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1022 | "libtest_dlopen_from_ctor_main", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1023 | "libtest_dlopen_weak_undefined_func", |
| 1024 | "libtest_dlsym_df_1_global", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1025 | "libtest_dlsym_from_this", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1026 | "libtest_dlsym_from_this_child", |
| 1027 | "libtest_dlsym_from_this_grandchild", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1028 | "libtest_dlsym_weak_func", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1029 | "libtest_dt_runpath_a", |
| 1030 | "libtest_dt_runpath_b", |
| 1031 | "libtest_dt_runpath_c", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1032 | "libtest_dt_runpath_d", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1033 | "libtest_dt_runpath_x", |
| 1034 | "libtest_dt_runpath_y", |
Ryan Prichard | e84ebbb | 2019-01-23 23:19:19 -0800 | [diff] [blame] | 1035 | "libtest_elftls_dynamic", |
| 1036 | "libtest_elftls_dynamic_filler_1", |
| 1037 | "libtest_elftls_dynamic_filler_2", |
| 1038 | "libtest_elftls_dynamic_filler_3", |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 1039 | "libtest_elftls_shared_var", |
| 1040 | "libtest_elftls_shared_var_ie", |
| 1041 | "libtest_elftls_tprel", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1042 | "libtest_empty", |
Dimitry Ivanov | f1db837 | 2017-04-19 11:58:52 -0700 | [diff] [blame] | 1043 | "libtest_ifunc", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1044 | "libtest_ifunc_variable", |
| 1045 | "libtest_ifunc_variable_impl", |
| 1046 | "libtest_indirect_thread_local_dtor", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1047 | "libtest_init_fini_order_child", |
| 1048 | "libtest_init_fini_order_grand_child", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1049 | "libtest_init_fini_order_root", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1050 | "libtest_init_fini_order_root2", |
| 1051 | "libtest_invalid-empty_shdr_table", |
Ryan Prichard | 8ea6af5 | 2022-03-24 21:14:27 -0700 | [diff] [blame] | 1052 | "libtest_invalid-local-tls", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1053 | "libtest_invalid-rw_load_segment", |
| 1054 | "libtest_invalid-textrels", |
| 1055 | "libtest_invalid-textrels2", |
| 1056 | "libtest_invalid-unaligned_shdr_offset", |
| 1057 | "libtest_invalid-zero_shdr_table_content", |
| 1058 | "libtest_invalid-zero_shdr_table_offset", |
| 1059 | "libtest_invalid-zero_shentsize", |
| 1060 | "libtest_invalid-zero_shstrndx", |
Pirama Arumuga Nainar | c53e8b8 | 2018-03-27 10:32:19 -0700 | [diff] [blame] | 1061 | "libtest_missing_symbol", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1062 | "libtest_missing_symbol_child_private", |
| 1063 | "libtest_missing_symbol_child_public", |
| 1064 | "libtest_missing_symbol_root", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1065 | "libtest_nodelete_1", |
| 1066 | "libtest_nodelete_2", |
| 1067 | "libtest_nodelete_dt_flags_1", |
| 1068 | "libtest_pthread_atfork", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1069 | "libtest_relo_check_dt_needed_order", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1070 | "libtest_relo_check_dt_needed_order_1", |
| 1071 | "libtest_relo_check_dt_needed_order_2", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1072 | "libtest_simple", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1073 | "libtest_thread_local_dtor", |
| 1074 | "libtest_thread_local_dtor2", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1075 | "libtest_two_parents_child", |
| 1076 | "libtest_two_parents_parent1", |
| 1077 | "libtest_two_parents_parent2", |
| 1078 | "libtest_versioned_lib", |
| 1079 | "libtest_versioned_libv1", |
| 1080 | "libtest_versioned_libv2", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1081 | "libtest_versioned_otherlib", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1082 | "libtest_versioned_otherlib_empty", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1083 | "libtest_versioned_uselibv1", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1084 | "libtest_versioned_uselibv2", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1085 | "libtest_versioned_uselibv2_other", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1086 | "libtest_versioned_uselibv3_other", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1087 | "libtest_with_dependency", |
| 1088 | "libtest_with_dependency_loop", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1089 | "libtest_with_dependency_loop_a", |
| 1090 | "libtest_with_dependency_loop_b", |
| 1091 | "libtest_with_dependency_loop_c", |
Evgenii Stepanov | df6b16e | 2021-01-12 16:07:50 -0800 | [diff] [blame] | 1092 | "libtestshared", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 1093 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1094 | } |
| 1095 | |
Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 1096 | cc_test { |
| 1097 | name: "bionic-unit-tests", |
| 1098 | defaults: [ |
| 1099 | "bionic_unit_tests_defaults", |
| 1100 | ], |
Colin Cross | 0cc60af | 2021-09-30 14:04:39 -0700 | [diff] [blame] | 1101 | test_suites: ["device-tests"], |
Colin Cross | badcb38 | 2021-09-24 17:49:58 -0700 | [diff] [blame] | 1102 | data: [ |
| 1103 | ":libdlext_test_runpath_zip_zipaligned", |
| 1104 | ":libdlext_test_zip_zipaligned", |
| 1105 | ], |
Christopher Ferris | fc26d71 | 2019-02-27 18:07:55 -0800 | [diff] [blame] | 1106 | } |
| 1107 | |
| 1108 | cc_test { |
Christopher Ferris | ee0ce44 | 2019-10-21 12:35:05 -0700 | [diff] [blame] | 1109 | name: "bionic-stress-tests", |
| 1110 | defaults: [ |
| 1111 | "bionic_tests_defaults", |
| 1112 | ], |
| 1113 | |
| 1114 | // For now, these tests run forever, so do not use the isolation framework. |
| 1115 | isolated: false, |
Julien Desprez | 11874f8 | 2021-02-05 00:52:14 +0000 | [diff] [blame] | 1116 | // Running forever, do not consider unit test. |
| 1117 | test_options: { |
| 1118 | unit_test: false, |
| 1119 | }, |
Christopher Ferris | ee0ce44 | 2019-10-21 12:35:05 -0700 | [diff] [blame] | 1120 | |
| 1121 | srcs: [ |
| 1122 | "malloc_stress_test.cpp", |
| 1123 | ], |
| 1124 | |
| 1125 | shared_libs: [ |
| 1126 | "libbase", |
| 1127 | ], |
| 1128 | |
| 1129 | target: { |
| 1130 | android: { |
| 1131 | static_libs: [ |
| 1132 | "libmeminfo", |
| 1133 | "libprocinfo", |
| 1134 | ], |
| 1135 | }, |
| 1136 | }, |
| 1137 | } |
| 1138 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1139 | // ----------------------------------------------------------------------------- |
| 1140 | // Tests for the device linked against bionic's static library. Run with: |
Bernie Innocenti | b664724 | 2018-06-18 14:14:43 +0900 | [diff] [blame] | 1141 | // adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static |
| 1142 | // adb shell /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1143 | // ----------------------------------------------------------------------------- |
| 1144 | cc_test { |
| 1145 | name: "bionic-unit-tests-static", |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1146 | gtest: false, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1147 | defaults: ["bionic_tests_defaults"], |
Colin Cross | 0cc60af | 2021-09-30 14:04:39 -0700 | [diff] [blame] | 1148 | test_suites: ["device-tests"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1149 | host_supported: false, |
| 1150 | |
Dimitry Ivanov | 462ea66 | 2017-01-06 14:49:57 -0800 | [diff] [blame] | 1151 | srcs: [ |
| 1152 | "gtest_preinit_debuggerd.cpp", |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1153 | "gtest_globals.cpp", |
| 1154 | "gtest_main.cpp", |
Ryan Prichard | 083d850 | 2019-01-24 13:47:13 -0800 | [diff] [blame] | 1155 | |
| 1156 | // The Bionic allocator has its own C++ API. It isn't packaged into its |
| 1157 | // own library, so it can only be tested when it's part of libc.a. |
| 1158 | "bionic_allocator_test.cpp", |
| 1159 | ], |
| 1160 | include_dirs: [ |
| 1161 | "bionic/libc", |
Dimitry Ivanov | 462ea66 | 2017-01-06 14:49:57 -0800 | [diff] [blame] | 1162 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1163 | whole_static_libs: [ |
| 1164 | "libBionicTests", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1165 | ], |
| 1166 | |
| 1167 | static_libs: [ |
| 1168 | "libm", |
| 1169 | "libc", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1170 | "libdl", |
| 1171 | "libtinyxml2", |
| 1172 | "liblog", |
| 1173 | "libbase", |
Josh Gao | 2a3b4fa | 2016-10-26 17:55:49 -0700 | [diff] [blame] | 1174 | "libdebuggerd_handler", |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1175 | "libgtest_isolated", |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 1176 | "libtest_elftls_shared_var", |
| 1177 | "libtest_elftls_tprel", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1178 | ], |
| 1179 | |
| 1180 | static_executable: true, |
| 1181 | stl: "libc++_static", |
Yi Kong | b952a77 | 2021-10-21 17:31:35 +0800 | [diff] [blame] | 1182 | // Clang cannot build ifunc with LTO. |
| 1183 | // http://b/203737712 |
| 1184 | lto: { |
| 1185 | never: true, |
| 1186 | }, |
Mitch Phillips | 9425b16 | 2022-02-04 17:13:27 -0800 | [diff] [blame] | 1187 | data_bins: [ |
| 1188 | "heap_tagging_async_helper", |
| 1189 | "heap_tagging_disabled_helper", |
| 1190 | "heap_tagging_static_async_helper", |
| 1191 | "heap_tagging_static_disabled_helper", |
| 1192 | "heap_tagging_static_sync_helper", |
| 1193 | "heap_tagging_sync_helper", |
Florian Mayer | c82d7fc | 2022-08-31 20:57:03 +0000 | [diff] [blame] | 1194 | "stack_tagging_helper", |
| 1195 | "stack_tagging_static_helper", |
Mitch Phillips | 9425b16 | 2022-02-04 17:13:27 -0800 | [diff] [blame] | 1196 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1197 | } |
| 1198 | |
| 1199 | // ----------------------------------------------------------------------------- |
| 1200 | // Tests to run on the host and linked against glibc. Run with: |
| 1201 | // cd bionic/tests; mm bionic-unit-tests-glibc-run |
| 1202 | // ----------------------------------------------------------------------------- |
| 1203 | |
| 1204 | cc_test_host { |
| 1205 | name: "bionic-unit-tests-glibc", |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1206 | gtest: false, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1207 | defaults: ["bionic_tests_defaults"], |
| 1208 | |
| 1209 | srcs: [ |
| 1210 | "atexit_test.cpp", |
Dimitry Ivanov | 708589f | 2016-09-19 10:50:28 -0700 | [diff] [blame] | 1211 | "dlfcn_symlink_support.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1212 | "dlfcn_test.cpp", |
| 1213 | "dl_test.cpp", |
Christopher Ferris | 11526e2 | 2021-10-14 22:44:47 +0000 | [diff] [blame] | 1214 | "execinfo_test.cpp", |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1215 | "gtest_globals.cpp", |
| 1216 | "gtest_main.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1217 | "pthread_dlfcn_test.cpp", |
| 1218 | ], |
| 1219 | |
| 1220 | shared_libs: [ |
| 1221 | "libdl_preempt_test_1", |
| 1222 | "libdl_preempt_test_2", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1223 | "libdl_test_df_1_global", |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 1224 | "libtest_elftls_shared_var", |
| 1225 | "libtest_elftls_tprel", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1226 | ], |
| 1227 | |
| 1228 | whole_static_libs: [ |
| 1229 | "libBionicStandardTests", |
Ryan Prichard | 5cf02f6 | 2019-01-15 20:35:00 -0800 | [diff] [blame] | 1230 | "libBionicElfTlsTests", |
| 1231 | "libBionicElfTlsLoaderTests", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1232 | "libfortify1-tests-clang", |
| 1233 | "libfortify2-tests-clang", |
| 1234 | ], |
| 1235 | |
| 1236 | static_libs: [ |
| 1237 | "libbase", |
| 1238 | "liblog", |
| 1239 | "libcutils", |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1240 | "libgtest_isolated", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1241 | ], |
| 1242 | |
| 1243 | host_ldlibs: [ |
| 1244 | "-lresolv", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1245 | "-lutil", |
| 1246 | ], |
| 1247 | |
Christopher Ferris | 6d2c0bd | 2018-08-21 18:13:10 -0700 | [diff] [blame] | 1248 | include_dirs: [ |
| 1249 | "bionic/libc", |
| 1250 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1251 | |
Dimitry Ivanov | d0b5c3a | 2016-11-25 12:23:11 -0800 | [diff] [blame] | 1252 | ldflags: [ |
| 1253 | "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs", |
| 1254 | "-Wl,--export-dynamic", |
| 1255 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1256 | |
| 1257 | sanitize: { |
| 1258 | never: false, |
| 1259 | }, |
Dan Willemsen | 268ae36 | 2017-09-21 16:56:06 -0700 | [diff] [blame] | 1260 | |
| 1261 | target: { |
| 1262 | linux_bionic: { |
| 1263 | enabled: false, |
| 1264 | }, |
Colin Cross | 7da2034 | 2021-07-28 11:18:11 -0700 | [diff] [blame] | 1265 | musl: { |
| 1266 | exclude_static_libs: [ |
| 1267 | // Musl doesn't have fortify |
| 1268 | "libfortify1-tests-clang", |
| 1269 | "libfortify2-tests-clang", |
| 1270 | ], |
| 1271 | }, |
Dan Willemsen | 268ae36 | 2017-09-21 16:56:06 -0700 | [diff] [blame] | 1272 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1273 | } |
| 1274 | |
Elliott Hughes | 21b56eb | 2017-10-20 17:57:17 -0700 | [diff] [blame] | 1275 | subdirs = ["*"] |