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