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