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