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