blob: 075822a41549e7730de8d06b57ad83bd6078e571 [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",
60 "ctype_test.cpp",
61 "dirent_test.cpp",
Elliott Hughesd390df12017-04-30 22:56:10 -070062 "elf_test.cpp",
Elliott Hughesba267f42017-02-24 16:19:53 -080063 "endian_test.cpp",
Elliott Hughese452cb12017-06-13 14:43:53 -070064 "errno_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070065 "error_test.cpp",
66 "eventfd_test.cpp",
67 "fcntl_test.cpp",
68 "fenv_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070069 "float_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070070 "ftw_test.cpp",
71 "getauxval_test.cpp",
72 "getcwd_test.cpp",
73 "grp_pwd_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -070074 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070075 "ifaddrs_test.cpp",
76 "inttypes_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070077 "iso646_test.c",
Elliott Hughesfc8e6882016-11-18 16:27:29 -080078 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -070079 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070080 "libgen_basename_test.cpp",
81 "libgen_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070082 "limits_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -070083 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070084 "locale_test.cpp",
85 "malloc_test.cpp",
86 "math_test.cpp",
87 "mntent_test.cpp",
88 "netdb_test.cpp",
89 "net_if_test.cpp",
90 "netinet_ether_test.cpp",
91 "netinet_in_test.cpp",
92 "netinet_udp_test.cpp",
93 "nl_types_test.cpp",
94 "pthread_test.cpp",
95 "pty_test.cpp",
Xin Li4b1a3992017-05-19 10:13:08 -070096 "qsort_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070097 "regex_test.cpp",
98 "resolv_test.cpp",
99 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700100 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700101 "search_test.cpp",
102 "semaphore_test.cpp",
103 "setjmp_test.cpp",
104 "signal_test.cpp",
105 "stack_protector_test.cpp",
106 "stack_protector_test_helper.cpp",
107 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700108 "stdalign_test.cpp",
109 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700110 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700111 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700112 "stdint_test.cpp",
113 "stdio_nofortify_test.cpp",
114 "stdio_test.cpp",
115 "stdio_ext_test.cpp",
116 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700117 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700118 "string_nofortify_test.cpp",
119 "string_test.cpp",
120 "string_posix_strerror_r_test.cpp",
121 "strings_nofortify_test.cpp",
122 "strings_test.cpp",
123 "sstream_test.cpp",
124 "sys_epoll_test.cpp",
125 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700126 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700127 "sys_personality_test.cpp",
128 "sys_prctl_test.cpp",
129 "sys_procfs_test.cpp",
130 "sys_ptrace_test.cpp",
131 "sys_quota_test.cpp",
132 "sys_resource_test.cpp",
133 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700134 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700135 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700136 "sys_shm_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700137 "sys_socket_test.cpp",
138 "sys_stat_test.cpp",
139 "sys_statvfs_test.cpp",
140 "sys_syscall_test.cpp",
141 "sys_sysinfo_test.cpp",
142 "sys_sysmacros_test.cpp",
143 "sys_time_test.cpp",
144 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700145 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700146 "sys_types_test.cpp",
147 "sys_uio_test.cpp",
148 "sys_vfs_test.cpp",
149 "sys_xattr_test.cpp",
150 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000151 "system_properties_test2.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700152 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700153 "time_test.cpp",
154 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700155 "unistd_nofortify_test.cpp",
156 "unistd_test.cpp",
157 "utmp_test.cpp",
158 "wchar_test.cpp",
159 "wctype_test.cpp",
160 ],
161
162 include_dirs: [
163 "bionic/libc",
164 "external/tinyxml2",
165 ],
166
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700167 target: {
168 android: {
169 whole_static_libs: ["libasync_safe"],
170 },
171 },
172
Dan Willemsen41567702016-08-31 16:35:01 -0700173 static_libs: [
174 "libtinyxml2",
175 "liblog",
176 "libbase",
177 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700178 host_ldlibs: ["-lrt"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700179 shared: {
180 enabled: false,
181 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000182
183 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700184}
185
186// -----------------------------------------------------------------------------
187// Fortify tests.
188// -----------------------------------------------------------------------------
189
190cc_defaults {
191 name: "bionic_fortify_tests_defaults",
192 cflags: [
193 "-Wno-error",
194 "-U_FORTIFY_SOURCE",
195 ],
196 srcs: ["fortify_test_main.cpp"],
197 target: {
198 host: {
199 clang_cflags: ["-D__clang__"],
200 },
201 },
202}
203
George Burgess IVd9551db2017-08-17 18:51:02 -0700204// If building this fails, then we have both FORTIFY and ASAN enabled, which
205// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
206// enabled, but that's not a reality today.) This is meant to be otherwise
207// unused.
208cc_test_library {
209 name: "fortify_disabled_for_asan",
210 cflags: [
211 "-Werror",
212 "-D_FORTIFY_SOURCE=2",
213 // "sanitize: address" doesn't work on platforms where libasan isn't
214 // enabled. Since the intent is just to build this, we can get away with
215 // passing this flag on its own.
216 "-fsanitize=address",
217 ],
218 // Ignore that we don't have ASAN symbols linked in.
219 allow_undefined_symbols: true,
220 srcs: ["fortify_compilation_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700221}
222
Colin Cross2722ebb2016-07-11 16:20:06 -0700223cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700224 name: "libfortify1-tests-clang",
225 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700226 cflags: [
227 "-D_FORTIFY_SOURCE=1",
228 "-DTEST_NAME=Fortify1_clang"
229 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700230 shared: {
231 enabled: false,
232 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700233}
234
235cc_test_library {
236 name: "libfortify2-tests-clang",
237 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700238 cflags: [
239 "-D_FORTIFY_SOURCE=2",
240 "-DTEST_NAME=Fortify2_clang"
241 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700242 shared: {
243 enabled: false,
244 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700245}
246
247// -----------------------------------------------------------------------------
248// Library of all tests (excluding the dynamic linker tests).
249// -----------------------------------------------------------------------------
250cc_test_library {
251 name: "libBionicTests",
252 defaults: ["bionic_tests_defaults"],
253 whole_static_libs: [
254 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700255 "libfortify1-tests-clang",
256 "libfortify2-tests-clang",
257 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700258 shared: {
259 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700260 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700261}
262
263// -----------------------------------------------------------------------------
264// Library of bionic customized gtest main function, with simplified output format.
265// -----------------------------------------------------------------------------
266cc_test_library {
267 name: "libBionicGtestMain",
268 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700269 srcs: [
270 "gtest_main.cpp",
271 "gtest_globals.cpp",
272 ],
273 static_libs: [
274 "libbase",
275 ],
276 include_dirs: [
277 "bionic/libc",
278 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700279 target: {
280 darwin: {
281 enabled: true,
282 },
283 },
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700284 shared: {
285 enabled: false,
286 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700287}
288
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700289cc_test_library {
290 name: "libBionicLoaderTests",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800291 defaults: ["bionic_tests_defaults", "llvm-defaults"],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700292 srcs: [
293 "atexit_test.cpp",
294 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700295 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700296 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700297 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700298 "pthread_dlfcn_test.cpp",
299 ],
300 static_libs: [
301 "libbase",
302 ],
303 include_dirs: [
304 "bionic/libc",
305 ],
306 shared: {
307 enabled: false,
308 },
309 target: {
310 android: {
311 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700312 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700313 "dlext_test.cpp",
314 "libdl_test.cpp",
315 ],
316 static_libs: [
317 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700318 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800319 "libLLVMObject",
320 "libLLVMBitReader",
321 "libLLVMMC",
322 "libLLVMMCParser",
323 "libLLVMCore",
324 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700325 ],
326 }
Jiyong Park02586a22017-05-20 01:01:24 +0900327 },
328
329 product_variables: {
330 debuggable: {
331 cppflags: ["-DUSE_LD_CONFIG_FILE"],
332 },
333 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700334}
335
Colin Cross2722ebb2016-07-11 16:20:06 -0700336// -----------------------------------------------------------------------------
337// Library of bionic customized gtest main function, with normal gtest output format,
338// which is needed by bionic cts test.
339// -----------------------------------------------------------------------------
340cc_test_library {
341 name: "libBionicCtsGtestMain",
342 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700343 srcs: [
344 "gtest_main.cpp",
345 "gtest_globals_cts.cpp",
346 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700347 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700348 shared: {
349 enabled: false,
350 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700351}
352
353// -----------------------------------------------------------------------------
354// Tests for the device using bionic's .so. Run with:
355// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
356// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
357// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
358// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
359// -----------------------------------------------------------------------------
360cc_defaults {
361 name: "bionic_unit_tests_defaults",
362 host_supported: false,
363
364 whole_static_libs: [
365 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700366 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700367 "libBionicGtestMain",
368 ],
369
370 static_libs: [
371 "libtinyxml2",
372 "liblog",
373 "libbase",
374 ],
375
376 srcs: [
377 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700378 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700379 "thread_local_test.cpp",
380 ],
381
382 conlyflags: [
383 "-fexceptions",
384 "-fnon-call-exceptions",
385 ],
386
387 ldflags: ["-Wl,--export-dynamic"],
388
389 include_dirs: ["bionic/libc"],
390
Yabin Cui1f553ea2017-01-13 12:31:59 -0800391 stl: "libc++_static",
392
Colin Cross2722ebb2016-07-11 16:20:06 -0700393 target: {
394 android: {
395 shared_libs: [
396 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700397 "libdl_preempt_test_1",
398 "libdl_preempt_test_2",
399 "libdl_test_df_1_global",
400 ],
401 static_libs: [
402 // The order of these libraries matters, do not shuffle them.
403 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700404 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700405 "libziparchive",
406 "libz",
407 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800408 "libLLVMObject",
409 "libLLVMBitReader",
410 "libLLVMMC",
411 "libLLVMMCParser",
412 "libLLVMCore",
413 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700414 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700415 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700416 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700417 "-Wl,--enable-new-dtags",
418 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700419 },
420 }
421}
422
423cc_test {
424 name: "bionic-unit-tests",
425 defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800426
427 target: {
428 android: {
429 shared_libs: ["libicuuc"],
430 },
431 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700432
433 required: [
434 "cfi_test_helper",
435 "cfi_test_helper2",
436 "libtest_dt_runpath_a",
437 "libtest_dt_runpath_b",
438 "libtest_dt_runpath_c",
439 "libtest_dt_runpath_x",
440 "libatest_simple_zip",
441 "libcfi-test",
442 "libcfi-test-bad",
443 "libdlext_test_different_soname",
444 "libdlext_test_fd",
445 "libdlext_test_norelro",
446 "libdlext_test_runpath_zip_zipaligned",
447 "libdlext_test",
448 "libdlext_test_zip",
449 "libdlext_test_zip_zipaligned",
450 "libdl_preempt_test_1",
451 "libdl_preempt_test_2",
452 "libdl_test_df_1_global",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700453 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700454 "libsysv-hash-table-library",
455 "libtest_atexit",
456 "libtest_check_order_dlsym_1_left",
457 "libtest_check_order_dlsym_2_right",
458 "libtest_check_order_dlsym_3_c",
459 "libtest_check_order_dlsym_a",
460 "libtest_check_order_dlsym_b",
461 "libtest_check_order_dlsym_d",
462 "libtest_check_order_dlsym",
463 "libtest_check_order_reloc_root_1",
464 "libtest_check_order_reloc_root_2",
465 "libtest_check_order_reloc_root",
466 "libtest_check_order_reloc_siblings_1",
467 "libtest_check_order_reloc_siblings_2",
468 "libtest_check_order_reloc_siblings_3",
469 "libtest_check_order_reloc_siblings_a",
470 "libtest_check_order_reloc_siblings_b",
471 "libtest_check_order_reloc_siblings_c_1",
472 "libtest_check_order_reloc_siblings_c_2",
473 "libtest_check_order_reloc_siblings_c",
474 "libtest_check_order_reloc_siblings_d",
475 "libtest_check_order_reloc_siblings_e",
476 "libtest_check_order_reloc_siblings_f",
477 "libtest_check_order_reloc_siblings",
478 "libtest_check_rtld_next_from_library",
479 "libtest_dlopen_from_ctor_main",
480 "libtest_dlopen_from_ctor",
481 "libtest_dlopen_weak_undefined_func",
482 "libtest_dlsym_df_1_global",
483 "libtest_dlsym_from_this_child",
484 "libtest_dlsym_from_this_grandchild",
485 "libtest_dlsym_from_this",
486 "libtest_dlsym_weak_func",
487 "libtest_dt_runpath_d",
488 "libtest_empty",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700489 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700490 "libtest_init_fini_order_child",
491 "libtest_init_fini_order_grand_child",
492 "libtest_init_fini_order_root2",
493 "libtest_init_fini_order_root",
494 "libtest_nodelete_1",
495 "libtest_nodelete_2",
496 "libtest_nodelete_dt_flags_1",
497 "libtest_pthread_atfork",
498 "libtest_relo_check_dt_needed_order_1",
499 "libtest_relo_check_dt_needed_order_2",
500 "libtest_relo_check_dt_needed_order",
501 "libtest_simple",
502 "libtest_two_parents_child",
503 "libtest_two_parents_parent1",
504 "libtest_two_parents_parent2",
505 "libtest_versioned_lib",
506 "libtest_versioned_libv1",
507 "libtest_versioned_libv2",
508 "libtest_versioned_otherlib_empty",
509 "libtest_versioned_otherlib",
510 "libtest_versioned_uselibv1",
511 "libtest_versioned_uselibv2_other",
512 "libtest_versioned_uselibv2",
513 "libtest_versioned_uselibv3_other",
514 "libtest_with_dependency_loop_a",
515 "libtest_with_dependency_loop_b",
516 "libtest_with_dependency_loop_c",
517 "libtest_with_dependency_loop",
518 "libtest_with_dependency",
519 "libtest_invalid-empty_shdr_table.so",
520 "libtest_invalid-rw_load_segment.so",
521 "libtest_invalid-unaligned_shdr_offset.so",
522 "libtest_invalid-zero_shdr_table_content.so",
523 "libtest_invalid-zero_shdr_table_offset.so",
524 "libtest_invalid-zero_shentsize.so",
525 "libtest_invalid-zero_shstrndx.so",
526 "libtest_invalid-textrels.so",
527 "libtest_invalid-textrels2.so",
528 "preinit_getauxval_test_helper",
529 "preinit_syscall_test_helper",
530 "libnstest_private_external",
531 "libnstest_dlopened",
532 "libnstest_private",
533 "libnstest_root_not_isolated",
534 "libnstest_root",
535 "libnstest_public",
536 "libnstest_public_internal",
537 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700538}
539
Colin Cross2722ebb2016-07-11 16:20:06 -0700540// -----------------------------------------------------------------------------
541// Tests for the device linked against bionic's static library. Run with:
542// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
543// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
544// -----------------------------------------------------------------------------
545cc_test {
546 name: "bionic-unit-tests-static",
547 defaults: ["bionic_tests_defaults"],
548 host_supported: false,
549
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800550 srcs: [
551 "gtest_preinit_debuggerd.cpp",
552 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700553 whole_static_libs: [
554 "libBionicTests",
555 "libBionicGtestMain",
556 ],
557
558 static_libs: [
559 "libm",
560 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700561 "libdl",
562 "libtinyxml2",
563 "liblog",
564 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700565 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700566 ],
567
568 static_executable: true,
569 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700570}
571
572// -----------------------------------------------------------------------------
573// Tests to run on the host and linked against glibc. Run with:
574// cd bionic/tests; mm bionic-unit-tests-glibc-run
575// -----------------------------------------------------------------------------
576
577cc_test_host {
578 name: "bionic-unit-tests-glibc",
579 defaults: ["bionic_tests_defaults"],
580
581 srcs: [
582 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700583 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700584 "dlfcn_test.cpp",
585 "dl_test.cpp",
586 "pthread_dlfcn_test.cpp",
587 ],
588
589 shared_libs: [
590 "libdl_preempt_test_1",
591 "libdl_preempt_test_2",
592
593 "libdl_test_df_1_global",
594 ],
595
596 whole_static_libs: [
597 "libBionicStandardTests",
598 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700599 "libfortify1-tests-clang",
600 "libfortify2-tests-clang",
601 ],
602
603 static_libs: [
604 "libbase",
605 "liblog",
606 "libcutils",
607 ],
608
609 host_ldlibs: [
610 "-lresolv",
611 "-lrt",
612 "-ldl",
613 "-lutil",
614 ],
615
616 include_dirs: ["bionic/libc"],
617
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800618 ldflags: [
619 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
620 "-Wl,--export-dynamic",
621 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700622
623 sanitize: {
624 never: false,
625 },
Jiyong Park02586a22017-05-20 01:01:24 +0900626
627 product_variables: {
628 debuggable: {
629 cppflags: ["-DUSE_LD_CONFIG_FILE"],
630 },
631 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700632}
633
634subdirs = ["libs"]