blob: c045c1ec522a8510dfdf37961c649b9844fb847d [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",
99 "regex_test.cpp",
100 "resolv_test.cpp",
101 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700102 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700103 "search_test.cpp",
104 "semaphore_test.cpp",
105 "setjmp_test.cpp",
106 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700107 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700108 "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",
Elliott Hughes8465e962017-09-27 16:33:35 -0700135 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700136 "sys_resource_test.cpp",
137 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700138 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700139 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700140 "sys_shm_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700141 "sys_socket_test.cpp",
142 "sys_stat_test.cpp",
143 "sys_statvfs_test.cpp",
144 "sys_syscall_test.cpp",
145 "sys_sysinfo_test.cpp",
146 "sys_sysmacros_test.cpp",
147 "sys_time_test.cpp",
148 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700149 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700150 "sys_types_test.cpp",
151 "sys_uio_test.cpp",
152 "sys_vfs_test.cpp",
153 "sys_xattr_test.cpp",
154 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000155 "system_properties_test2.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700156 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700157 "time_test.cpp",
158 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700159 "unistd_nofortify_test.cpp",
160 "unistd_test.cpp",
161 "utmp_test.cpp",
162 "wchar_test.cpp",
163 "wctype_test.cpp",
164 ],
165
166 include_dirs: [
167 "bionic/libc",
168 "external/tinyxml2",
169 ],
170
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700171 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700172 bionic: {
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700173 whole_static_libs: ["libasync_safe"],
174 },
175 },
176
Dan Willemsen41567702016-08-31 16:35:01 -0700177 static_libs: [
178 "libtinyxml2",
179 "liblog",
180 "libbase",
181 ],
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: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700196 "-U_FORTIFY_SOURCE",
197 ],
198 srcs: ["fortify_test_main.cpp"],
199 target: {
200 host: {
201 clang_cflags: ["-D__clang__"],
202 },
203 },
204}
205
George Burgess IVd9551db2017-08-17 18:51:02 -0700206// If building this fails, then we have both FORTIFY and ASAN enabled, which
207// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
208// enabled, but that's not a reality today.) This is meant to be otherwise
209// unused.
210cc_test_library {
211 name: "fortify_disabled_for_asan",
212 cflags: [
213 "-Werror",
214 "-D_FORTIFY_SOURCE=2",
215 // "sanitize: address" doesn't work on platforms where libasan isn't
216 // enabled. Since the intent is just to build this, we can get away with
217 // passing this flag on its own.
218 "-fsanitize=address",
219 ],
220 // Ignore that we don't have ASAN symbols linked in.
221 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700222 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700223}
224
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700225// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
226// it can confuse these tools pretty easily. If this builds successfully, then
227// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
228// enabled. The library that results from building this is meant to be unused.
229cc_test_library {
230 name: "fortify_disabled_for_tidy",
231 cflags: [
232 "-Werror",
233 "-D_FORTIFY_SOURCE=2",
234 "-D__clang_analyzer__",
235 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700236 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700237}
238
Colin Cross2722ebb2016-07-11 16:20:06 -0700239cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700240 name: "libfortify1-tests-clang",
241 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700242 cflags: [
243 "-D_FORTIFY_SOURCE=1",
244 "-DTEST_NAME=Fortify1_clang"
245 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700246 shared: {
247 enabled: false,
248 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700249}
250
251cc_test_library {
252 name: "libfortify2-tests-clang",
253 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700254 cflags: [
255 "-D_FORTIFY_SOURCE=2",
256 "-DTEST_NAME=Fortify2_clang"
257 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700258 shared: {
259 enabled: false,
260 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700261}
262
263// -----------------------------------------------------------------------------
264// Library of all tests (excluding the dynamic linker tests).
265// -----------------------------------------------------------------------------
266cc_test_library {
267 name: "libBionicTests",
268 defaults: ["bionic_tests_defaults"],
269 whole_static_libs: [
270 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700271 "libfortify1-tests-clang",
272 "libfortify2-tests-clang",
273 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700274 shared: {
275 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700276 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700277}
278
279// -----------------------------------------------------------------------------
280// Library of bionic customized gtest main function, with simplified output format.
281// -----------------------------------------------------------------------------
282cc_test_library {
283 name: "libBionicGtestMain",
284 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700285 srcs: [
286 "gtest_main.cpp",
287 "gtest_globals.cpp",
288 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800289 whole_static_libs: [
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700290 "libbase",
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800291 "liblog",
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700292 ],
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 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800358 static_libs: [
359 "libbase",
360 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700361 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700362 shared: {
363 enabled: false,
364 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700365}
366
367// -----------------------------------------------------------------------------
368// Tests for the device using bionic's .so. Run with:
369// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
370// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
371// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
372// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
373// -----------------------------------------------------------------------------
374cc_defaults {
375 name: "bionic_unit_tests_defaults",
376 host_supported: false,
377
378 whole_static_libs: [
379 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700380 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700381 "libBionicGtestMain",
382 ],
383
384 static_libs: [
385 "libtinyxml2",
386 "liblog",
387 "libbase",
388 ],
389
390 srcs: [
391 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700392 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700393 "thread_local_test.cpp",
394 ],
395
396 conlyflags: [
397 "-fexceptions",
398 "-fnon-call-exceptions",
399 ],
400
401 ldflags: ["-Wl,--export-dynamic"],
402
403 include_dirs: ["bionic/libc"],
404
Yabin Cui1f553ea2017-01-13 12:31:59 -0800405 stl: "libc++_static",
406
Colin Cross2722ebb2016-07-11 16:20:06 -0700407 target: {
408 android: {
409 shared_libs: [
410 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700411 "libdl_preempt_test_1",
412 "libdl_preempt_test_2",
413 "libdl_test_df_1_global",
414 ],
415 static_libs: [
416 // The order of these libraries matters, do not shuffle them.
417 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700418 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700419 "libziparchive",
420 "libz",
421 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800422 "libLLVMObject",
423 "libLLVMBitReader",
424 "libLLVMMC",
425 "libLLVMMCParser",
426 "libLLVMCore",
427 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700428 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700429 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700430 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700431 "-Wl,--enable-new-dtags",
432 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700433 },
434 }
435}
436
437cc_test {
438 name: "bionic-unit-tests",
439 defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800440
441 target: {
442 android: {
443 shared_libs: ["libicuuc"],
444 },
445 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700446
447 required: [
448 "cfi_test_helper",
449 "cfi_test_helper2",
450 "libtest_dt_runpath_a",
451 "libtest_dt_runpath_b",
452 "libtest_dt_runpath_c",
453 "libtest_dt_runpath_x",
454 "libatest_simple_zip",
455 "libcfi-test",
456 "libcfi-test-bad",
457 "libdlext_test_different_soname",
458 "libdlext_test_fd",
459 "libdlext_test_norelro",
460 "libdlext_test_runpath_zip_zipaligned",
461 "libdlext_test",
462 "libdlext_test_zip",
463 "libdlext_test_zip_zipaligned",
464 "libdl_preempt_test_1",
465 "libdl_preempt_test_2",
466 "libdl_test_df_1_global",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700467 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700468 "libsysv-hash-table-library",
469 "libtest_atexit",
470 "libtest_check_order_dlsym_1_left",
471 "libtest_check_order_dlsym_2_right",
472 "libtest_check_order_dlsym_3_c",
473 "libtest_check_order_dlsym_a",
474 "libtest_check_order_dlsym_b",
475 "libtest_check_order_dlsym_d",
476 "libtest_check_order_dlsym",
477 "libtest_check_order_reloc_root_1",
478 "libtest_check_order_reloc_root_2",
479 "libtest_check_order_reloc_root",
480 "libtest_check_order_reloc_siblings_1",
481 "libtest_check_order_reloc_siblings_2",
482 "libtest_check_order_reloc_siblings_3",
483 "libtest_check_order_reloc_siblings_a",
484 "libtest_check_order_reloc_siblings_b",
485 "libtest_check_order_reloc_siblings_c_1",
486 "libtest_check_order_reloc_siblings_c_2",
487 "libtest_check_order_reloc_siblings_c",
488 "libtest_check_order_reloc_siblings_d",
489 "libtest_check_order_reloc_siblings_e",
490 "libtest_check_order_reloc_siblings_f",
491 "libtest_check_order_reloc_siblings",
492 "libtest_check_rtld_next_from_library",
493 "libtest_dlopen_from_ctor_main",
494 "libtest_dlopen_from_ctor",
495 "libtest_dlopen_weak_undefined_func",
496 "libtest_dlsym_df_1_global",
497 "libtest_dlsym_from_this_child",
498 "libtest_dlsym_from_this_grandchild",
499 "libtest_dlsym_from_this",
500 "libtest_dlsym_weak_func",
501 "libtest_dt_runpath_d",
502 "libtest_empty",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700503 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700504 "libtest_init_fini_order_child",
505 "libtest_init_fini_order_grand_child",
506 "libtest_init_fini_order_root2",
507 "libtest_init_fini_order_root",
508 "libtest_nodelete_1",
509 "libtest_nodelete_2",
510 "libtest_nodelete_dt_flags_1",
511 "libtest_pthread_atfork",
512 "libtest_relo_check_dt_needed_order_1",
513 "libtest_relo_check_dt_needed_order_2",
514 "libtest_relo_check_dt_needed_order",
515 "libtest_simple",
516 "libtest_two_parents_child",
517 "libtest_two_parents_parent1",
518 "libtest_two_parents_parent2",
519 "libtest_versioned_lib",
520 "libtest_versioned_libv1",
521 "libtest_versioned_libv2",
522 "libtest_versioned_otherlib_empty",
523 "libtest_versioned_otherlib",
524 "libtest_versioned_uselibv1",
525 "libtest_versioned_uselibv2_other",
526 "libtest_versioned_uselibv2",
527 "libtest_versioned_uselibv3_other",
528 "libtest_with_dependency_loop_a",
529 "libtest_with_dependency_loop_b",
530 "libtest_with_dependency_loop_c",
531 "libtest_with_dependency_loop",
532 "libtest_with_dependency",
533 "libtest_invalid-empty_shdr_table.so",
534 "libtest_invalid-rw_load_segment.so",
535 "libtest_invalid-unaligned_shdr_offset.so",
536 "libtest_invalid-zero_shdr_table_content.so",
537 "libtest_invalid-zero_shdr_table_offset.so",
538 "libtest_invalid-zero_shentsize.so",
539 "libtest_invalid-zero_shstrndx.so",
540 "libtest_invalid-textrels.so",
541 "libtest_invalid-textrels2.so",
542 "preinit_getauxval_test_helper",
543 "preinit_syscall_test_helper",
544 "libnstest_private_external",
545 "libnstest_dlopened",
546 "libnstest_private",
547 "libnstest_root_not_isolated",
548 "libnstest_root",
549 "libnstest_public",
550 "libnstest_public_internal",
551 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700552}
553
Colin Cross2722ebb2016-07-11 16:20:06 -0700554// -----------------------------------------------------------------------------
555// Tests for the device linked against bionic's static library. Run with:
556// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
557// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
558// -----------------------------------------------------------------------------
559cc_test {
560 name: "bionic-unit-tests-static",
561 defaults: ["bionic_tests_defaults"],
562 host_supported: false,
563
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800564 srcs: [
565 "gtest_preinit_debuggerd.cpp",
566 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700567 whole_static_libs: [
568 "libBionicTests",
569 "libBionicGtestMain",
570 ],
571
572 static_libs: [
573 "libm",
574 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700575 "libdl",
576 "libtinyxml2",
577 "liblog",
578 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700579 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700580 ],
581
582 static_executable: true,
583 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700584}
585
586// -----------------------------------------------------------------------------
587// Tests to run on the host and linked against glibc. Run with:
588// cd bionic/tests; mm bionic-unit-tests-glibc-run
589// -----------------------------------------------------------------------------
590
591cc_test_host {
592 name: "bionic-unit-tests-glibc",
593 defaults: ["bionic_tests_defaults"],
594
595 srcs: [
596 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700597 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700598 "dlfcn_test.cpp",
599 "dl_test.cpp",
600 "pthread_dlfcn_test.cpp",
601 ],
602
603 shared_libs: [
604 "libdl_preempt_test_1",
605 "libdl_preempt_test_2",
606
607 "libdl_test_df_1_global",
608 ],
609
610 whole_static_libs: [
611 "libBionicStandardTests",
612 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700613 "libfortify1-tests-clang",
614 "libfortify2-tests-clang",
615 ],
616
617 static_libs: [
618 "libbase",
619 "liblog",
620 "libcutils",
621 ],
622
623 host_ldlibs: [
624 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700625 "-lutil",
626 ],
627
628 include_dirs: ["bionic/libc"],
629
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800630 ldflags: [
631 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
632 "-Wl,--export-dynamic",
633 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700634
635 sanitize: {
636 never: false,
637 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700638
639 target: {
640 linux_bionic: {
641 enabled: false,
642 },
643 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700644}
645
646subdirs = ["libs"]