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