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