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