blob: 66d9aec309acced166c161d767bf21f2dc7a6bb7 [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,
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
50cc_test_library {
51 name: "libBionicStandardTests",
52 defaults: ["bionic_tests_defaults"],
53 srcs: [
54 "arpa_inet_test.cpp",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070055 "async_safe_test.cpp",
Elliott Hughesf6495c72016-07-25 09:20:57 -070056 "assert_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070057 "buffer_tests.cpp",
58 "bug_26110743_test.cpp",
59 "complex_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070060 "complex_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070061 "ctype_test.cpp",
62 "dirent_test.cpp",
Elliott Hughesd390df12017-04-30 22:56:10 -070063 "elf_test.cpp",
Elliott Hughesba267f42017-02-24 16:19:53 -080064 "endian_test.cpp",
Elliott Hughese452cb12017-06-13 14:43:53 -070065 "errno_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070066 "error_test.cpp",
67 "eventfd_test.cpp",
68 "fcntl_test.cpp",
69 "fenv_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070070 "float_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070071 "ftw_test.cpp",
72 "getauxval_test.cpp",
73 "getcwd_test.cpp",
Elliott Hughesf1c568d2017-09-26 17:09:07 -070074 "glob_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070075 "grp_pwd_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -070076 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070077 "ifaddrs_test.cpp",
78 "inttypes_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070079 "iso646_test.c",
Elliott Hughesfc8e6882016-11-18 16:27:29 -080080 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -070081 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070082 "libgen_basename_test.cpp",
83 "libgen_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070084 "limits_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -070085 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070086 "locale_test.cpp",
87 "malloc_test.cpp",
88 "math_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070089 "math_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070090 "mntent_test.cpp",
91 "netdb_test.cpp",
92 "net_if_test.cpp",
93 "netinet_ether_test.cpp",
94 "netinet_in_test.cpp",
95 "netinet_udp_test.cpp",
96 "nl_types_test.cpp",
97 "pthread_test.cpp",
98 "pty_test.cpp",
Xin Li4b1a3992017-05-19 10:13:08 -070099 "qsort_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700100 "regex_test.cpp",
101 "resolv_test.cpp",
102 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700103 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700104 "search_test.cpp",
105 "semaphore_test.cpp",
106 "setjmp_test.cpp",
107 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700108 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700109 "stack_protector_test.cpp",
110 "stack_protector_test_helper.cpp",
111 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700112 "stdalign_test.cpp",
113 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700114 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700115 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700116 "stdint_test.cpp",
117 "stdio_nofortify_test.cpp",
118 "stdio_test.cpp",
119 "stdio_ext_test.cpp",
120 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700121 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700122 "string_nofortify_test.cpp",
123 "string_test.cpp",
124 "string_posix_strerror_r_test.cpp",
125 "strings_nofortify_test.cpp",
126 "strings_test.cpp",
127 "sstream_test.cpp",
128 "sys_epoll_test.cpp",
129 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700130 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700131 "sys_personality_test.cpp",
132 "sys_prctl_test.cpp",
133 "sys_procfs_test.cpp",
134 "sys_ptrace_test.cpp",
135 "sys_quota_test.cpp",
Elliott Hughes8465e962017-09-27 16:33:35 -0700136 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700137 "sys_resource_test.cpp",
138 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700139 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700140 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700141 "sys_shm_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700142 "sys_socket_test.cpp",
143 "sys_stat_test.cpp",
144 "sys_statvfs_test.cpp",
145 "sys_syscall_test.cpp",
146 "sys_sysinfo_test.cpp",
147 "sys_sysmacros_test.cpp",
148 "sys_time_test.cpp",
149 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700150 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700151 "sys_types_test.cpp",
152 "sys_uio_test.cpp",
153 "sys_vfs_test.cpp",
154 "sys_xattr_test.cpp",
155 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000156 "system_properties_test2.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700157 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700158 "time_test.cpp",
159 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700160 "unistd_nofortify_test.cpp",
161 "unistd_test.cpp",
162 "utmp_test.cpp",
163 "wchar_test.cpp",
164 "wctype_test.cpp",
165 ],
166
167 include_dirs: [
168 "bionic/libc",
169 "external/tinyxml2",
170 ],
171
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700172 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700173 bionic: {
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700174 whole_static_libs: ["libasync_safe"],
175 },
176 },
177
Dan Willemsen41567702016-08-31 16:35:01 -0700178 static_libs: [
179 "libtinyxml2",
180 "liblog",
181 "libbase",
182 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700183 shared: {
184 enabled: false,
185 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000186
187 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700188}
189
190// -----------------------------------------------------------------------------
191// Fortify tests.
192// -----------------------------------------------------------------------------
193
194cc_defaults {
195 name: "bionic_fortify_tests_defaults",
196 cflags: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700197 "-U_FORTIFY_SOURCE",
198 ],
199 srcs: ["fortify_test_main.cpp"],
200 target: {
201 host: {
202 clang_cflags: ["-D__clang__"],
203 },
204 },
205}
206
George Burgess IVd9551db2017-08-17 18:51:02 -0700207// If building this fails, then we have both FORTIFY and ASAN enabled, which
208// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
209// enabled, but that's not a reality today.) This is meant to be otherwise
210// unused.
211cc_test_library {
212 name: "fortify_disabled_for_asan",
213 cflags: [
214 "-Werror",
215 "-D_FORTIFY_SOURCE=2",
216 // "sanitize: address" doesn't work on platforms where libasan isn't
217 // enabled. Since the intent is just to build this, we can get away with
218 // passing this flag on its own.
219 "-fsanitize=address",
220 ],
221 // Ignore that we don't have ASAN symbols linked in.
222 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700223 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700224}
225
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700226// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
227// it can confuse these tools pretty easily. If this builds successfully, then
228// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
229// enabled. The library that results from building this is meant to be unused.
230cc_test_library {
231 name: "fortify_disabled_for_tidy",
232 cflags: [
233 "-Werror",
234 "-D_FORTIFY_SOURCE=2",
235 "-D__clang_analyzer__",
236 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700237 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700238}
239
Colin Cross2722ebb2016-07-11 16:20:06 -0700240cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700241 name: "libfortify1-tests-clang",
242 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700243 cflags: [
244 "-D_FORTIFY_SOURCE=1",
245 "-DTEST_NAME=Fortify1_clang"
246 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700247 shared: {
248 enabled: false,
249 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700250}
251
252cc_test_library {
253 name: "libfortify2-tests-clang",
254 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700255 cflags: [
256 "-D_FORTIFY_SOURCE=2",
257 "-DTEST_NAME=Fortify2_clang"
258 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700259 shared: {
260 enabled: false,
261 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700262}
263
264// -----------------------------------------------------------------------------
265// Library of all tests (excluding the dynamic linker tests).
266// -----------------------------------------------------------------------------
267cc_test_library {
268 name: "libBionicTests",
269 defaults: ["bionic_tests_defaults"],
270 whole_static_libs: [
271 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700272 "libfortify1-tests-clang",
273 "libfortify2-tests-clang",
274 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700275 shared: {
276 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700277 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700278}
279
280// -----------------------------------------------------------------------------
281// Library of bionic customized gtest main function, with simplified output format.
282// -----------------------------------------------------------------------------
283cc_test_library {
284 name: "libBionicGtestMain",
285 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700286 srcs: [
287 "gtest_main.cpp",
288 "gtest_globals.cpp",
289 ],
290 static_libs: [
291 "libbase",
292 ],
293 include_dirs: [
294 "bionic/libc",
295 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700296 target: {
297 darwin: {
298 enabled: true,
299 },
300 },
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700301 shared: {
302 enabled: false,
303 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700304}
305
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700306cc_test_library {
307 name: "libBionicLoaderTests",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800308 defaults: ["bionic_tests_defaults", "llvm-defaults"],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700309 srcs: [
310 "atexit_test.cpp",
311 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700312 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700313 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700314 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700315 "pthread_dlfcn_test.cpp",
316 ],
317 static_libs: [
318 "libbase",
319 ],
320 include_dirs: [
321 "bionic/libc",
322 ],
323 shared: {
324 enabled: false,
325 },
326 target: {
327 android: {
328 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700329 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700330 "dlext_test.cpp",
331 "libdl_test.cpp",
332 ],
333 static_libs: [
334 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700335 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800336 "libLLVMObject",
337 "libLLVMBitReader",
338 "libLLVMMC",
339 "libLLVMMCParser",
340 "libLLVMCore",
341 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700342 ],
343 }
Jiyong Park02586a22017-05-20 01:01:24 +0900344 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700345}
346
Colin Cross2722ebb2016-07-11 16:20:06 -0700347// -----------------------------------------------------------------------------
348// Library of bionic customized gtest main function, with normal gtest output format,
349// which is needed by bionic cts test.
350// -----------------------------------------------------------------------------
351cc_test_library {
352 name: "libBionicCtsGtestMain",
353 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700354 srcs: [
355 "gtest_main.cpp",
356 "gtest_globals_cts.cpp",
357 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700358 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700359 shared: {
360 enabled: false,
361 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700362}
363
364// -----------------------------------------------------------------------------
365// Tests for the device using bionic's .so. Run with:
366// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
367// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
368// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
369// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
370// -----------------------------------------------------------------------------
371cc_defaults {
372 name: "bionic_unit_tests_defaults",
373 host_supported: false,
374
375 whole_static_libs: [
376 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700377 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700378 "libBionicGtestMain",
379 ],
380
381 static_libs: [
382 "libtinyxml2",
383 "liblog",
384 "libbase",
385 ],
386
387 srcs: [
388 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700389 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700390 "thread_local_test.cpp",
391 ],
392
393 conlyflags: [
394 "-fexceptions",
395 "-fnon-call-exceptions",
396 ],
397
398 ldflags: ["-Wl,--export-dynamic"],
399
400 include_dirs: ["bionic/libc"],
401
Yabin Cui1f553ea2017-01-13 12:31:59 -0800402 stl: "libc++_static",
403
Colin Cross2722ebb2016-07-11 16:20:06 -0700404 target: {
405 android: {
406 shared_libs: [
407 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700408 "libdl_preempt_test_1",
409 "libdl_preempt_test_2",
410 "libdl_test_df_1_global",
411 ],
412 static_libs: [
413 // The order of these libraries matters, do not shuffle them.
414 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700415 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700416 "libziparchive",
417 "libz",
418 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800419 "libLLVMObject",
420 "libLLVMBitReader",
421 "libLLVMMC",
422 "libLLVMMCParser",
423 "libLLVMCore",
424 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700425 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700426 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700427 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700428 "-Wl,--enable-new-dtags",
429 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700430 },
431 }
432}
433
434cc_test {
435 name: "bionic-unit-tests",
436 defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800437
438 target: {
439 android: {
440 shared_libs: ["libicuuc"],
441 },
442 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700443
444 required: [
445 "cfi_test_helper",
446 "cfi_test_helper2",
447 "libtest_dt_runpath_a",
448 "libtest_dt_runpath_b",
449 "libtest_dt_runpath_c",
450 "libtest_dt_runpath_x",
451 "libatest_simple_zip",
452 "libcfi-test",
453 "libcfi-test-bad",
454 "libdlext_test_different_soname",
455 "libdlext_test_fd",
456 "libdlext_test_norelro",
457 "libdlext_test_runpath_zip_zipaligned",
458 "libdlext_test",
459 "libdlext_test_zip",
460 "libdlext_test_zip_zipaligned",
461 "libdl_preempt_test_1",
462 "libdl_preempt_test_2",
463 "libdl_test_df_1_global",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700464 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700465 "libsysv-hash-table-library",
466 "libtest_atexit",
467 "libtest_check_order_dlsym_1_left",
468 "libtest_check_order_dlsym_2_right",
469 "libtest_check_order_dlsym_3_c",
470 "libtest_check_order_dlsym_a",
471 "libtest_check_order_dlsym_b",
472 "libtest_check_order_dlsym_d",
473 "libtest_check_order_dlsym",
474 "libtest_check_order_reloc_root_1",
475 "libtest_check_order_reloc_root_2",
476 "libtest_check_order_reloc_root",
477 "libtest_check_order_reloc_siblings_1",
478 "libtest_check_order_reloc_siblings_2",
479 "libtest_check_order_reloc_siblings_3",
480 "libtest_check_order_reloc_siblings_a",
481 "libtest_check_order_reloc_siblings_b",
482 "libtest_check_order_reloc_siblings_c_1",
483 "libtest_check_order_reloc_siblings_c_2",
484 "libtest_check_order_reloc_siblings_c",
485 "libtest_check_order_reloc_siblings_d",
486 "libtest_check_order_reloc_siblings_e",
487 "libtest_check_order_reloc_siblings_f",
488 "libtest_check_order_reloc_siblings",
489 "libtest_check_rtld_next_from_library",
490 "libtest_dlopen_from_ctor_main",
491 "libtest_dlopen_from_ctor",
492 "libtest_dlopen_weak_undefined_func",
493 "libtest_dlsym_df_1_global",
494 "libtest_dlsym_from_this_child",
495 "libtest_dlsym_from_this_grandchild",
496 "libtest_dlsym_from_this",
497 "libtest_dlsym_weak_func",
498 "libtest_dt_runpath_d",
499 "libtest_empty",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700500 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700501 "libtest_init_fini_order_child",
502 "libtest_init_fini_order_grand_child",
503 "libtest_init_fini_order_root2",
504 "libtest_init_fini_order_root",
505 "libtest_nodelete_1",
506 "libtest_nodelete_2",
507 "libtest_nodelete_dt_flags_1",
508 "libtest_pthread_atfork",
509 "libtest_relo_check_dt_needed_order_1",
510 "libtest_relo_check_dt_needed_order_2",
511 "libtest_relo_check_dt_needed_order",
512 "libtest_simple",
513 "libtest_two_parents_child",
514 "libtest_two_parents_parent1",
515 "libtest_two_parents_parent2",
516 "libtest_versioned_lib",
517 "libtest_versioned_libv1",
518 "libtest_versioned_libv2",
519 "libtest_versioned_otherlib_empty",
520 "libtest_versioned_otherlib",
521 "libtest_versioned_uselibv1",
522 "libtest_versioned_uselibv2_other",
523 "libtest_versioned_uselibv2",
524 "libtest_versioned_uselibv3_other",
525 "libtest_with_dependency_loop_a",
526 "libtest_with_dependency_loop_b",
527 "libtest_with_dependency_loop_c",
528 "libtest_with_dependency_loop",
529 "libtest_with_dependency",
530 "libtest_invalid-empty_shdr_table.so",
531 "libtest_invalid-rw_load_segment.so",
532 "libtest_invalid-unaligned_shdr_offset.so",
533 "libtest_invalid-zero_shdr_table_content.so",
534 "libtest_invalid-zero_shdr_table_offset.so",
535 "libtest_invalid-zero_shentsize.so",
536 "libtest_invalid-zero_shstrndx.so",
537 "libtest_invalid-textrels.so",
538 "libtest_invalid-textrels2.so",
539 "preinit_getauxval_test_helper",
540 "preinit_syscall_test_helper",
541 "libnstest_private_external",
542 "libnstest_dlopened",
543 "libnstest_private",
544 "libnstest_root_not_isolated",
545 "libnstest_root",
546 "libnstest_public",
547 "libnstest_public_internal",
548 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700549}
550
Colin Cross2722ebb2016-07-11 16:20:06 -0700551// -----------------------------------------------------------------------------
552// Tests for the device linked against bionic's static library. Run with:
553// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
554// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
555// -----------------------------------------------------------------------------
556cc_test {
557 name: "bionic-unit-tests-static",
558 defaults: ["bionic_tests_defaults"],
559 host_supported: false,
560
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800561 srcs: [
562 "gtest_preinit_debuggerd.cpp",
563 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700564 whole_static_libs: [
565 "libBionicTests",
566 "libBionicGtestMain",
567 ],
568
569 static_libs: [
570 "libm",
571 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700572 "libdl",
573 "libtinyxml2",
574 "liblog",
575 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700576 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700577 ],
578
579 static_executable: true,
580 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700581}
582
583// -----------------------------------------------------------------------------
584// Tests to run on the host and linked against glibc. Run with:
585// cd bionic/tests; mm bionic-unit-tests-glibc-run
586// -----------------------------------------------------------------------------
587
588cc_test_host {
589 name: "bionic-unit-tests-glibc",
590 defaults: ["bionic_tests_defaults"],
591
592 srcs: [
593 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700594 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700595 "dlfcn_test.cpp",
596 "dl_test.cpp",
597 "pthread_dlfcn_test.cpp",
598 ],
599
600 shared_libs: [
601 "libdl_preempt_test_1",
602 "libdl_preempt_test_2",
603
604 "libdl_test_df_1_global",
605 ],
606
607 whole_static_libs: [
608 "libBionicStandardTests",
609 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700610 "libfortify1-tests-clang",
611 "libfortify2-tests-clang",
612 ],
613
614 static_libs: [
615 "libbase",
616 "liblog",
617 "libcutils",
618 ],
619
620 host_ldlibs: [
621 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700622 "-lutil",
623 ],
624
625 include_dirs: ["bionic/libc"],
626
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800627 ldflags: [
628 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
629 "-Wl,--export-dynamic",
630 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700631
632 sanitize: {
633 never: false,
634 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700635
636 target: {
637 linux_bionic: {
638 enabled: false,
639 },
640 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700641}
642
643subdirs = ["libs"]