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