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