blob: 51a721a2e9f1be28733f0f5d21fdd8b74d5442a0 [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: [
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030054 "alloca_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070055 "arpa_inet_test.cpp",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070056 "async_safe_test.cpp",
Elliott Hughesf6495c72016-07-25 09:20:57 -070057 "assert_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070058 "buffer_tests.cpp",
59 "bug_26110743_test.cpp",
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030060 "byteswap_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070061 "complex_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070062 "complex_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070063 "ctype_test.cpp",
64 "dirent_test.cpp",
Elliott Hughesd390df12017-04-30 22:56:10 -070065 "elf_test.cpp",
Elliott Hughesba267f42017-02-24 16:19:53 -080066 "endian_test.cpp",
Elliott Hughese452cb12017-06-13 14:43:53 -070067 "errno_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070068 "error_test.cpp",
69 "eventfd_test.cpp",
70 "fcntl_test.cpp",
71 "fenv_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070072 "float_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070073 "ftw_test.cpp",
74 "getauxval_test.cpp",
75 "getcwd_test.cpp",
Elliott Hughesf1c568d2017-09-26 17:09:07 -070076 "glob_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070077 "grp_pwd_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -070078 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070079 "ifaddrs_test.cpp",
80 "inttypes_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070081 "iso646_test.c",
Elliott Hughesfc8e6882016-11-18 16:27:29 -080082 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -070083 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070084 "libgen_basename_test.cpp",
85 "libgen_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070086 "limits_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -070087 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070088 "locale_test.cpp",
89 "malloc_test.cpp",
90 "math_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070091 "math_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070092 "mntent_test.cpp",
93 "netdb_test.cpp",
94 "net_if_test.cpp",
95 "netinet_ether_test.cpp",
96 "netinet_in_test.cpp",
97 "netinet_udp_test.cpp",
98 "nl_types_test.cpp",
99 "pthread_test.cpp",
100 "pty_test.cpp",
101 "regex_test.cpp",
102 "resolv_test.cpp",
103 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700104 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700105 "search_test.cpp",
106 "semaphore_test.cpp",
107 "setjmp_test.cpp",
108 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700109 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700110 "stack_protector_test.cpp",
111 "stack_protector_test_helper.cpp",
112 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700113 "stdalign_test.cpp",
114 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700115 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700116 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700117 "stdint_test.cpp",
118 "stdio_nofortify_test.cpp",
119 "stdio_test.cpp",
120 "stdio_ext_test.cpp",
121 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700122 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700123 "string_nofortify_test.cpp",
124 "string_test.cpp",
125 "string_posix_strerror_r_test.cpp",
126 "strings_nofortify_test.cpp",
127 "strings_test.cpp",
128 "sstream_test.cpp",
129 "sys_epoll_test.cpp",
130 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700131 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700132 "sys_personality_test.cpp",
133 "sys_prctl_test.cpp",
134 "sys_procfs_test.cpp",
135 "sys_ptrace_test.cpp",
136 "sys_quota_test.cpp",
Elliott Hughes8465e962017-09-27 16:33:35 -0700137 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700138 "sys_resource_test.cpp",
139 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700140 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700141 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700142 "sys_shm_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700143 "sys_socket_test.cpp",
144 "sys_stat_test.cpp",
145 "sys_statvfs_test.cpp",
146 "sys_syscall_test.cpp",
147 "sys_sysinfo_test.cpp",
148 "sys_sysmacros_test.cpp",
149 "sys_time_test.cpp",
150 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700151 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700152 "sys_types_test.cpp",
153 "sys_uio_test.cpp",
154 "sys_vfs_test.cpp",
155 "sys_xattr_test.cpp",
156 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000157 "system_properties_test2.cpp",
Elliott Hughes5da96462017-12-14 09:43:59 -0800158 "termios_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700159 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700160 "time_test.cpp",
161 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700162 "unistd_nofortify_test.cpp",
163 "unistd_test.cpp",
164 "utmp_test.cpp",
165 "wchar_test.cpp",
166 "wctype_test.cpp",
167 ],
168
169 include_dirs: [
170 "bionic/libc",
171 "external/tinyxml2",
172 ],
173
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700174 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700175 bionic: {
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700176 whole_static_libs: ["libasync_safe"],
177 },
178 },
179
Dan Willemsen41567702016-08-31 16:35:01 -0700180 static_libs: [
181 "libtinyxml2",
182 "liblog",
183 "libbase",
184 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700185 shared: {
186 enabled: false,
187 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000188
189 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700190}
191
192// -----------------------------------------------------------------------------
193// Fortify tests.
194// -----------------------------------------------------------------------------
195
196cc_defaults {
197 name: "bionic_fortify_tests_defaults",
198 cflags: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700199 "-U_FORTIFY_SOURCE",
200 ],
201 srcs: ["fortify_test_main.cpp"],
202 target: {
203 host: {
204 clang_cflags: ["-D__clang__"],
205 },
206 },
207}
208
George Burgess IVd9551db2017-08-17 18:51:02 -0700209// If building this fails, then we have both FORTIFY and ASAN enabled, which
210// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
211// enabled, but that's not a reality today.) This is meant to be otherwise
212// unused.
213cc_test_library {
214 name: "fortify_disabled_for_asan",
215 cflags: [
216 "-Werror",
217 "-D_FORTIFY_SOURCE=2",
218 // "sanitize: address" doesn't work on platforms where libasan isn't
219 // enabled. Since the intent is just to build this, we can get away with
220 // passing this flag on its own.
221 "-fsanitize=address",
222 ],
223 // Ignore that we don't have ASAN symbols linked in.
224 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700225 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700226}
227
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700228// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
229// it can confuse these tools pretty easily. If this builds successfully, then
230// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
231// enabled. The library that results from building this is meant to be unused.
232cc_test_library {
233 name: "fortify_disabled_for_tidy",
234 cflags: [
235 "-Werror",
236 "-D_FORTIFY_SOURCE=2",
237 "-D__clang_analyzer__",
238 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700239 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700240}
241
Colin Cross2722ebb2016-07-11 16:20:06 -0700242cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700243 name: "libfortify1-tests-clang",
244 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700245 cflags: [
246 "-D_FORTIFY_SOURCE=1",
247 "-DTEST_NAME=Fortify1_clang"
248 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700249 shared: {
250 enabled: false,
251 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700252}
253
254cc_test_library {
255 name: "libfortify2-tests-clang",
256 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700257 cflags: [
258 "-D_FORTIFY_SOURCE=2",
259 "-DTEST_NAME=Fortify2_clang"
260 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700261 shared: {
262 enabled: false,
263 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700264}
265
266// -----------------------------------------------------------------------------
267// Library of all tests (excluding the dynamic linker tests).
268// -----------------------------------------------------------------------------
269cc_test_library {
270 name: "libBionicTests",
271 defaults: ["bionic_tests_defaults"],
272 whole_static_libs: [
273 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700274 "libfortify1-tests-clang",
275 "libfortify2-tests-clang",
276 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700277 shared: {
278 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700279 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700280}
281
282// -----------------------------------------------------------------------------
283// Library of bionic customized gtest main function, with simplified output format.
284// -----------------------------------------------------------------------------
285cc_test_library {
286 name: "libBionicGtestMain",
287 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700288 srcs: [
289 "gtest_main.cpp",
290 "gtest_globals.cpp",
291 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800292 whole_static_libs: [
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700293 "libbase",
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800294 "liblog",
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700295 ],
296 include_dirs: [
297 "bionic/libc",
298 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700299 target: {
300 darwin: {
301 enabled: true,
302 },
303 },
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700304 shared: {
305 enabled: false,
306 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700307}
308
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700309cc_test_library {
310 name: "libBionicLoaderTests",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800311 defaults: ["bionic_tests_defaults", "llvm-defaults"],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700312 srcs: [
313 "atexit_test.cpp",
314 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700315 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700316 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700317 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700318 "pthread_dlfcn_test.cpp",
319 ],
320 static_libs: [
321 "libbase",
322 ],
323 include_dirs: [
324 "bionic/libc",
325 ],
326 shared: {
327 enabled: false,
328 },
329 target: {
330 android: {
331 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700332 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700333 "dlext_test.cpp",
334 "libdl_test.cpp",
335 ],
336 static_libs: [
337 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700338 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800339 "libLLVMObject",
340 "libLLVMBitReader",
341 "libLLVMMC",
342 "libLLVMMCParser",
343 "libLLVMCore",
344 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700345 ],
346 }
Jiyong Park02586a22017-05-20 01:01:24 +0900347 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700348}
349
Colin Cross2722ebb2016-07-11 16:20:06 -0700350// -----------------------------------------------------------------------------
351// Library of bionic customized gtest main function, with normal gtest output format,
352// which is needed by bionic cts test.
353// -----------------------------------------------------------------------------
354cc_test_library {
355 name: "libBionicCtsGtestMain",
356 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700357 srcs: [
358 "gtest_main.cpp",
359 "gtest_globals_cts.cpp",
360 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800361 static_libs: [
362 "libbase",
363 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700364 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700365 shared: {
366 enabled: false,
367 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700368}
369
370// -----------------------------------------------------------------------------
371// Tests for the device using bionic's .so. Run with:
372// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
373// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
374// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
375// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
376// -----------------------------------------------------------------------------
377cc_defaults {
378 name: "bionic_unit_tests_defaults",
379 host_supported: false,
380
381 whole_static_libs: [
382 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700383 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700384 "libBionicGtestMain",
385 ],
386
387 static_libs: [
388 "libtinyxml2",
389 "liblog",
390 "libbase",
391 ],
392
393 srcs: [
394 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700395 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700396 "thread_local_test.cpp",
397 ],
398
399 conlyflags: [
400 "-fexceptions",
401 "-fnon-call-exceptions",
402 ],
403
404 ldflags: ["-Wl,--export-dynamic"],
405
406 include_dirs: ["bionic/libc"],
407
Yabin Cui1f553ea2017-01-13 12:31:59 -0800408 stl: "libc++_static",
409
Colin Cross2722ebb2016-07-11 16:20:06 -0700410 target: {
411 android: {
412 shared_libs: [
413 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700414 "libdl_preempt_test_1",
415 "libdl_preempt_test_2",
416 "libdl_test_df_1_global",
417 ],
418 static_libs: [
419 // The order of these libraries matters, do not shuffle them.
420 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700421 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700422 "libziparchive",
423 "libz",
424 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800425 "libLLVMObject",
426 "libLLVMBitReader",
427 "libLLVMMC",
428 "libLLVMMCParser",
429 "libLLVMCore",
430 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700431 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700432 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700433 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700434 "-Wl,--enable-new-dtags",
435 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700436 },
437 }
438}
439
440cc_test {
441 name: "bionic-unit-tests",
442 defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800443
444 target: {
445 android: {
446 shared_libs: ["libicuuc"],
447 },
448 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700449
450 required: [
451 "cfi_test_helper",
452 "cfi_test_helper2",
453 "libtest_dt_runpath_a",
454 "libtest_dt_runpath_b",
455 "libtest_dt_runpath_c",
456 "libtest_dt_runpath_x",
457 "libatest_simple_zip",
458 "libcfi-test",
459 "libcfi-test-bad",
460 "libdlext_test_different_soname",
461 "libdlext_test_fd",
462 "libdlext_test_norelro",
463 "libdlext_test_runpath_zip_zipaligned",
464 "libdlext_test",
465 "libdlext_test_zip",
466 "libdlext_test_zip_zipaligned",
467 "libdl_preempt_test_1",
468 "libdl_preempt_test_2",
469 "libdl_test_df_1_global",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700470 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700471 "libsysv-hash-table-library",
472 "libtest_atexit",
473 "libtest_check_order_dlsym_1_left",
474 "libtest_check_order_dlsym_2_right",
475 "libtest_check_order_dlsym_3_c",
476 "libtest_check_order_dlsym_a",
477 "libtest_check_order_dlsym_b",
478 "libtest_check_order_dlsym_d",
479 "libtest_check_order_dlsym",
480 "libtest_check_order_reloc_root_1",
481 "libtest_check_order_reloc_root_2",
482 "libtest_check_order_reloc_root",
483 "libtest_check_order_reloc_siblings_1",
484 "libtest_check_order_reloc_siblings_2",
485 "libtest_check_order_reloc_siblings_3",
486 "libtest_check_order_reloc_siblings_a",
487 "libtest_check_order_reloc_siblings_b",
488 "libtest_check_order_reloc_siblings_c_1",
489 "libtest_check_order_reloc_siblings_c_2",
490 "libtest_check_order_reloc_siblings_c",
491 "libtest_check_order_reloc_siblings_d",
492 "libtest_check_order_reloc_siblings_e",
493 "libtest_check_order_reloc_siblings_f",
494 "libtest_check_order_reloc_siblings",
495 "libtest_check_rtld_next_from_library",
496 "libtest_dlopen_from_ctor_main",
497 "libtest_dlopen_from_ctor",
498 "libtest_dlopen_weak_undefined_func",
499 "libtest_dlsym_df_1_global",
500 "libtest_dlsym_from_this_child",
501 "libtest_dlsym_from_this_grandchild",
502 "libtest_dlsym_from_this",
503 "libtest_dlsym_weak_func",
504 "libtest_dt_runpath_d",
505 "libtest_empty",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700506 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700507 "libtest_init_fini_order_child",
508 "libtest_init_fini_order_grand_child",
509 "libtest_init_fini_order_root2",
510 "libtest_init_fini_order_root",
511 "libtest_nodelete_1",
512 "libtest_nodelete_2",
513 "libtest_nodelete_dt_flags_1",
514 "libtest_pthread_atfork",
515 "libtest_relo_check_dt_needed_order_1",
516 "libtest_relo_check_dt_needed_order_2",
517 "libtest_relo_check_dt_needed_order",
518 "libtest_simple",
519 "libtest_two_parents_child",
520 "libtest_two_parents_parent1",
521 "libtest_two_parents_parent2",
522 "libtest_versioned_lib",
523 "libtest_versioned_libv1",
524 "libtest_versioned_libv2",
525 "libtest_versioned_otherlib_empty",
526 "libtest_versioned_otherlib",
527 "libtest_versioned_uselibv1",
528 "libtest_versioned_uselibv2_other",
529 "libtest_versioned_uselibv2",
530 "libtest_versioned_uselibv3_other",
531 "libtest_with_dependency_loop_a",
532 "libtest_with_dependency_loop_b",
533 "libtest_with_dependency_loop_c",
534 "libtest_with_dependency_loop",
535 "libtest_with_dependency",
536 "libtest_invalid-empty_shdr_table.so",
537 "libtest_invalid-rw_load_segment.so",
538 "libtest_invalid-unaligned_shdr_offset.so",
539 "libtest_invalid-zero_shdr_table_content.so",
540 "libtest_invalid-zero_shdr_table_offset.so",
541 "libtest_invalid-zero_shentsize.so",
542 "libtest_invalid-zero_shstrndx.so",
543 "libtest_invalid-textrels.so",
544 "libtest_invalid-textrels2.so",
545 "preinit_getauxval_test_helper",
546 "preinit_syscall_test_helper",
547 "libnstest_private_external",
548 "libnstest_dlopened",
549 "libnstest_private",
550 "libnstest_root_not_isolated",
551 "libnstest_root",
552 "libnstest_public",
553 "libnstest_public_internal",
554 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700555}
556
Colin Cross2722ebb2016-07-11 16:20:06 -0700557// -----------------------------------------------------------------------------
558// Tests for the device linked against bionic's static library. Run with:
559// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
560// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
561// -----------------------------------------------------------------------------
562cc_test {
563 name: "bionic-unit-tests-static",
564 defaults: ["bionic_tests_defaults"],
565 host_supported: false,
566
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800567 srcs: [
568 "gtest_preinit_debuggerd.cpp",
569 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700570 whole_static_libs: [
571 "libBionicTests",
572 "libBionicGtestMain",
573 ],
574
575 static_libs: [
576 "libm",
577 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700578 "libdl",
579 "libtinyxml2",
580 "liblog",
581 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700582 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700583 ],
584
585 static_executable: true,
586 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700587}
588
589// -----------------------------------------------------------------------------
590// Tests to run on the host and linked against glibc. Run with:
591// cd bionic/tests; mm bionic-unit-tests-glibc-run
592// -----------------------------------------------------------------------------
593
594cc_test_host {
595 name: "bionic-unit-tests-glibc",
596 defaults: ["bionic_tests_defaults"],
597
598 srcs: [
599 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700600 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700601 "dlfcn_test.cpp",
602 "dl_test.cpp",
603 "pthread_dlfcn_test.cpp",
604 ],
605
606 shared_libs: [
607 "libdl_preempt_test_1",
608 "libdl_preempt_test_2",
609
610 "libdl_test_df_1_global",
611 ],
612
613 whole_static_libs: [
614 "libBionicStandardTests",
615 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700616 "libfortify1-tests-clang",
617 "libfortify2-tests-clang",
618 ],
619
620 static_libs: [
621 "libbase",
622 "liblog",
623 "libcutils",
624 ],
625
626 host_ldlibs: [
627 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700628 "-lutil",
629 ],
630
631 include_dirs: ["bionic/libc"],
632
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800633 ldflags: [
634 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
635 "-Wl,--export-dynamic",
636 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700637
638 sanitize: {
639 never: false,
640 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700641
642 target: {
643 linux_bionic: {
644 enabled: false,
645 },
646 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700647}
648
Elliott Hughes21b56eb2017-10-20 17:57:17 -0700649subdirs = ["*"]