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