blob: 00f285657fd24c45a9501f8cf4a640893e247bd3 [file] [log] [blame]
Colin Cross2722ebb2016-07-11 16:20:06 -07001//
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
17cc_defaults {
18 name: "bionic_tests_defaults",
19 host_supported: true,
Tom Cherry60ddedf2018-02-20 15:40:02 -080020 cpp_std: "experimental",
Colin Cross2722ebb2016-07-11 16:20:06 -070021 target: {
22 darwin: {
23 enabled: false,
24 },
25 },
26 cflags: [
27 "-fstack-protector-all",
28 "-g",
29 "-Wall",
30 "-Wextra",
31 "-Wunused",
32 "-Werror",
33 "-fno-builtin",
34
35 // We want to test deprecated API too.
36 "-Wno-deprecated-declarations",
37
38 // For glibc.
39 "-D__STDC_LIMIT_MACROS",
40 ],
41 stl: "libc++",
42 sanitize: {
43 never: true,
44 },
45}
46
47// -----------------------------------------------------------------------------
48// All standard tests.
49// -----------------------------------------------------------------------------
50
George Burgess IVde45dcb2018-03-16 14:15:01 -070051// Test diagnostics emitted by clang. The library that results is useless; we
52// just want to run '-Xclang -verify', which will fail if the diagnostics don't
53// match up with what the source file says they should be.
54cc_test_library {
55 name: "clang_diagnostic_tests",
56 cflags: [
57 "-Xclang",
58 "-verify",
59 ],
60 srcs: ["sys_ioctl_diag_test.cpp"],
61}
62
Colin Cross2722ebb2016-07-11 16:20:06 -070063cc_test_library {
64 name: "libBionicStandardTests",
65 defaults: ["bionic_tests_defaults"],
66 srcs: [
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030067 "alloca_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070068 "arpa_inet_test.cpp",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070069 "async_safe_test.cpp",
Elliott Hughesf6495c72016-07-25 09:20:57 -070070 "assert_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070071 "buffer_tests.cpp",
72 "bug_26110743_test.cpp",
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030073 "byteswap_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070074 "complex_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070075 "complex_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070076 "ctype_test.cpp",
77 "dirent_test.cpp",
Elliott Hughesd390df12017-04-30 22:56:10 -070078 "elf_test.cpp",
Elliott Hughesba267f42017-02-24 16:19:53 -080079 "endian_test.cpp",
Elliott Hughese452cb12017-06-13 14:43:53 -070080 "errno_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070081 "error_test.cpp",
82 "eventfd_test.cpp",
83 "fcntl_test.cpp",
84 "fenv_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070085 "float_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070086 "ftw_test.cpp",
87 "getauxval_test.cpp",
88 "getcwd_test.cpp",
Elliott Hughesf1c568d2017-09-26 17:09:07 -070089 "glob_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070090 "grp_pwd_test.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -080091 "grp_pwd_file_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -070092 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070093 "ifaddrs_test.cpp",
94 "inttypes_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070095 "iso646_test.c",
Elliott Hughesfc8e6882016-11-18 16:27:29 -080096 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -070097 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070098 "libgen_basename_test.cpp",
99 "libgen_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700100 "limits_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -0700101 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700102 "locale_test.cpp",
103 "malloc_test.cpp",
104 "math_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -0700105 "math_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700106 "mntent_test.cpp",
107 "netdb_test.cpp",
108 "net_if_test.cpp",
109 "netinet_ether_test.cpp",
110 "netinet_in_test.cpp",
Elliott Hughese5a5eec2018-06-27 12:29:06 -0700111 "netinet_ip_icmp_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700112 "netinet_udp_test.cpp",
113 "nl_types_test.cpp",
114 "pthread_test.cpp",
115 "pty_test.cpp",
116 "regex_test.cpp",
117 "resolv_test.cpp",
118 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700119 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700120 "search_test.cpp",
121 "semaphore_test.cpp",
122 "setjmp_test.cpp",
123 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700124 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700125 "stack_protector_test.cpp",
126 "stack_protector_test_helper.cpp",
127 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700128 "stdalign_test.cpp",
129 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700130 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700131 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700132 "stdint_test.cpp",
133 "stdio_nofortify_test.cpp",
134 "stdio_test.cpp",
135 "stdio_ext_test.cpp",
136 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700137 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700138 "string_nofortify_test.cpp",
139 "string_test.cpp",
140 "string_posix_strerror_r_test.cpp",
141 "strings_nofortify_test.cpp",
142 "strings_test.cpp",
143 "sstream_test.cpp",
144 "sys_epoll_test.cpp",
145 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700146 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700147 "sys_personality_test.cpp",
148 "sys_prctl_test.cpp",
149 "sys_procfs_test.cpp",
150 "sys_ptrace_test.cpp",
151 "sys_quota_test.cpp",
Elliott Hughes8465e962017-09-27 16:33:35 -0700152 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700153 "sys_resource_test.cpp",
154 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700155 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700156 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700157 "sys_shm_test.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -0800158 "sys_signalfd_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700159 "sys_socket_test.cpp",
160 "sys_stat_test.cpp",
161 "sys_statvfs_test.cpp",
162 "sys_syscall_test.cpp",
163 "sys_sysinfo_test.cpp",
164 "sys_sysmacros_test.cpp",
165 "sys_time_test.cpp",
166 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700167 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700168 "sys_types_test.cpp",
169 "sys_uio_test.cpp",
170 "sys_vfs_test.cpp",
171 "sys_xattr_test.cpp",
172 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000173 "system_properties_test2.cpp",
Elliott Hughes5da96462017-12-14 09:43:59 -0800174 "termios_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700175 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700176 "time_test.cpp",
177 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700178 "unistd_nofortify_test.cpp",
179 "unistd_test.cpp",
180 "utmp_test.cpp",
181 "wchar_test.cpp",
182 "wctype_test.cpp",
183 ],
184
185 include_dirs: [
186 "bionic/libc",
187 "external/tinyxml2",
188 ],
189
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700190 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700191 bionic: {
Tom Cherrye275d6d2017-12-11 23:31:33 -0800192 whole_static_libs: [
193 "libasync_safe",
194 "libsystemproperties",
195 ],
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700196 },
197 },
198
Dan Willemsen41567702016-08-31 16:35:01 -0700199 static_libs: [
200 "libtinyxml2",
201 "liblog",
202 "libbase",
203 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700204 shared: {
205 enabled: false,
206 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000207
208 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700209}
210
211// -----------------------------------------------------------------------------
212// Fortify tests.
213// -----------------------------------------------------------------------------
214
215cc_defaults {
216 name: "bionic_fortify_tests_defaults",
217 cflags: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700218 "-U_FORTIFY_SOURCE",
219 ],
220 srcs: ["fortify_test_main.cpp"],
221 target: {
222 host: {
223 clang_cflags: ["-D__clang__"],
224 },
225 },
226}
227
George Burgess IVd9551db2017-08-17 18:51:02 -0700228// If building this fails, then we have both FORTIFY and ASAN enabled, which
229// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
230// enabled, but that's not a reality today.) This is meant to be otherwise
231// unused.
232cc_test_library {
233 name: "fortify_disabled_for_asan",
234 cflags: [
235 "-Werror",
236 "-D_FORTIFY_SOURCE=2",
237 // "sanitize: address" doesn't work on platforms where libasan isn't
238 // enabled. Since the intent is just to build this, we can get away with
239 // passing this flag on its own.
240 "-fsanitize=address",
241 ],
242 // Ignore that we don't have ASAN symbols linked in.
243 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700244 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700245}
246
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700247// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
248// it can confuse these tools pretty easily. If this builds successfully, then
249// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
250// enabled. The library that results from building this is meant to be unused.
251cc_test_library {
252 name: "fortify_disabled_for_tidy",
253 cflags: [
254 "-Werror",
255 "-D_FORTIFY_SOURCE=2",
256 "-D__clang_analyzer__",
257 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700258 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700259}
260
Colin Cross2722ebb2016-07-11 16:20:06 -0700261cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700262 name: "libfortify1-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800263 defaults: [
264 "bionic_fortify_tests_defaults",
265 "bionic_tests_defaults",
266 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700267 cflags: [
268 "-D_FORTIFY_SOURCE=1",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800269 "-DTEST_NAME=Fortify1_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700270 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700271 shared: {
272 enabled: false,
273 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700274}
275
276cc_test_library {
277 name: "libfortify2-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800278 defaults: [
279 "bionic_fortify_tests_defaults",
280 "bionic_tests_defaults",
281 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700282 cflags: [
283 "-D_FORTIFY_SOURCE=2",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800284 "-DTEST_NAME=Fortify2_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700285 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700286 shared: {
287 enabled: false,
288 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700289}
290
291// -----------------------------------------------------------------------------
292// Library of all tests (excluding the dynamic linker tests).
293// -----------------------------------------------------------------------------
294cc_test_library {
295 name: "libBionicTests",
296 defaults: ["bionic_tests_defaults"],
297 whole_static_libs: [
298 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700299 "libfortify1-tests-clang",
300 "libfortify2-tests-clang",
301 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700302 shared: {
303 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700304 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700305}
306
307// -----------------------------------------------------------------------------
308// Library of bionic customized gtest main function, with simplified output format.
309// -----------------------------------------------------------------------------
310cc_test_library {
311 name: "libBionicGtestMain",
312 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700313 srcs: [
314 "gtest_main.cpp",
315 "gtest_globals.cpp",
316 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800317 whole_static_libs: [
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700318 "libbase",
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800319 "liblog",
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700320 ],
321 include_dirs: [
322 "bionic/libc",
323 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700324 target: {
325 darwin: {
326 enabled: true,
327 },
328 },
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700329 shared: {
330 enabled: false,
331 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700332}
333
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700334cc_test_library {
335 name: "libBionicLoaderTests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800336 defaults: [
337 "bionic_tests_defaults",
338 "llvm-defaults",
339 ],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700340 srcs: [
341 "atexit_test.cpp",
342 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700343 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700344 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700345 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700346 "pthread_dlfcn_test.cpp",
347 ],
348 static_libs: [
349 "libbase",
350 ],
351 include_dirs: [
352 "bionic/libc",
353 ],
354 shared: {
355 enabled: false,
356 },
357 target: {
358 android: {
359 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700360 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700361 "dlext_test.cpp",
362 "libdl_test.cpp",
363 ],
364 static_libs: [
365 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700366 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800367 "libLLVMObject",
368 "libLLVMBitReader",
369 "libLLVMMC",
370 "libLLVMMCParser",
371 "libLLVMCore",
372 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700373 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800374 },
Jiyong Park02586a22017-05-20 01:01:24 +0900375 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700376}
377
Colin Cross2722ebb2016-07-11 16:20:06 -0700378// -----------------------------------------------------------------------------
379// Library of bionic customized gtest main function, with normal gtest output format,
380// which is needed by bionic cts test.
381// -----------------------------------------------------------------------------
382cc_test_library {
383 name: "libBionicCtsGtestMain",
384 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700385 srcs: [
386 "gtest_main.cpp",
387 "gtest_globals_cts.cpp",
388 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800389 static_libs: [
390 "libbase",
391 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700392 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700393 shared: {
394 enabled: false,
395 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700396}
397
398// -----------------------------------------------------------------------------
399// Tests for the device using bionic's .so. Run with:
400// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
401// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
402// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
403// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
404// -----------------------------------------------------------------------------
405cc_defaults {
406 name: "bionic_unit_tests_defaults",
407 host_supported: false,
408
409 whole_static_libs: [
410 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700411 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700412 "libBionicGtestMain",
413 ],
414
415 static_libs: [
416 "libtinyxml2",
417 "liblog",
418 "libbase",
419 ],
420
421 srcs: [
422 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700423 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700424 "thread_local_test.cpp",
425 ],
426
427 conlyflags: [
428 "-fexceptions",
429 "-fnon-call-exceptions",
430 ],
431
432 ldflags: ["-Wl,--export-dynamic"],
433
434 include_dirs: ["bionic/libc"],
435
Yabin Cui1f553ea2017-01-13 12:31:59 -0800436 stl: "libc++_static",
437
Colin Cross2722ebb2016-07-11 16:20:06 -0700438 target: {
439 android: {
440 shared_libs: [
dimitry321476a2018-01-29 15:32:37 +0100441 "ld-android",
Colin Cross2722ebb2016-07-11 16:20:06 -0700442 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700443 "libdl_preempt_test_1",
444 "libdl_preempt_test_2",
445 "libdl_test_df_1_global",
446 ],
447 static_libs: [
448 // The order of these libraries matters, do not shuffle them.
449 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700450 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700451 "libziparchive",
452 "libz",
453 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800454 "libLLVMObject",
455 "libLLVMBitReader",
456 "libLLVMMC",
457 "libLLVMMCParser",
458 "libLLVMCore",
459 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700460 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700461 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700462 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700463 "-Wl,--enable-new-dtags",
464 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700465 },
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800466 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700467}
468
469cc_test {
470 name: "bionic-unit-tests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800471 defaults: [
472 "bionic_unit_tests_defaults",
473 "bionic_tests_defaults",
474 ],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800475
476 target: {
477 android: {
478 shared_libs: ["libicuuc"],
479 },
480 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700481
482 required: [
483 "cfi_test_helper",
484 "cfi_test_helper2",
485 "libtest_dt_runpath_a",
486 "libtest_dt_runpath_b",
487 "libtest_dt_runpath_c",
488 "libtest_dt_runpath_x",
489 "libatest_simple_zip",
490 "libcfi-test",
491 "libcfi-test-bad",
492 "libdlext_test_different_soname",
493 "libdlext_test_fd",
494 "libdlext_test_norelro",
495 "libdlext_test_runpath_zip_zipaligned",
496 "libdlext_test",
497 "libdlext_test_zip",
498 "libdlext_test_zip_zipaligned",
499 "libdl_preempt_test_1",
500 "libdl_preempt_test_2",
501 "libdl_test_df_1_global",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700502 "libelf-tls-library",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700503 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700504 "libsysv-hash-table-library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700505 "libtestshared",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700506 "libtest_atexit",
507 "libtest_check_order_dlsym_1_left",
508 "libtest_check_order_dlsym_2_right",
509 "libtest_check_order_dlsym_3_c",
510 "libtest_check_order_dlsym_a",
511 "libtest_check_order_dlsym_b",
512 "libtest_check_order_dlsym_d",
513 "libtest_check_order_dlsym",
514 "libtest_check_order_reloc_root_1",
515 "libtest_check_order_reloc_root_2",
516 "libtest_check_order_reloc_root",
517 "libtest_check_order_reloc_siblings_1",
518 "libtest_check_order_reloc_siblings_2",
519 "libtest_check_order_reloc_siblings_3",
520 "libtest_check_order_reloc_siblings_a",
521 "libtest_check_order_reloc_siblings_b",
522 "libtest_check_order_reloc_siblings_c_1",
523 "libtest_check_order_reloc_siblings_c_2",
524 "libtest_check_order_reloc_siblings_c",
525 "libtest_check_order_reloc_siblings_d",
526 "libtest_check_order_reloc_siblings_e",
527 "libtest_check_order_reloc_siblings_f",
528 "libtest_check_order_reloc_siblings",
529 "libtest_check_rtld_next_from_library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700530 "libtest_dlopen_df_1_global",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700531 "libtest_dlopen_from_ctor_main",
532 "libtest_dlopen_from_ctor",
533 "libtest_dlopen_weak_undefined_func",
534 "libtest_dlsym_df_1_global",
535 "libtest_dlsym_from_this_child",
536 "libtest_dlsym_from_this_grandchild",
537 "libtest_dlsym_from_this",
538 "libtest_dlsym_weak_func",
539 "libtest_dt_runpath_d",
540 "libtest_empty",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700541 "libtest_ifunc_variable_impl",
542 "libtest_ifunc_variable",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700543 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700544 "libtest_init_fini_order_child",
545 "libtest_init_fini_order_grand_child",
546 "libtest_init_fini_order_root2",
547 "libtest_init_fini_order_root",
Pirama Arumuga Nainar1395f702018-03-28 15:27:12 -0700548 "libtest_missing_symbol_child_public",
Elliott Hughes06d31c92018-03-29 11:28:53 -0700549 "libtest_missing_symbol_child_private",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700550 "libtest_missing_symbol_root",
551 "libtest_missing_symbol",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700552 "libtest_nodelete_1",
553 "libtest_nodelete_2",
554 "libtest_nodelete_dt_flags_1",
555 "libtest_pthread_atfork",
556 "libtest_relo_check_dt_needed_order_1",
557 "libtest_relo_check_dt_needed_order_2",
558 "libtest_relo_check_dt_needed_order",
559 "libtest_simple",
560 "libtest_two_parents_child",
561 "libtest_two_parents_parent1",
562 "libtest_two_parents_parent2",
563 "libtest_versioned_lib",
564 "libtest_versioned_libv1",
565 "libtest_versioned_libv2",
566 "libtest_versioned_otherlib_empty",
567 "libtest_versioned_otherlib",
568 "libtest_versioned_uselibv1",
569 "libtest_versioned_uselibv2_other",
570 "libtest_versioned_uselibv2",
571 "libtest_versioned_uselibv3_other",
572 "libtest_with_dependency_loop_a",
573 "libtest_with_dependency_loop_b",
574 "libtest_with_dependency_loop_c",
575 "libtest_with_dependency_loop",
576 "libtest_with_dependency",
dimitry55547db2018-05-25 14:17:37 +0200577 "libtest_indirect_thread_local_dtor",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700578 "libtest_invalid-empty_shdr_table.so",
579 "libtest_invalid-rw_load_segment.so",
580 "libtest_invalid-unaligned_shdr_offset.so",
581 "libtest_invalid-zero_shdr_table_content.so",
582 "libtest_invalid-zero_shdr_table_offset.so",
583 "libtest_invalid-zero_shentsize.so",
584 "libtest_invalid-zero_shstrndx.so",
585 "libtest_invalid-textrels.so",
586 "libtest_invalid-textrels2.so",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700587 "libtest_thread_local_dtor",
dimitry55547db2018-05-25 14:17:37 +0200588 "libtest_thread_local_dtor2",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700589 "preinit_getauxval_test_helper",
590 "preinit_syscall_test_helper",
591 "libnstest_private_external",
592 "libnstest_dlopened",
593 "libnstest_private",
594 "libnstest_root_not_isolated",
595 "libnstest_root",
596 "libnstest_public",
597 "libnstest_public_internal",
Logan Chien9ee45912018-01-18 12:05:09 +0800598 "libnstest_ns_a_public1",
599 "libnstest_ns_a_public1_internal",
600 "libnstest_ns_b_public2",
601 "libnstest_ns_b_public3",
Jiyong Parkce10b162018-03-29 10:34:41 +0900602 "ld_preload_test_helper",
603 "ld_preload_test_helper_lib1",
Elliott Hughes51466522018-03-29 11:17:37 -0700604 "ld_preload_test_helper_lib2",
Jiyong Parkce10b162018-03-29 10:34:41 +0900605 "ld_config_test_helper",
606 "ld_config_test_helper_lib1",
607 "ld_config_test_helper_lib2",
608 "ld_config_test_helper_lib3",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700609 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700610}
611
Colin Cross2722ebb2016-07-11 16:20:06 -0700612// -----------------------------------------------------------------------------
613// Tests for the device linked against bionic's static library. Run with:
614// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
615// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
616// -----------------------------------------------------------------------------
617cc_test {
618 name: "bionic-unit-tests-static",
619 defaults: ["bionic_tests_defaults"],
620 host_supported: false,
621
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800622 srcs: [
623 "gtest_preinit_debuggerd.cpp",
624 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700625 whole_static_libs: [
626 "libBionicTests",
627 "libBionicGtestMain",
628 ],
629
630 static_libs: [
631 "libm",
632 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700633 "libdl",
634 "libtinyxml2",
635 "liblog",
636 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700637 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700638 ],
639
640 static_executable: true,
641 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700642}
643
644// -----------------------------------------------------------------------------
645// Tests to run on the host and linked against glibc. Run with:
646// cd bionic/tests; mm bionic-unit-tests-glibc-run
647// -----------------------------------------------------------------------------
648
649cc_test_host {
650 name: "bionic-unit-tests-glibc",
651 defaults: ["bionic_tests_defaults"],
652
653 srcs: [
654 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700655 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700656 "dlfcn_test.cpp",
657 "dl_test.cpp",
658 "pthread_dlfcn_test.cpp",
659 ],
660
661 shared_libs: [
662 "libdl_preempt_test_1",
663 "libdl_preempt_test_2",
664
665 "libdl_test_df_1_global",
666 ],
667
668 whole_static_libs: [
669 "libBionicStandardTests",
670 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700671 "libfortify1-tests-clang",
672 "libfortify2-tests-clang",
673 ],
674
675 static_libs: [
676 "libbase",
677 "liblog",
678 "libcutils",
679 ],
680
681 host_ldlibs: [
682 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700683 "-lutil",
684 ],
685
686 include_dirs: ["bionic/libc"],
687
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800688 ldflags: [
689 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
690 "-Wl,--export-dynamic",
691 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700692
693 sanitize: {
694 never: false,
695 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700696
697 target: {
698 linux_bionic: {
699 enabled: false,
700 },
701 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700702}
703
Elliott Hughes21b56eb2017-10-20 17:57:17 -0700704subdirs = ["*"]