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