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