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, |
| 20 | target: { |
| 21 | darwin: { |
| 22 | enabled: false, |
| 23 | }, |
| 24 | }, |
| 25 | cflags: [ |
| 26 | "-fstack-protector-all", |
| 27 | "-g", |
| 28 | "-Wall", |
| 29 | "-Wextra", |
| 30 | "-Wunused", |
| 31 | "-Werror", |
| 32 | "-fno-builtin", |
| 33 | |
| 34 | // We want to test deprecated API too. |
| 35 | "-Wno-deprecated-declarations", |
| 36 | |
| 37 | // For glibc. |
| 38 | "-D__STDC_LIMIT_MACROS", |
| 39 | ], |
| 40 | stl: "libc++", |
| 41 | sanitize: { |
| 42 | never: true, |
| 43 | }, |
| 44 | } |
| 45 | |
| 46 | // ----------------------------------------------------------------------------- |
| 47 | // All standard tests. |
| 48 | // ----------------------------------------------------------------------------- |
| 49 | |
| 50 | cc_test_library { |
| 51 | name: "libBionicStandardTests", |
| 52 | defaults: ["bionic_tests_defaults"], |
| 53 | srcs: [ |
| 54 | "arpa_inet_test.cpp", |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 55 | "async_safe_test.cpp", |
Elliott Hughes | f6495c7 | 2016-07-25 09:20:57 -0700 | [diff] [blame] | 56 | "assert_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 57 | "buffer_tests.cpp", |
| 58 | "bug_26110743_test.cpp", |
| 59 | "complex_test.cpp", |
Elliott Hughes | 50cda38 | 2017-09-14 15:30:08 -0700 | [diff] [blame] | 60 | "complex_force_long_double_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 61 | "ctype_test.cpp", |
| 62 | "dirent_test.cpp", |
Elliott Hughes | d390df1 | 2017-04-30 22:56:10 -0700 | [diff] [blame] | 63 | "elf_test.cpp", |
Elliott Hughes | ba267f4 | 2017-02-24 16:19:53 -0800 | [diff] [blame] | 64 | "endian_test.cpp", |
Elliott Hughes | e452cb1 | 2017-06-13 14:43:53 -0700 | [diff] [blame] | 65 | "errno_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 66 | "error_test.cpp", |
| 67 | "eventfd_test.cpp", |
| 68 | "fcntl_test.cpp", |
| 69 | "fenv_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 70 | "float_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 71 | "ftw_test.cpp", |
| 72 | "getauxval_test.cpp", |
| 73 | "getcwd_test.cpp", |
Elliott Hughes | f1c568d | 2017-09-26 17:09:07 -0700 | [diff] [blame] | 74 | "glob_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 75 | "grp_pwd_test.cpp", |
Elliott Hughes | a648733 | 2017-08-15 23:16:48 -0700 | [diff] [blame] | 76 | "iconv_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 77 | "ifaddrs_test.cpp", |
| 78 | "inttypes_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 79 | "iso646_test.c", |
Elliott Hughes | fc8e688 | 2016-11-18 16:27:29 -0800 | [diff] [blame] | 80 | "langinfo_test.cpp", |
Josh Gao | 7d15dc3 | 2017-03-13 17:10:46 -0700 | [diff] [blame] | 81 | "leak_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 82 | "libgen_basename_test.cpp", |
| 83 | "libgen_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 84 | "limits_test.cpp", |
Christopher Ferris | ee1e0a3 | 2017-04-20 13:38:49 -0700 | [diff] [blame] | 85 | "linux_swab_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 86 | "locale_test.cpp", |
| 87 | "malloc_test.cpp", |
| 88 | "math_test.cpp", |
Elliott Hughes | 50cda38 | 2017-09-14 15:30:08 -0700 | [diff] [blame] | 89 | "math_force_long_double_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 90 | "mntent_test.cpp", |
| 91 | "netdb_test.cpp", |
| 92 | "net_if_test.cpp", |
| 93 | "netinet_ether_test.cpp", |
| 94 | "netinet_in_test.cpp", |
| 95 | "netinet_udp_test.cpp", |
| 96 | "nl_types_test.cpp", |
| 97 | "pthread_test.cpp", |
| 98 | "pty_test.cpp", |
Xin Li | 4b1a399 | 2017-05-19 10:13:08 -0700 | [diff] [blame] | 99 | "qsort_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 100 | "regex_test.cpp", |
| 101 | "resolv_test.cpp", |
| 102 | "sched_test.cpp", |
Elliott Hughes | 5059939 | 2017-05-25 17:13:32 -0700 | [diff] [blame] | 103 | "scsi_sg_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 104 | "search_test.cpp", |
| 105 | "semaphore_test.cpp", |
| 106 | "setjmp_test.cpp", |
| 107 | "signal_test.cpp", |
Elliott Hughes | 14e3ff9 | 2017-10-06 16:58:36 -0700 | [diff] [blame^] | 108 | "spawn_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 109 | "stack_protector_test.cpp", |
| 110 | "stack_protector_test_helper.cpp", |
| 111 | "stack_unwinding_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 112 | "stdalign_test.cpp", |
| 113 | "stdarg_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 114 | "stdatomic_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 115 | "stdbool_test.c", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 116 | "stdint_test.cpp", |
| 117 | "stdio_nofortify_test.cpp", |
| 118 | "stdio_test.cpp", |
| 119 | "stdio_ext_test.cpp", |
| 120 | "stdlib_test.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 121 | "stdnoreturn_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 122 | "string_nofortify_test.cpp", |
| 123 | "string_test.cpp", |
| 124 | "string_posix_strerror_r_test.cpp", |
| 125 | "strings_nofortify_test.cpp", |
| 126 | "strings_test.cpp", |
| 127 | "sstream_test.cpp", |
| 128 | "sys_epoll_test.cpp", |
| 129 | "sys_mman_test.cpp", |
Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 130 | "sys_msg_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 131 | "sys_personality_test.cpp", |
| 132 | "sys_prctl_test.cpp", |
| 133 | "sys_procfs_test.cpp", |
| 134 | "sys_ptrace_test.cpp", |
| 135 | "sys_quota_test.cpp", |
Elliott Hughes | 8465e96 | 2017-09-27 16:33:35 -0700 | [diff] [blame] | 136 | "sys_random_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 137 | "sys_resource_test.cpp", |
| 138 | "sys_select_test.cpp", |
Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 139 | "sys_sem_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 140 | "sys_sendfile_test.cpp", |
Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 141 | "sys_shm_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 142 | "sys_socket_test.cpp", |
| 143 | "sys_stat_test.cpp", |
| 144 | "sys_statvfs_test.cpp", |
| 145 | "sys_syscall_test.cpp", |
| 146 | "sys_sysinfo_test.cpp", |
| 147 | "sys_sysmacros_test.cpp", |
| 148 | "sys_time_test.cpp", |
| 149 | "sys_timex_test.cpp", |
Elliott Hughes | 02fdd05 | 2017-07-06 10:33:15 -0700 | [diff] [blame] | 150 | "sys_ttydefaults_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 151 | "sys_types_test.cpp", |
| 152 | "sys_uio_test.cpp", |
| 153 | "sys_vfs_test.cpp", |
| 154 | "sys_xattr_test.cpp", |
| 155 | "system_properties_test.cpp", |
Dimitry Ivanov | 16b2a4d | 2017-01-24 20:43:29 +0000 | [diff] [blame] | 156 | "system_properties_test2.cpp", |
Elliott Hughes | 45da326 | 2017-08-29 15:28:33 -0700 | [diff] [blame] | 157 | "tgmath_test.c", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 158 | "time_test.cpp", |
| 159 | "uchar_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 160 | "unistd_nofortify_test.cpp", |
| 161 | "unistd_test.cpp", |
| 162 | "utmp_test.cpp", |
| 163 | "wchar_test.cpp", |
| 164 | "wctype_test.cpp", |
| 165 | ], |
| 166 | |
| 167 | include_dirs: [ |
| 168 | "bionic/libc", |
| 169 | "external/tinyxml2", |
| 170 | ], |
| 171 | |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 172 | target: { |
Dan Willemsen | 268ae36 | 2017-09-21 16:56:06 -0700 | [diff] [blame] | 173 | bionic: { |
Christopher Ferris | 7a3681e | 2017-04-24 17:48:32 -0700 | [diff] [blame] | 174 | whole_static_libs: ["libasync_safe"], |
| 175 | }, |
| 176 | }, |
| 177 | |
Dan Willemsen | 4156770 | 2016-08-31 16:35:01 -0700 | [diff] [blame] | 178 | static_libs: [ |
| 179 | "libtinyxml2", |
| 180 | "liblog", |
| 181 | "libbase", |
| 182 | ], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 183 | shared: { |
| 184 | enabled: false, |
| 185 | }, |
Elliott Hughes | 3f6eee9 | 2016-12-13 23:47:25 +0000 | [diff] [blame] | 186 | |
| 187 | generated_headers: ["generated_android_ids"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 188 | } |
| 189 | |
| 190 | // ----------------------------------------------------------------------------- |
| 191 | // Fortify tests. |
| 192 | // ----------------------------------------------------------------------------- |
| 193 | |
| 194 | cc_defaults { |
| 195 | name: "bionic_fortify_tests_defaults", |
| 196 | cflags: [ |
| 197 | "-Wno-error", |
| 198 | "-U_FORTIFY_SOURCE", |
| 199 | ], |
| 200 | srcs: ["fortify_test_main.cpp"], |
| 201 | target: { |
| 202 | host: { |
| 203 | clang_cflags: ["-D__clang__"], |
| 204 | }, |
| 205 | }, |
| 206 | } |
| 207 | |
George Burgess IV | d9551db | 2017-08-17 18:51:02 -0700 | [diff] [blame] | 208 | // If building this fails, then we have both FORTIFY and ASAN enabled, which |
| 209 | // isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN |
| 210 | // enabled, but that's not a reality today.) This is meant to be otherwise |
| 211 | // unused. |
| 212 | cc_test_library { |
| 213 | name: "fortify_disabled_for_asan", |
| 214 | cflags: [ |
| 215 | "-Werror", |
| 216 | "-D_FORTIFY_SOURCE=2", |
| 217 | // "sanitize: address" doesn't work on platforms where libasan isn't |
| 218 | // enabled. Since the intent is just to build this, we can get away with |
| 219 | // passing this flag on its own. |
| 220 | "-fsanitize=address", |
| 221 | ], |
| 222 | // Ignore that we don't have ASAN symbols linked in. |
| 223 | allow_undefined_symbols: true, |
| 224 | srcs: ["fortify_compilation_test.cpp"], |
George Burgess IV | d9551db | 2017-08-17 18:51:02 -0700 | [diff] [blame] | 225 | } |
| 226 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 227 | cc_test_library { |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 228 | name: "libfortify1-tests-clang", |
| 229 | defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 230 | cflags: [ |
| 231 | "-D_FORTIFY_SOURCE=1", |
| 232 | "-DTEST_NAME=Fortify1_clang" |
| 233 | ], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 234 | shared: { |
| 235 | enabled: false, |
| 236 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | cc_test_library { |
| 240 | name: "libfortify2-tests-clang", |
| 241 | defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 242 | cflags: [ |
| 243 | "-D_FORTIFY_SOURCE=2", |
| 244 | "-DTEST_NAME=Fortify2_clang" |
| 245 | ], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 246 | shared: { |
| 247 | enabled: false, |
| 248 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 249 | } |
| 250 | |
| 251 | // ----------------------------------------------------------------------------- |
| 252 | // Library of all tests (excluding the dynamic linker tests). |
| 253 | // ----------------------------------------------------------------------------- |
| 254 | cc_test_library { |
| 255 | name: "libBionicTests", |
| 256 | defaults: ["bionic_tests_defaults"], |
| 257 | whole_static_libs: [ |
| 258 | "libBionicStandardTests", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 259 | "libfortify1-tests-clang", |
| 260 | "libfortify2-tests-clang", |
| 261 | ], |
Dan Willemsen | 4156770 | 2016-08-31 16:35:01 -0700 | [diff] [blame] | 262 | shared: { |
| 263 | enabled: false, |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 264 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | // ----------------------------------------------------------------------------- |
| 268 | // Library of bionic customized gtest main function, with simplified output format. |
| 269 | // ----------------------------------------------------------------------------- |
| 270 | cc_test_library { |
| 271 | name: "libBionicGtestMain", |
| 272 | defaults: ["bionic_tests_defaults"], |
Dimitry Ivanov | 927877c | 2016-09-21 11:17:13 -0700 | [diff] [blame] | 273 | srcs: [ |
| 274 | "gtest_main.cpp", |
| 275 | "gtest_globals.cpp", |
| 276 | ], |
| 277 | static_libs: [ |
| 278 | "libbase", |
| 279 | ], |
| 280 | include_dirs: [ |
| 281 | "bionic/libc", |
| 282 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 283 | target: { |
| 284 | darwin: { |
| 285 | enabled: true, |
| 286 | }, |
| 287 | }, |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 288 | shared: { |
| 289 | enabled: false, |
| 290 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 291 | } |
| 292 | |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 293 | cc_test_library { |
| 294 | name: "libBionicLoaderTests", |
Dimitry Ivanov | ac4bd2f | 2016-11-21 12:50:38 -0800 | [diff] [blame] | 295 | defaults: ["bionic_tests_defaults", "llvm-defaults"], |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 296 | srcs: [ |
| 297 | "atexit_test.cpp", |
| 298 | "dl_test.cpp", |
Dimitry Ivanov | 708589f | 2016-09-19 10:50:28 -0700 | [diff] [blame] | 299 | "dlfcn_symlink_support.cpp", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 300 | "dlfcn_test.cpp", |
Elliott Hughes | 7c10abb | 2017-04-21 17:15:41 -0700 | [diff] [blame] | 301 | "link_test.cpp", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 302 | "pthread_dlfcn_test.cpp", |
| 303 | ], |
| 304 | static_libs: [ |
| 305 | "libbase", |
| 306 | ], |
| 307 | include_dirs: [ |
| 308 | "bionic/libc", |
| 309 | ], |
| 310 | shared: { |
| 311 | enabled: false, |
| 312 | }, |
| 313 | target: { |
| 314 | android: { |
| 315 | srcs: [ |
Evgenii Stepanov | 0a3637d | 2016-07-06 13:20:59 -0700 | [diff] [blame] | 316 | "cfi_test.cpp", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 317 | "dlext_test.cpp", |
| 318 | "libdl_test.cpp", |
| 319 | ], |
| 320 | static_libs: [ |
| 321 | "libpagemap", |
Andreas Gampe | b9797fe | 2017-07-05 22:36:20 -0700 | [diff] [blame] | 322 | "libziparchive", |
Dimitry Ivanov | ac4bd2f | 2016-11-21 12:50:38 -0800 | [diff] [blame] | 323 | "libLLVMObject", |
| 324 | "libLLVMBitReader", |
| 325 | "libLLVMMC", |
| 326 | "libLLVMMCParser", |
| 327 | "libLLVMCore", |
| 328 | "libLLVMSupport", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 329 | ], |
| 330 | } |
Jiyong Park | 02586a2 | 2017-05-20 01:01:24 +0900 | [diff] [blame] | 331 | }, |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 332 | } |
| 333 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 334 | // ----------------------------------------------------------------------------- |
| 335 | // Library of bionic customized gtest main function, with normal gtest output format, |
| 336 | // which is needed by bionic cts test. |
| 337 | // ----------------------------------------------------------------------------- |
| 338 | cc_test_library { |
| 339 | name: "libBionicCtsGtestMain", |
| 340 | defaults: ["bionic_tests_defaults"], |
Dimitry Ivanov | 927877c | 2016-09-21 11:17:13 -0700 | [diff] [blame] | 341 | srcs: [ |
| 342 | "gtest_main.cpp", |
| 343 | "gtest_globals_cts.cpp", |
| 344 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 345 | cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 346 | shared: { |
| 347 | enabled: false, |
| 348 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 349 | } |
| 350 | |
| 351 | // ----------------------------------------------------------------------------- |
| 352 | // Tests for the device using bionic's .so. Run with: |
| 353 | // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32 |
| 354 | // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64 |
| 355 | // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32 |
| 356 | // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64 |
| 357 | // ----------------------------------------------------------------------------- |
| 358 | cc_defaults { |
| 359 | name: "bionic_unit_tests_defaults", |
| 360 | host_supported: false, |
| 361 | |
| 362 | whole_static_libs: [ |
| 363 | "libBionicTests", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 364 | "libBionicLoaderTests", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 365 | "libBionicGtestMain", |
| 366 | ], |
| 367 | |
| 368 | static_libs: [ |
| 369 | "libtinyxml2", |
| 370 | "liblog", |
| 371 | "libbase", |
| 372 | ], |
| 373 | |
| 374 | srcs: [ |
| 375 | // 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] | 376 | "__cxa_thread_atexit_test.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 377 | "thread_local_test.cpp", |
| 378 | ], |
| 379 | |
| 380 | conlyflags: [ |
| 381 | "-fexceptions", |
| 382 | "-fnon-call-exceptions", |
| 383 | ], |
| 384 | |
| 385 | ldflags: ["-Wl,--export-dynamic"], |
| 386 | |
| 387 | include_dirs: ["bionic/libc"], |
| 388 | |
Yabin Cui | 1f553ea | 2017-01-13 12:31:59 -0800 | [diff] [blame] | 389 | stl: "libc++_static", |
| 390 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 391 | target: { |
| 392 | android: { |
| 393 | shared_libs: [ |
| 394 | "libdl", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 395 | "libdl_preempt_test_1", |
| 396 | "libdl_preempt_test_2", |
| 397 | "libdl_test_df_1_global", |
| 398 | ], |
| 399 | static_libs: [ |
| 400 | // The order of these libraries matters, do not shuffle them. |
| 401 | "libbase", |
Dimitry Ivanov | c462c28 | 2016-09-15 16:25:31 -0700 | [diff] [blame] | 402 | "libpagemap", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 403 | "libziparchive", |
| 404 | "libz", |
| 405 | "libutils", |
Dimitry Ivanov | ac4bd2f | 2016-11-21 12:50:38 -0800 | [diff] [blame] | 406 | "libLLVMObject", |
| 407 | "libLLVMBitReader", |
| 408 | "libLLVMMC", |
| 409 | "libLLVMMCParser", |
| 410 | "libLLVMCore", |
| 411 | "libLLVMSupport", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 412 | ], |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 413 | ldflags: [ |
Colin Cross | 7b29495 | 2016-09-29 14:08:13 -0700 | [diff] [blame] | 414 | "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs", |
Dimitry Ivanov | a36e59b | 2016-09-01 11:37:39 -0700 | [diff] [blame] | 415 | "-Wl,--enable-new-dtags", |
| 416 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 417 | }, |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | cc_test { |
| 422 | name: "bionic-unit-tests", |
| 423 | defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"], |
Elliott Hughes | a57ca0d | 2016-11-17 18:18:08 -0800 | [diff] [blame] | 424 | |
| 425 | target: { |
| 426 | android: { |
| 427 | shared_libs: ["libicuuc"], |
| 428 | }, |
| 429 | }, |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 430 | |
| 431 | required: [ |
| 432 | "cfi_test_helper", |
| 433 | "cfi_test_helper2", |
| 434 | "libtest_dt_runpath_a", |
| 435 | "libtest_dt_runpath_b", |
| 436 | "libtest_dt_runpath_c", |
| 437 | "libtest_dt_runpath_x", |
| 438 | "libatest_simple_zip", |
| 439 | "libcfi-test", |
| 440 | "libcfi-test-bad", |
| 441 | "libdlext_test_different_soname", |
| 442 | "libdlext_test_fd", |
| 443 | "libdlext_test_norelro", |
| 444 | "libdlext_test_runpath_zip_zipaligned", |
| 445 | "libdlext_test", |
| 446 | "libdlext_test_zip", |
| 447 | "libdlext_test_zip_zipaligned", |
| 448 | "libdl_preempt_test_1", |
| 449 | "libdl_preempt_test_2", |
| 450 | "libdl_test_df_1_global", |
Dimitry Ivanov | f1db837 | 2017-04-19 11:58:52 -0700 | [diff] [blame] | 451 | "libgnu-hash-table-library", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 452 | "libsysv-hash-table-library", |
| 453 | "libtest_atexit", |
| 454 | "libtest_check_order_dlsym_1_left", |
| 455 | "libtest_check_order_dlsym_2_right", |
| 456 | "libtest_check_order_dlsym_3_c", |
| 457 | "libtest_check_order_dlsym_a", |
| 458 | "libtest_check_order_dlsym_b", |
| 459 | "libtest_check_order_dlsym_d", |
| 460 | "libtest_check_order_dlsym", |
| 461 | "libtest_check_order_reloc_root_1", |
| 462 | "libtest_check_order_reloc_root_2", |
| 463 | "libtest_check_order_reloc_root", |
| 464 | "libtest_check_order_reloc_siblings_1", |
| 465 | "libtest_check_order_reloc_siblings_2", |
| 466 | "libtest_check_order_reloc_siblings_3", |
| 467 | "libtest_check_order_reloc_siblings_a", |
| 468 | "libtest_check_order_reloc_siblings_b", |
| 469 | "libtest_check_order_reloc_siblings_c_1", |
| 470 | "libtest_check_order_reloc_siblings_c_2", |
| 471 | "libtest_check_order_reloc_siblings_c", |
| 472 | "libtest_check_order_reloc_siblings_d", |
| 473 | "libtest_check_order_reloc_siblings_e", |
| 474 | "libtest_check_order_reloc_siblings_f", |
| 475 | "libtest_check_order_reloc_siblings", |
| 476 | "libtest_check_rtld_next_from_library", |
| 477 | "libtest_dlopen_from_ctor_main", |
| 478 | "libtest_dlopen_from_ctor", |
| 479 | "libtest_dlopen_weak_undefined_func", |
| 480 | "libtest_dlsym_df_1_global", |
| 481 | "libtest_dlsym_from_this_child", |
| 482 | "libtest_dlsym_from_this_grandchild", |
| 483 | "libtest_dlsym_from_this", |
| 484 | "libtest_dlsym_weak_func", |
| 485 | "libtest_dt_runpath_d", |
| 486 | "libtest_empty", |
Dimitry Ivanov | f1db837 | 2017-04-19 11:58:52 -0700 | [diff] [blame] | 487 | "libtest_ifunc", |
Dimitry Ivanov | 4bd3542 | 2017-04-10 16:52:25 -0700 | [diff] [blame] | 488 | "libtest_init_fini_order_child", |
| 489 | "libtest_init_fini_order_grand_child", |
| 490 | "libtest_init_fini_order_root2", |
| 491 | "libtest_init_fini_order_root", |
| 492 | "libtest_nodelete_1", |
| 493 | "libtest_nodelete_2", |
| 494 | "libtest_nodelete_dt_flags_1", |
| 495 | "libtest_pthread_atfork", |
| 496 | "libtest_relo_check_dt_needed_order_1", |
| 497 | "libtest_relo_check_dt_needed_order_2", |
| 498 | "libtest_relo_check_dt_needed_order", |
| 499 | "libtest_simple", |
| 500 | "libtest_two_parents_child", |
| 501 | "libtest_two_parents_parent1", |
| 502 | "libtest_two_parents_parent2", |
| 503 | "libtest_versioned_lib", |
| 504 | "libtest_versioned_libv1", |
| 505 | "libtest_versioned_libv2", |
| 506 | "libtest_versioned_otherlib_empty", |
| 507 | "libtest_versioned_otherlib", |
| 508 | "libtest_versioned_uselibv1", |
| 509 | "libtest_versioned_uselibv2_other", |
| 510 | "libtest_versioned_uselibv2", |
| 511 | "libtest_versioned_uselibv3_other", |
| 512 | "libtest_with_dependency_loop_a", |
| 513 | "libtest_with_dependency_loop_b", |
| 514 | "libtest_with_dependency_loop_c", |
| 515 | "libtest_with_dependency_loop", |
| 516 | "libtest_with_dependency", |
| 517 | "libtest_invalid-empty_shdr_table.so", |
| 518 | "libtest_invalid-rw_load_segment.so", |
| 519 | "libtest_invalid-unaligned_shdr_offset.so", |
| 520 | "libtest_invalid-zero_shdr_table_content.so", |
| 521 | "libtest_invalid-zero_shdr_table_offset.so", |
| 522 | "libtest_invalid-zero_shentsize.so", |
| 523 | "libtest_invalid-zero_shstrndx.so", |
| 524 | "libtest_invalid-textrels.so", |
| 525 | "libtest_invalid-textrels2.so", |
| 526 | "preinit_getauxval_test_helper", |
| 527 | "preinit_syscall_test_helper", |
| 528 | "libnstest_private_external", |
| 529 | "libnstest_dlopened", |
| 530 | "libnstest_private", |
| 531 | "libnstest_root_not_isolated", |
| 532 | "libnstest_root", |
| 533 | "libnstest_public", |
| 534 | "libnstest_public_internal", |
| 535 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 536 | } |
| 537 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 538 | // ----------------------------------------------------------------------------- |
| 539 | // Tests for the device linked against bionic's static library. Run with: |
| 540 | // adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32 |
| 541 | // adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64 |
| 542 | // ----------------------------------------------------------------------------- |
| 543 | cc_test { |
| 544 | name: "bionic-unit-tests-static", |
| 545 | defaults: ["bionic_tests_defaults"], |
| 546 | host_supported: false, |
| 547 | |
Dimitry Ivanov | 462ea66 | 2017-01-06 14:49:57 -0800 | [diff] [blame] | 548 | srcs: [ |
| 549 | "gtest_preinit_debuggerd.cpp", |
| 550 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 551 | whole_static_libs: [ |
| 552 | "libBionicTests", |
| 553 | "libBionicGtestMain", |
| 554 | ], |
| 555 | |
| 556 | static_libs: [ |
| 557 | "libm", |
| 558 | "libc", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 559 | "libdl", |
| 560 | "libtinyxml2", |
| 561 | "liblog", |
| 562 | "libbase", |
Josh Gao | 2a3b4fa | 2016-10-26 17:55:49 -0700 | [diff] [blame] | 563 | "libdebuggerd_handler", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 564 | ], |
| 565 | |
| 566 | static_executable: true, |
| 567 | stl: "libc++_static", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 568 | } |
| 569 | |
| 570 | // ----------------------------------------------------------------------------- |
| 571 | // Tests to run on the host and linked against glibc. Run with: |
| 572 | // cd bionic/tests; mm bionic-unit-tests-glibc-run |
| 573 | // ----------------------------------------------------------------------------- |
| 574 | |
| 575 | cc_test_host { |
| 576 | name: "bionic-unit-tests-glibc", |
| 577 | defaults: ["bionic_tests_defaults"], |
| 578 | |
| 579 | srcs: [ |
| 580 | "atexit_test.cpp", |
Dimitry Ivanov | 708589f | 2016-09-19 10:50:28 -0700 | [diff] [blame] | 581 | "dlfcn_symlink_support.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 582 | "dlfcn_test.cpp", |
| 583 | "dl_test.cpp", |
| 584 | "pthread_dlfcn_test.cpp", |
| 585 | ], |
| 586 | |
| 587 | shared_libs: [ |
| 588 | "libdl_preempt_test_1", |
| 589 | "libdl_preempt_test_2", |
| 590 | |
| 591 | "libdl_test_df_1_global", |
| 592 | ], |
| 593 | |
| 594 | whole_static_libs: [ |
| 595 | "libBionicStandardTests", |
| 596 | "libBionicGtestMain", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 597 | "libfortify1-tests-clang", |
| 598 | "libfortify2-tests-clang", |
| 599 | ], |
| 600 | |
| 601 | static_libs: [ |
| 602 | "libbase", |
| 603 | "liblog", |
| 604 | "libcutils", |
| 605 | ], |
| 606 | |
| 607 | host_ldlibs: [ |
| 608 | "-lresolv", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 609 | "-lutil", |
| 610 | ], |
| 611 | |
| 612 | include_dirs: ["bionic/libc"], |
| 613 | |
Dimitry Ivanov | d0b5c3a | 2016-11-25 12:23:11 -0800 | [diff] [blame] | 614 | ldflags: [ |
| 615 | "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs", |
| 616 | "-Wl,--export-dynamic", |
| 617 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 618 | |
| 619 | sanitize: { |
| 620 | never: false, |
| 621 | }, |
Dan Willemsen | 268ae36 | 2017-09-21 16:56:06 -0700 | [diff] [blame] | 622 | |
| 623 | target: { |
| 624 | linux_bionic: { |
| 625 | enabled: false, |
| 626 | }, |
| 627 | }, |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 628 | } |
| 629 | |
| 630 | subdirs = ["libs"] |