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