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