blob: b5f8dc8d8c5ba065a3a2d47e2e698d3ad087535f [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",
69 "ftw_test.cpp",
70 "getauxval_test.cpp",
71 "getcwd_test.cpp",
72 "grp_pwd_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -070073 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070074 "ifaddrs_test.cpp",
75 "inttypes_test.cpp",
Elliott Hughesfc8e6882016-11-18 16:27:29 -080076 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -070077 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070078 "libgen_basename_test.cpp",
79 "libgen_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -070080 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070081 "locale_test.cpp",
82 "malloc_test.cpp",
83 "math_test.cpp",
84 "mntent_test.cpp",
85 "netdb_test.cpp",
86 "net_if_test.cpp",
87 "netinet_ether_test.cpp",
88 "netinet_in_test.cpp",
89 "netinet_udp_test.cpp",
90 "nl_types_test.cpp",
91 "pthread_test.cpp",
92 "pty_test.cpp",
Xin Li4b1a3992017-05-19 10:13:08 -070093 "qsort_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070094 "regex_test.cpp",
95 "resolv_test.cpp",
96 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -070097 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070098 "search_test.cpp",
99 "semaphore_test.cpp",
100 "setjmp_test.cpp",
101 "signal_test.cpp",
102 "stack_protector_test.cpp",
103 "stack_protector_test_helper.cpp",
104 "stack_unwinding_test.cpp",
105 "stdatomic_test.cpp",
106 "stdint_test.cpp",
107 "stdio_nofortify_test.cpp",
108 "stdio_test.cpp",
109 "stdio_ext_test.cpp",
110 "stdlib_test.cpp",
111 "string_nofortify_test.cpp",
112 "string_test.cpp",
113 "string_posix_strerror_r_test.cpp",
114 "strings_nofortify_test.cpp",
115 "strings_test.cpp",
116 "sstream_test.cpp",
117 "sys_epoll_test.cpp",
118 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700119 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700120 "sys_personality_test.cpp",
121 "sys_prctl_test.cpp",
122 "sys_procfs_test.cpp",
123 "sys_ptrace_test.cpp",
124 "sys_quota_test.cpp",
125 "sys_resource_test.cpp",
126 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700127 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700128 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700129 "sys_shm_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700130 "sys_socket_test.cpp",
131 "sys_stat_test.cpp",
132 "sys_statvfs_test.cpp",
133 "sys_syscall_test.cpp",
134 "sys_sysinfo_test.cpp",
135 "sys_sysmacros_test.cpp",
136 "sys_time_test.cpp",
137 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700138 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700139 "sys_types_test.cpp",
140 "sys_uio_test.cpp",
141 "sys_vfs_test.cpp",
142 "sys_xattr_test.cpp",
143 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000144 "system_properties_test2.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700145 "time_test.cpp",
146 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700147 "unistd_nofortify_test.cpp",
148 "unistd_test.cpp",
149 "utmp_test.cpp",
150 "wchar_test.cpp",
151 "wctype_test.cpp",
152 ],
153
154 include_dirs: [
155 "bionic/libc",
156 "external/tinyxml2",
157 ],
158
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700159 target: {
160 android: {
161 whole_static_libs: ["libasync_safe"],
162 },
163 },
164
Dan Willemsen41567702016-08-31 16:35:01 -0700165 static_libs: [
166 "libtinyxml2",
167 "liblog",
168 "libbase",
169 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700170 host_ldlibs: ["-lrt"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700171 shared: {
172 enabled: false,
173 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000174
175 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700176}
177
178// -----------------------------------------------------------------------------
179// Fortify tests.
180// -----------------------------------------------------------------------------
181
182cc_defaults {
183 name: "bionic_fortify_tests_defaults",
184 cflags: [
185 "-Wno-error",
186 "-U_FORTIFY_SOURCE",
187 ],
188 srcs: ["fortify_test_main.cpp"],
189 target: {
190 host: {
191 clang_cflags: ["-D__clang__"],
192 },
193 },
194}
195
George Burgess IVd9551db2017-08-17 18:51:02 -0700196// If building this fails, then we have both FORTIFY and ASAN enabled, which
197// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
198// enabled, but that's not a reality today.) This is meant to be otherwise
199// unused.
200cc_test_library {
201 name: "fortify_disabled_for_asan",
202 cflags: [
203 "-Werror",
204 "-D_FORTIFY_SOURCE=2",
205 // "sanitize: address" doesn't work on platforms where libasan isn't
206 // enabled. Since the intent is just to build this, we can get away with
207 // passing this flag on its own.
208 "-fsanitize=address",
209 ],
210 // Ignore that we don't have ASAN symbols linked in.
211 allow_undefined_symbols: true,
212 srcs: ["fortify_compilation_test.cpp"],
213 clang: true,
214}
215
Colin Cross2722ebb2016-07-11 16:20:06 -0700216cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700217 name: "libfortify1-tests-clang",
218 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
219 clang: true,
220 cflags: [
221 "-D_FORTIFY_SOURCE=1",
222 "-DTEST_NAME=Fortify1_clang"
223 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700224 shared: {
225 enabled: false,
226 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700227}
228
229cc_test_library {
230 name: "libfortify2-tests-clang",
231 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
232 clang: true,
233 cflags: [
234 "-D_FORTIFY_SOURCE=2",
235 "-DTEST_NAME=Fortify2_clang"
236 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700237 shared: {
238 enabled: false,
239 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700240}
241
242// -----------------------------------------------------------------------------
243// Library of all tests (excluding the dynamic linker tests).
244// -----------------------------------------------------------------------------
245cc_test_library {
246 name: "libBionicTests",
247 defaults: ["bionic_tests_defaults"],
248 whole_static_libs: [
249 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700250 "libfortify1-tests-clang",
251 "libfortify2-tests-clang",
252 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700253 shared: {
254 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700255 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700256}
257
258// -----------------------------------------------------------------------------
259// Library of bionic customized gtest main function, with simplified output format.
260// -----------------------------------------------------------------------------
261cc_test_library {
262 name: "libBionicGtestMain",
263 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700264 srcs: [
265 "gtest_main.cpp",
266 "gtest_globals.cpp",
267 ],
268 static_libs: [
269 "libbase",
270 ],
271 include_dirs: [
272 "bionic/libc",
273 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700274 target: {
275 darwin: {
276 enabled: true,
277 },
278 },
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700279 shared: {
280 enabled: false,
281 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700282}
283
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700284cc_test_library {
285 name: "libBionicLoaderTests",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800286 defaults: ["bionic_tests_defaults", "llvm-defaults"],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700287 srcs: [
288 "atexit_test.cpp",
289 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700290 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700291 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700292 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700293 "pthread_dlfcn_test.cpp",
294 ],
295 static_libs: [
296 "libbase",
297 ],
298 include_dirs: [
299 "bionic/libc",
300 ],
301 shared: {
302 enabled: false,
303 },
304 target: {
305 android: {
306 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700307 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700308 "dlext_test.cpp",
309 "libdl_test.cpp",
310 ],
311 static_libs: [
312 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700313 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800314 "libLLVMObject",
315 "libLLVMBitReader",
316 "libLLVMMC",
317 "libLLVMMCParser",
318 "libLLVMCore",
319 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700320 ],
321 }
Jiyong Park02586a22017-05-20 01:01:24 +0900322 },
323
324 product_variables: {
325 debuggable: {
326 cppflags: ["-DUSE_LD_CONFIG_FILE"],
327 },
328 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700329}
330
Colin Cross2722ebb2016-07-11 16:20:06 -0700331// -----------------------------------------------------------------------------
332// Library of bionic customized gtest main function, with normal gtest output format,
333// which is needed by bionic cts test.
334// -----------------------------------------------------------------------------
335cc_test_library {
336 name: "libBionicCtsGtestMain",
337 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700338 srcs: [
339 "gtest_main.cpp",
340 "gtest_globals_cts.cpp",
341 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700342 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700343 shared: {
344 enabled: false,
345 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700346}
347
348// -----------------------------------------------------------------------------
349// Tests for the device using bionic's .so. Run with:
350// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
351// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
352// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
353// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
354// -----------------------------------------------------------------------------
355cc_defaults {
356 name: "bionic_unit_tests_defaults",
357 host_supported: false,
358
359 whole_static_libs: [
360 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700361 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700362 "libBionicGtestMain",
363 ],
364
365 static_libs: [
366 "libtinyxml2",
367 "liblog",
368 "libbase",
369 ],
370
371 srcs: [
372 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700373 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700374 "thread_local_test.cpp",
375 ],
376
377 conlyflags: [
378 "-fexceptions",
379 "-fnon-call-exceptions",
380 ],
381
382 ldflags: ["-Wl,--export-dynamic"],
383
384 include_dirs: ["bionic/libc"],
385
Yabin Cui1f553ea2017-01-13 12:31:59 -0800386 stl: "libc++_static",
387
Colin Cross2722ebb2016-07-11 16:20:06 -0700388 target: {
389 android: {
390 shared_libs: [
391 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700392 "libdl_preempt_test_1",
393 "libdl_preempt_test_2",
394 "libdl_test_df_1_global",
395 ],
396 static_libs: [
397 // The order of these libraries matters, do not shuffle them.
398 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700399 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700400 "libziparchive",
401 "libz",
402 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800403 "libLLVMObject",
404 "libLLVMBitReader",
405 "libLLVMMC",
406 "libLLVMMCParser",
407 "libLLVMCore",
408 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700409 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700410 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700411 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700412 "-Wl,--enable-new-dtags",
413 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700414 },
415 }
416}
417
418cc_test {
419 name: "bionic-unit-tests",
420 defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"],
421 clang: true,
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800422
423 target: {
424 android: {
425 shared_libs: ["libicuuc"],
426 },
427 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700428
429 required: [
430 "cfi_test_helper",
431 "cfi_test_helper2",
432 "libtest_dt_runpath_a",
433 "libtest_dt_runpath_b",
434 "libtest_dt_runpath_c",
435 "libtest_dt_runpath_x",
436 "libatest_simple_zip",
437 "libcfi-test",
438 "libcfi-test-bad",
439 "libdlext_test_different_soname",
440 "libdlext_test_fd",
441 "libdlext_test_norelro",
442 "libdlext_test_runpath_zip_zipaligned",
443 "libdlext_test",
444 "libdlext_test_zip",
445 "libdlext_test_zip_zipaligned",
446 "libdl_preempt_test_1",
447 "libdl_preempt_test_2",
448 "libdl_test_df_1_global",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700449 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700450 "libsysv-hash-table-library",
451 "libtest_atexit",
452 "libtest_check_order_dlsym_1_left",
453 "libtest_check_order_dlsym_2_right",
454 "libtest_check_order_dlsym_3_c",
455 "libtest_check_order_dlsym_a",
456 "libtest_check_order_dlsym_b",
457 "libtest_check_order_dlsym_d",
458 "libtest_check_order_dlsym",
459 "libtest_check_order_reloc_root_1",
460 "libtest_check_order_reloc_root_2",
461 "libtest_check_order_reloc_root",
462 "libtest_check_order_reloc_siblings_1",
463 "libtest_check_order_reloc_siblings_2",
464 "libtest_check_order_reloc_siblings_3",
465 "libtest_check_order_reloc_siblings_a",
466 "libtest_check_order_reloc_siblings_b",
467 "libtest_check_order_reloc_siblings_c_1",
468 "libtest_check_order_reloc_siblings_c_2",
469 "libtest_check_order_reloc_siblings_c",
470 "libtest_check_order_reloc_siblings_d",
471 "libtest_check_order_reloc_siblings_e",
472 "libtest_check_order_reloc_siblings_f",
473 "libtest_check_order_reloc_siblings",
474 "libtest_check_rtld_next_from_library",
475 "libtest_dlopen_from_ctor_main",
476 "libtest_dlopen_from_ctor",
477 "libtest_dlopen_weak_undefined_func",
478 "libtest_dlsym_df_1_global",
479 "libtest_dlsym_from_this_child",
480 "libtest_dlsym_from_this_grandchild",
481 "libtest_dlsym_from_this",
482 "libtest_dlsym_weak_func",
483 "libtest_dt_runpath_d",
484 "libtest_empty",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700485 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700486 "libtest_init_fini_order_child",
487 "libtest_init_fini_order_grand_child",
488 "libtest_init_fini_order_root2",
489 "libtest_init_fini_order_root",
490 "libtest_nodelete_1",
491 "libtest_nodelete_2",
492 "libtest_nodelete_dt_flags_1",
493 "libtest_pthread_atfork",
494 "libtest_relo_check_dt_needed_order_1",
495 "libtest_relo_check_dt_needed_order_2",
496 "libtest_relo_check_dt_needed_order",
497 "libtest_simple",
498 "libtest_two_parents_child",
499 "libtest_two_parents_parent1",
500 "libtest_two_parents_parent2",
501 "libtest_versioned_lib",
502 "libtest_versioned_libv1",
503 "libtest_versioned_libv2",
504 "libtest_versioned_otherlib_empty",
505 "libtest_versioned_otherlib",
506 "libtest_versioned_uselibv1",
507 "libtest_versioned_uselibv2_other",
508 "libtest_versioned_uselibv2",
509 "libtest_versioned_uselibv3_other",
510 "libtest_with_dependency_loop_a",
511 "libtest_with_dependency_loop_b",
512 "libtest_with_dependency_loop_c",
513 "libtest_with_dependency_loop",
514 "libtest_with_dependency",
515 "libtest_invalid-empty_shdr_table.so",
516 "libtest_invalid-rw_load_segment.so",
517 "libtest_invalid-unaligned_shdr_offset.so",
518 "libtest_invalid-zero_shdr_table_content.so",
519 "libtest_invalid-zero_shdr_table_offset.so",
520 "libtest_invalid-zero_shentsize.so",
521 "libtest_invalid-zero_shstrndx.so",
522 "libtest_invalid-textrels.so",
523 "libtest_invalid-textrels2.so",
524 "preinit_getauxval_test_helper",
525 "preinit_syscall_test_helper",
526 "libnstest_private_external",
527 "libnstest_dlopened",
528 "libnstest_private",
529 "libnstest_root_not_isolated",
530 "libnstest_root",
531 "libnstest_public",
532 "libnstest_public_internal",
533 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700534}
535
Colin Cross2722ebb2016-07-11 16:20:06 -0700536// -----------------------------------------------------------------------------
537// Tests for the device linked against bionic's static library. Run with:
538// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
539// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
540// -----------------------------------------------------------------------------
541cc_test {
542 name: "bionic-unit-tests-static",
543 defaults: ["bionic_tests_defaults"],
544 host_supported: false,
545
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800546 srcs: [
547 "gtest_preinit_debuggerd.cpp",
548 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700549 whole_static_libs: [
550 "libBionicTests",
551 "libBionicGtestMain",
552 ],
553
554 static_libs: [
555 "libm",
556 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700557 "libdl",
558 "libtinyxml2",
559 "liblog",
560 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700561 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700562 ],
563
564 static_executable: true,
565 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700566}
567
568// -----------------------------------------------------------------------------
569// Tests to run on the host and linked against glibc. Run with:
570// cd bionic/tests; mm bionic-unit-tests-glibc-run
571// -----------------------------------------------------------------------------
572
573cc_test_host {
574 name: "bionic-unit-tests-glibc",
575 defaults: ["bionic_tests_defaults"],
576
577 srcs: [
578 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700579 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700580 "dlfcn_test.cpp",
581 "dl_test.cpp",
582 "pthread_dlfcn_test.cpp",
583 ],
584
585 shared_libs: [
586 "libdl_preempt_test_1",
587 "libdl_preempt_test_2",
588
589 "libdl_test_df_1_global",
590 ],
591
592 whole_static_libs: [
593 "libBionicStandardTests",
594 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700595 "libfortify1-tests-clang",
596 "libfortify2-tests-clang",
597 ],
598
599 static_libs: [
600 "libbase",
601 "liblog",
602 "libcutils",
603 ],
604
605 host_ldlibs: [
606 "-lresolv",
607 "-lrt",
608 "-ldl",
609 "-lutil",
610 ],
611
612 include_dirs: ["bionic/libc"],
613
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800614 ldflags: [
615 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
616 "-Wl,--export-dynamic",
617 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700618
619 sanitize: {
620 never: false,
621 },
Jiyong Park02586a22017-05-20 01:01:24 +0900622
623 product_variables: {
624 debuggable: {
625 cppflags: ["-DUSE_LD_CONFIG_FILE"],
626 },
627 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700628}
629
630subdirs = ["libs"]