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