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