blob: 693e3cf7031c30abb78a17c40fc0d366645348ce [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",
108 "stack_protector_test.cpp",
109 "stack_protector_test_helper.cpp",
110 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700111 "stdalign_test.cpp",
112 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700113 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700114 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700115 "stdint_test.cpp",
116 "stdio_nofortify_test.cpp",
117 "stdio_test.cpp",
118 "stdio_ext_test.cpp",
119 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700120 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700121 "string_nofortify_test.cpp",
122 "string_test.cpp",
123 "string_posix_strerror_r_test.cpp",
124 "strings_nofortify_test.cpp",
125 "strings_test.cpp",
126 "sstream_test.cpp",
127 "sys_epoll_test.cpp",
128 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700129 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700130 "sys_personality_test.cpp",
131 "sys_prctl_test.cpp",
132 "sys_procfs_test.cpp",
133 "sys_ptrace_test.cpp",
134 "sys_quota_test.cpp",
135 "sys_resource_test.cpp",
136 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700137 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700138 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700139 "sys_shm_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700140 "sys_socket_test.cpp",
141 "sys_stat_test.cpp",
142 "sys_statvfs_test.cpp",
143 "sys_syscall_test.cpp",
144 "sys_sysinfo_test.cpp",
145 "sys_sysmacros_test.cpp",
146 "sys_time_test.cpp",
147 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700148 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700149 "sys_types_test.cpp",
150 "sys_uio_test.cpp",
151 "sys_vfs_test.cpp",
152 "sys_xattr_test.cpp",
153 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000154 "system_properties_test2.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700155 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700156 "time_test.cpp",
157 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700158 "unistd_nofortify_test.cpp",
159 "unistd_test.cpp",
160 "utmp_test.cpp",
161 "wchar_test.cpp",
162 "wctype_test.cpp",
163 ],
164
165 include_dirs: [
166 "bionic/libc",
167 "external/tinyxml2",
168 ],
169
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700170 target: {
171 android: {
172 whole_static_libs: ["libasync_safe"],
173 },
174 },
175
Dan Willemsen41567702016-08-31 16:35:01 -0700176 static_libs: [
177 "libtinyxml2",
178 "liblog",
179 "libbase",
180 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700181 host_ldlibs: ["-lrt"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700182 shared: {
183 enabled: false,
184 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000185
186 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700187}
188
189// -----------------------------------------------------------------------------
190// Fortify tests.
191// -----------------------------------------------------------------------------
192
193cc_defaults {
194 name: "bionic_fortify_tests_defaults",
195 cflags: [
196 "-Wno-error",
197 "-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,
223 srcs: ["fortify_compilation_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700224}
225
Colin Cross2722ebb2016-07-11 16:20:06 -0700226cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700227 name: "libfortify1-tests-clang",
228 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700229 cflags: [
230 "-D_FORTIFY_SOURCE=1",
231 "-DTEST_NAME=Fortify1_clang"
232 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700233 shared: {
234 enabled: false,
235 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700236}
237
238cc_test_library {
239 name: "libfortify2-tests-clang",
240 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700241 cflags: [
242 "-D_FORTIFY_SOURCE=2",
243 "-DTEST_NAME=Fortify2_clang"
244 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700245 shared: {
246 enabled: false,
247 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700248}
249
250// -----------------------------------------------------------------------------
251// Library of all tests (excluding the dynamic linker tests).
252// -----------------------------------------------------------------------------
253cc_test_library {
254 name: "libBionicTests",
255 defaults: ["bionic_tests_defaults"],
256 whole_static_libs: [
257 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700258 "libfortify1-tests-clang",
259 "libfortify2-tests-clang",
260 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700261 shared: {
262 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700263 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700264}
265
266// -----------------------------------------------------------------------------
267// Library of bionic customized gtest main function, with simplified output format.
268// -----------------------------------------------------------------------------
269cc_test_library {
270 name: "libBionicGtestMain",
271 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700272 srcs: [
273 "gtest_main.cpp",
274 "gtest_globals.cpp",
275 ],
276 static_libs: [
277 "libbase",
278 ],
279 include_dirs: [
280 "bionic/libc",
281 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700282 target: {
283 darwin: {
284 enabled: true,
285 },
286 },
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700287 shared: {
288 enabled: false,
289 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700290}
291
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700292cc_test_library {
293 name: "libBionicLoaderTests",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800294 defaults: ["bionic_tests_defaults", "llvm-defaults"],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700295 srcs: [
296 "atexit_test.cpp",
297 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700298 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700299 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700300 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700301 "pthread_dlfcn_test.cpp",
302 ],
303 static_libs: [
304 "libbase",
305 ],
306 include_dirs: [
307 "bionic/libc",
308 ],
309 shared: {
310 enabled: false,
311 },
312 target: {
313 android: {
314 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700315 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700316 "dlext_test.cpp",
317 "libdl_test.cpp",
318 ],
319 static_libs: [
320 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700321 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800322 "libLLVMObject",
323 "libLLVMBitReader",
324 "libLLVMMC",
325 "libLLVMMCParser",
326 "libLLVMCore",
327 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700328 ],
329 }
Jiyong Park02586a22017-05-20 01:01:24 +0900330 },
331
332 product_variables: {
333 debuggable: {
334 cppflags: ["-DUSE_LD_CONFIG_FILE"],
335 },
336 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700337}
338
Colin Cross2722ebb2016-07-11 16:20:06 -0700339// -----------------------------------------------------------------------------
340// Library of bionic customized gtest main function, with normal gtest output format,
341// which is needed by bionic cts test.
342// -----------------------------------------------------------------------------
343cc_test_library {
344 name: "libBionicCtsGtestMain",
345 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700346 srcs: [
347 "gtest_main.cpp",
348 "gtest_globals_cts.cpp",
349 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700350 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700351 shared: {
352 enabled: false,
353 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700354}
355
356// -----------------------------------------------------------------------------
357// Tests for the device using bionic's .so. Run with:
358// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
359// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
360// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
361// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
362// -----------------------------------------------------------------------------
363cc_defaults {
364 name: "bionic_unit_tests_defaults",
365 host_supported: false,
366
367 whole_static_libs: [
368 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700369 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700370 "libBionicGtestMain",
371 ],
372
373 static_libs: [
374 "libtinyxml2",
375 "liblog",
376 "libbase",
377 ],
378
379 srcs: [
380 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700381 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700382 "thread_local_test.cpp",
383 ],
384
385 conlyflags: [
386 "-fexceptions",
387 "-fnon-call-exceptions",
388 ],
389
390 ldflags: ["-Wl,--export-dynamic"],
391
392 include_dirs: ["bionic/libc"],
393
Yabin Cui1f553ea2017-01-13 12:31:59 -0800394 stl: "libc++_static",
395
Colin Cross2722ebb2016-07-11 16:20:06 -0700396 target: {
397 android: {
398 shared_libs: [
399 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700400 "libdl_preempt_test_1",
401 "libdl_preempt_test_2",
402 "libdl_test_df_1_global",
403 ],
404 static_libs: [
405 // The order of these libraries matters, do not shuffle them.
406 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700407 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700408 "libziparchive",
409 "libz",
410 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800411 "libLLVMObject",
412 "libLLVMBitReader",
413 "libLLVMMC",
414 "libLLVMMCParser",
415 "libLLVMCore",
416 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700417 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700418 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700419 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700420 "-Wl,--enable-new-dtags",
421 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700422 },
423 }
424}
425
426cc_test {
427 name: "bionic-unit-tests",
428 defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800429
430 target: {
431 android: {
432 shared_libs: ["libicuuc"],
433 },
434 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700435
436 required: [
437 "cfi_test_helper",
438 "cfi_test_helper2",
439 "libtest_dt_runpath_a",
440 "libtest_dt_runpath_b",
441 "libtest_dt_runpath_c",
442 "libtest_dt_runpath_x",
443 "libatest_simple_zip",
444 "libcfi-test",
445 "libcfi-test-bad",
446 "libdlext_test_different_soname",
447 "libdlext_test_fd",
448 "libdlext_test_norelro",
449 "libdlext_test_runpath_zip_zipaligned",
450 "libdlext_test",
451 "libdlext_test_zip",
452 "libdlext_test_zip_zipaligned",
453 "libdl_preempt_test_1",
454 "libdl_preempt_test_2",
455 "libdl_test_df_1_global",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700456 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700457 "libsysv-hash-table-library",
458 "libtest_atexit",
459 "libtest_check_order_dlsym_1_left",
460 "libtest_check_order_dlsym_2_right",
461 "libtest_check_order_dlsym_3_c",
462 "libtest_check_order_dlsym_a",
463 "libtest_check_order_dlsym_b",
464 "libtest_check_order_dlsym_d",
465 "libtest_check_order_dlsym",
466 "libtest_check_order_reloc_root_1",
467 "libtest_check_order_reloc_root_2",
468 "libtest_check_order_reloc_root",
469 "libtest_check_order_reloc_siblings_1",
470 "libtest_check_order_reloc_siblings_2",
471 "libtest_check_order_reloc_siblings_3",
472 "libtest_check_order_reloc_siblings_a",
473 "libtest_check_order_reloc_siblings_b",
474 "libtest_check_order_reloc_siblings_c_1",
475 "libtest_check_order_reloc_siblings_c_2",
476 "libtest_check_order_reloc_siblings_c",
477 "libtest_check_order_reloc_siblings_d",
478 "libtest_check_order_reloc_siblings_e",
479 "libtest_check_order_reloc_siblings_f",
480 "libtest_check_order_reloc_siblings",
481 "libtest_check_rtld_next_from_library",
482 "libtest_dlopen_from_ctor_main",
483 "libtest_dlopen_from_ctor",
484 "libtest_dlopen_weak_undefined_func",
485 "libtest_dlsym_df_1_global",
486 "libtest_dlsym_from_this_child",
487 "libtest_dlsym_from_this_grandchild",
488 "libtest_dlsym_from_this",
489 "libtest_dlsym_weak_func",
490 "libtest_dt_runpath_d",
491 "libtest_empty",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700492 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700493 "libtest_init_fini_order_child",
494 "libtest_init_fini_order_grand_child",
495 "libtest_init_fini_order_root2",
496 "libtest_init_fini_order_root",
497 "libtest_nodelete_1",
498 "libtest_nodelete_2",
499 "libtest_nodelete_dt_flags_1",
500 "libtest_pthread_atfork",
501 "libtest_relo_check_dt_needed_order_1",
502 "libtest_relo_check_dt_needed_order_2",
503 "libtest_relo_check_dt_needed_order",
504 "libtest_simple",
505 "libtest_two_parents_child",
506 "libtest_two_parents_parent1",
507 "libtest_two_parents_parent2",
508 "libtest_versioned_lib",
509 "libtest_versioned_libv1",
510 "libtest_versioned_libv2",
511 "libtest_versioned_otherlib_empty",
512 "libtest_versioned_otherlib",
513 "libtest_versioned_uselibv1",
514 "libtest_versioned_uselibv2_other",
515 "libtest_versioned_uselibv2",
516 "libtest_versioned_uselibv3_other",
517 "libtest_with_dependency_loop_a",
518 "libtest_with_dependency_loop_b",
519 "libtest_with_dependency_loop_c",
520 "libtest_with_dependency_loop",
521 "libtest_with_dependency",
522 "libtest_invalid-empty_shdr_table.so",
523 "libtest_invalid-rw_load_segment.so",
524 "libtest_invalid-unaligned_shdr_offset.so",
525 "libtest_invalid-zero_shdr_table_content.so",
526 "libtest_invalid-zero_shdr_table_offset.so",
527 "libtest_invalid-zero_shentsize.so",
528 "libtest_invalid-zero_shstrndx.so",
529 "libtest_invalid-textrels.so",
530 "libtest_invalid-textrels2.so",
531 "preinit_getauxval_test_helper",
532 "preinit_syscall_test_helper",
533 "libnstest_private_external",
534 "libnstest_dlopened",
535 "libnstest_private",
536 "libnstest_root_not_isolated",
537 "libnstest_root",
538 "libnstest_public",
539 "libnstest_public_internal",
540 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700541}
542
Colin Cross2722ebb2016-07-11 16:20:06 -0700543// -----------------------------------------------------------------------------
544// Tests for the device linked against bionic's static library. Run with:
545// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
546// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
547// -----------------------------------------------------------------------------
548cc_test {
549 name: "bionic-unit-tests-static",
550 defaults: ["bionic_tests_defaults"],
551 host_supported: false,
552
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800553 srcs: [
554 "gtest_preinit_debuggerd.cpp",
555 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700556 whole_static_libs: [
557 "libBionicTests",
558 "libBionicGtestMain",
559 ],
560
561 static_libs: [
562 "libm",
563 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700564 "libdl",
565 "libtinyxml2",
566 "liblog",
567 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700568 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700569 ],
570
571 static_executable: true,
572 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700573}
574
575// -----------------------------------------------------------------------------
576// Tests to run on the host and linked against glibc. Run with:
577// cd bionic/tests; mm bionic-unit-tests-glibc-run
578// -----------------------------------------------------------------------------
579
580cc_test_host {
581 name: "bionic-unit-tests-glibc",
582 defaults: ["bionic_tests_defaults"],
583
584 srcs: [
585 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700586 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700587 "dlfcn_test.cpp",
588 "dl_test.cpp",
589 "pthread_dlfcn_test.cpp",
590 ],
591
592 shared_libs: [
593 "libdl_preempt_test_1",
594 "libdl_preempt_test_2",
595
596 "libdl_test_df_1_global",
597 ],
598
599 whole_static_libs: [
600 "libBionicStandardTests",
601 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700602 "libfortify1-tests-clang",
603 "libfortify2-tests-clang",
604 ],
605
606 static_libs: [
607 "libbase",
608 "liblog",
609 "libcutils",
610 ],
611
612 host_ldlibs: [
613 "-lresolv",
614 "-lrt",
615 "-ldl",
616 "-lutil",
617 ],
618
619 include_dirs: ["bionic/libc"],
620
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800621 ldflags: [
622 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
623 "-Wl,--export-dynamic",
624 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700625
626 sanitize: {
627 never: false,
628 },
Jiyong Park02586a22017-05-20 01:01:24 +0900629
630 product_variables: {
631 debuggable: {
632 cppflags: ["-DUSE_LD_CONFIG_FILE"],
633 },
634 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700635}
636
637subdirs = ["libs"]