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