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