blob: 5483b6a7df5ecff4f55b3471ac1e42821798e7fc [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",
Tom Cherry6034ef82018-02-02 16:10:07 -080078 "grp_pwd_file_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -070079 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070080 "ifaddrs_test.cpp",
81 "inttypes_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070082 "iso646_test.c",
Elliott Hughesfc8e6882016-11-18 16:27:29 -080083 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -070084 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070085 "libgen_basename_test.cpp",
86 "libgen_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070087 "limits_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -070088 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070089 "locale_test.cpp",
90 "malloc_test.cpp",
91 "math_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070092 "math_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070093 "mntent_test.cpp",
94 "netdb_test.cpp",
95 "net_if_test.cpp",
96 "netinet_ether_test.cpp",
97 "netinet_in_test.cpp",
98 "netinet_udp_test.cpp",
99 "nl_types_test.cpp",
100 "pthread_test.cpp",
101 "pty_test.cpp",
102 "regex_test.cpp",
103 "resolv_test.cpp",
104 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700105 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700106 "search_test.cpp",
107 "semaphore_test.cpp",
108 "setjmp_test.cpp",
109 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700110 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700111 "stack_protector_test.cpp",
112 "stack_protector_test_helper.cpp",
113 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700114 "stdalign_test.cpp",
115 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700116 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700117 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700118 "stdint_test.cpp",
119 "stdio_nofortify_test.cpp",
120 "stdio_test.cpp",
121 "stdio_ext_test.cpp",
122 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700123 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700124 "string_nofortify_test.cpp",
125 "string_test.cpp",
126 "string_posix_strerror_r_test.cpp",
127 "strings_nofortify_test.cpp",
128 "strings_test.cpp",
129 "sstream_test.cpp",
130 "sys_epoll_test.cpp",
131 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700132 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700133 "sys_personality_test.cpp",
134 "sys_prctl_test.cpp",
135 "sys_procfs_test.cpp",
136 "sys_ptrace_test.cpp",
137 "sys_quota_test.cpp",
Elliott Hughes8465e962017-09-27 16:33:35 -0700138 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700139 "sys_resource_test.cpp",
140 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700141 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700142 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700143 "sys_shm_test.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -0800144 "sys_signalfd_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700145 "sys_socket_test.cpp",
146 "sys_stat_test.cpp",
147 "sys_statvfs_test.cpp",
148 "sys_syscall_test.cpp",
149 "sys_sysinfo_test.cpp",
150 "sys_sysmacros_test.cpp",
151 "sys_time_test.cpp",
152 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700153 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700154 "sys_types_test.cpp",
155 "sys_uio_test.cpp",
156 "sys_vfs_test.cpp",
157 "sys_xattr_test.cpp",
158 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000159 "system_properties_test2.cpp",
Elliott Hughes5da96462017-12-14 09:43:59 -0800160 "termios_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700161 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700162 "time_test.cpp",
163 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700164 "unistd_nofortify_test.cpp",
165 "unistd_test.cpp",
166 "utmp_test.cpp",
167 "wchar_test.cpp",
168 "wctype_test.cpp",
169 ],
170
171 include_dirs: [
172 "bionic/libc",
173 "external/tinyxml2",
174 ],
175
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700176 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700177 bionic: {
Tom Cherrye275d6d2017-12-11 23:31:33 -0800178 whole_static_libs: [
179 "libasync_safe",
180 "libsystemproperties",
181 ],
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700182 },
183 },
184
Dan Willemsen41567702016-08-31 16:35:01 -0700185 static_libs: [
186 "libtinyxml2",
187 "liblog",
188 "libbase",
189 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700190 shared: {
191 enabled: false,
192 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000193
194 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700195}
196
197// -----------------------------------------------------------------------------
198// Fortify tests.
199// -----------------------------------------------------------------------------
200
201cc_defaults {
202 name: "bionic_fortify_tests_defaults",
203 cflags: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700204 "-U_FORTIFY_SOURCE",
205 ],
206 srcs: ["fortify_test_main.cpp"],
207 target: {
208 host: {
209 clang_cflags: ["-D__clang__"],
210 },
211 },
212}
213
George Burgess IVd9551db2017-08-17 18:51:02 -0700214// If building this fails, then we have both FORTIFY and ASAN enabled, which
215// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
216// enabled, but that's not a reality today.) This is meant to be otherwise
217// unused.
218cc_test_library {
219 name: "fortify_disabled_for_asan",
220 cflags: [
221 "-Werror",
222 "-D_FORTIFY_SOURCE=2",
223 // "sanitize: address" doesn't work on platforms where libasan isn't
224 // enabled. Since the intent is just to build this, we can get away with
225 // passing this flag on its own.
226 "-fsanitize=address",
227 ],
228 // Ignore that we don't have ASAN symbols linked in.
229 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700230 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700231}
232
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700233// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
234// it can confuse these tools pretty easily. If this builds successfully, then
235// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
236// enabled. The library that results from building this is meant to be unused.
237cc_test_library {
238 name: "fortify_disabled_for_tidy",
239 cflags: [
240 "-Werror",
241 "-D_FORTIFY_SOURCE=2",
242 "-D__clang_analyzer__",
243 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700244 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700245}
246
Colin Cross2722ebb2016-07-11 16:20:06 -0700247cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700248 name: "libfortify1-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800249 defaults: [
250 "bionic_fortify_tests_defaults",
251 "bionic_tests_defaults",
252 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700253 cflags: [
254 "-D_FORTIFY_SOURCE=1",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800255 "-DTEST_NAME=Fortify1_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700256 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700257 shared: {
258 enabled: false,
259 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700260}
261
262cc_test_library {
263 name: "libfortify2-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800264 defaults: [
265 "bionic_fortify_tests_defaults",
266 "bionic_tests_defaults",
267 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700268 cflags: [
269 "-D_FORTIFY_SOURCE=2",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800270 "-DTEST_NAME=Fortify2_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700271 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700272 shared: {
273 enabled: false,
274 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700275}
276
277// -----------------------------------------------------------------------------
278// Library of all tests (excluding the dynamic linker tests).
279// -----------------------------------------------------------------------------
280cc_test_library {
281 name: "libBionicTests",
282 defaults: ["bionic_tests_defaults"],
283 whole_static_libs: [
284 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700285 "libfortify1-tests-clang",
286 "libfortify2-tests-clang",
287 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700288 shared: {
289 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700290 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700291}
292
293// -----------------------------------------------------------------------------
294// Library of bionic customized gtest main function, with simplified output format.
295// -----------------------------------------------------------------------------
296cc_test_library {
297 name: "libBionicGtestMain",
298 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700299 srcs: [
300 "gtest_main.cpp",
301 "gtest_globals.cpp",
302 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800303 whole_static_libs: [
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700304 "libbase",
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800305 "liblog",
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700306 ],
307 include_dirs: [
308 "bionic/libc",
309 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700310 target: {
311 darwin: {
312 enabled: true,
313 },
314 },
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700315 shared: {
316 enabled: false,
317 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700318}
319
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700320cc_test_library {
321 name: "libBionicLoaderTests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800322 defaults: [
323 "bionic_tests_defaults",
324 "llvm-defaults",
325 ],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700326 srcs: [
327 "atexit_test.cpp",
328 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700329 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700330 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700331 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700332 "pthread_dlfcn_test.cpp",
333 ],
334 static_libs: [
335 "libbase",
336 ],
337 include_dirs: [
338 "bionic/libc",
339 ],
340 shared: {
341 enabled: false,
342 },
343 target: {
344 android: {
345 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700346 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700347 "dlext_test.cpp",
348 "libdl_test.cpp",
349 ],
350 static_libs: [
351 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700352 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800353 "libLLVMObject",
354 "libLLVMBitReader",
355 "libLLVMMC",
356 "libLLVMMCParser",
357 "libLLVMCore",
358 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700359 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800360 },
Jiyong Park02586a22017-05-20 01:01:24 +0900361 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700362}
363
Colin Cross2722ebb2016-07-11 16:20:06 -0700364// -----------------------------------------------------------------------------
365// Library of bionic customized gtest main function, with normal gtest output format,
366// which is needed by bionic cts test.
367// -----------------------------------------------------------------------------
368cc_test_library {
369 name: "libBionicCtsGtestMain",
370 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700371 srcs: [
372 "gtest_main.cpp",
373 "gtest_globals_cts.cpp",
374 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800375 static_libs: [
376 "libbase",
377 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700378 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700379 shared: {
380 enabled: false,
381 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700382}
383
384// -----------------------------------------------------------------------------
385// Tests for the device using bionic's .so. Run with:
386// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
387// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
388// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
389// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
390// -----------------------------------------------------------------------------
391cc_defaults {
392 name: "bionic_unit_tests_defaults",
393 host_supported: false,
394
395 whole_static_libs: [
396 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700397 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700398 "libBionicGtestMain",
399 ],
400
401 static_libs: [
402 "libtinyxml2",
403 "liblog",
404 "libbase",
405 ],
406
407 srcs: [
408 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700409 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700410 "thread_local_test.cpp",
411 ],
412
413 conlyflags: [
414 "-fexceptions",
415 "-fnon-call-exceptions",
416 ],
417
418 ldflags: ["-Wl,--export-dynamic"],
419
420 include_dirs: ["bionic/libc"],
421
Yabin Cui1f553ea2017-01-13 12:31:59 -0800422 stl: "libc++_static",
423
Colin Cross2722ebb2016-07-11 16:20:06 -0700424 target: {
425 android: {
426 shared_libs: [
dimitry321476a2018-01-29 15:32:37 +0100427 "ld-android",
Colin Cross2722ebb2016-07-11 16:20:06 -0700428 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700429 "libdl_preempt_test_1",
430 "libdl_preempt_test_2",
431 "libdl_test_df_1_global",
432 ],
433 static_libs: [
434 // The order of these libraries matters, do not shuffle them.
435 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700436 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700437 "libziparchive",
438 "libz",
439 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800440 "libLLVMObject",
441 "libLLVMBitReader",
442 "libLLVMMC",
443 "libLLVMMCParser",
444 "libLLVMCore",
445 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700446 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700447 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700448 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700449 "-Wl,--enable-new-dtags",
450 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700451 },
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800452 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700453}
454
455cc_test {
456 name: "bionic-unit-tests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800457 defaults: [
458 "bionic_unit_tests_defaults",
459 "bionic_tests_defaults",
460 ],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800461
462 target: {
463 android: {
464 shared_libs: ["libicuuc"],
465 },
466 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700467
468 required: [
469 "cfi_test_helper",
470 "cfi_test_helper2",
471 "libtest_dt_runpath_a",
472 "libtest_dt_runpath_b",
473 "libtest_dt_runpath_c",
474 "libtest_dt_runpath_x",
475 "libatest_simple_zip",
476 "libcfi-test",
477 "libcfi-test-bad",
478 "libdlext_test_different_soname",
479 "libdlext_test_fd",
480 "libdlext_test_norelro",
481 "libdlext_test_runpath_zip_zipaligned",
482 "libdlext_test",
483 "libdlext_test_zip",
484 "libdlext_test_zip_zipaligned",
485 "libdl_preempt_test_1",
486 "libdl_preempt_test_2",
487 "libdl_test_df_1_global",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700488 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700489 "libsysv-hash-table-library",
490 "libtest_atexit",
491 "libtest_check_order_dlsym_1_left",
492 "libtest_check_order_dlsym_2_right",
493 "libtest_check_order_dlsym_3_c",
494 "libtest_check_order_dlsym_a",
495 "libtest_check_order_dlsym_b",
496 "libtest_check_order_dlsym_d",
497 "libtest_check_order_dlsym",
498 "libtest_check_order_reloc_root_1",
499 "libtest_check_order_reloc_root_2",
500 "libtest_check_order_reloc_root",
501 "libtest_check_order_reloc_siblings_1",
502 "libtest_check_order_reloc_siblings_2",
503 "libtest_check_order_reloc_siblings_3",
504 "libtest_check_order_reloc_siblings_a",
505 "libtest_check_order_reloc_siblings_b",
506 "libtest_check_order_reloc_siblings_c_1",
507 "libtest_check_order_reloc_siblings_c_2",
508 "libtest_check_order_reloc_siblings_c",
509 "libtest_check_order_reloc_siblings_d",
510 "libtest_check_order_reloc_siblings_e",
511 "libtest_check_order_reloc_siblings_f",
512 "libtest_check_order_reloc_siblings",
513 "libtest_check_rtld_next_from_library",
514 "libtest_dlopen_from_ctor_main",
515 "libtest_dlopen_from_ctor",
516 "libtest_dlopen_weak_undefined_func",
517 "libtest_dlsym_df_1_global",
518 "libtest_dlsym_from_this_child",
519 "libtest_dlsym_from_this_grandchild",
520 "libtest_dlsym_from_this",
521 "libtest_dlsym_weak_func",
522 "libtest_dt_runpath_d",
523 "libtest_empty",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700524 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700525 "libtest_init_fini_order_child",
526 "libtest_init_fini_order_grand_child",
527 "libtest_init_fini_order_root2",
528 "libtest_init_fini_order_root",
529 "libtest_nodelete_1",
530 "libtest_nodelete_2",
531 "libtest_nodelete_dt_flags_1",
532 "libtest_pthread_atfork",
533 "libtest_relo_check_dt_needed_order_1",
534 "libtest_relo_check_dt_needed_order_2",
535 "libtest_relo_check_dt_needed_order",
536 "libtest_simple",
537 "libtest_two_parents_child",
538 "libtest_two_parents_parent1",
539 "libtest_two_parents_parent2",
540 "libtest_versioned_lib",
541 "libtest_versioned_libv1",
542 "libtest_versioned_libv2",
543 "libtest_versioned_otherlib_empty",
544 "libtest_versioned_otherlib",
545 "libtest_versioned_uselibv1",
546 "libtest_versioned_uselibv2_other",
547 "libtest_versioned_uselibv2",
548 "libtest_versioned_uselibv3_other",
549 "libtest_with_dependency_loop_a",
550 "libtest_with_dependency_loop_b",
551 "libtest_with_dependency_loop_c",
552 "libtest_with_dependency_loop",
553 "libtest_with_dependency",
554 "libtest_invalid-empty_shdr_table.so",
555 "libtest_invalid-rw_load_segment.so",
556 "libtest_invalid-unaligned_shdr_offset.so",
557 "libtest_invalid-zero_shdr_table_content.so",
558 "libtest_invalid-zero_shdr_table_offset.so",
559 "libtest_invalid-zero_shentsize.so",
560 "libtest_invalid-zero_shstrndx.so",
561 "libtest_invalid-textrels.so",
562 "libtest_invalid-textrels2.so",
563 "preinit_getauxval_test_helper",
564 "preinit_syscall_test_helper",
565 "libnstest_private_external",
566 "libnstest_dlopened",
567 "libnstest_private",
568 "libnstest_root_not_isolated",
569 "libnstest_root",
570 "libnstest_public",
571 "libnstest_public_internal",
Logan Chien9ee45912018-01-18 12:05:09 +0800572 "libnstest_ns_a_public1",
573 "libnstest_ns_a_public1_internal",
574 "libnstest_ns_b_public2",
575 "libnstest_ns_b_public3",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700576 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700577}
578
Colin Cross2722ebb2016-07-11 16:20:06 -0700579// -----------------------------------------------------------------------------
580// Tests for the device linked against bionic's static library. Run with:
581// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
582// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
583// -----------------------------------------------------------------------------
584cc_test {
585 name: "bionic-unit-tests-static",
586 defaults: ["bionic_tests_defaults"],
587 host_supported: false,
588
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800589 srcs: [
590 "gtest_preinit_debuggerd.cpp",
591 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700592 whole_static_libs: [
593 "libBionicTests",
594 "libBionicGtestMain",
595 ],
596
597 static_libs: [
598 "libm",
599 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700600 "libdl",
601 "libtinyxml2",
602 "liblog",
603 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700604 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700605 ],
606
607 static_executable: true,
608 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700609}
610
611// -----------------------------------------------------------------------------
612// Tests to run on the host and linked against glibc. Run with:
613// cd bionic/tests; mm bionic-unit-tests-glibc-run
614// -----------------------------------------------------------------------------
615
616cc_test_host {
617 name: "bionic-unit-tests-glibc",
618 defaults: ["bionic_tests_defaults"],
619
620 srcs: [
621 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700622 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700623 "dlfcn_test.cpp",
624 "dl_test.cpp",
625 "pthread_dlfcn_test.cpp",
626 ],
627
628 shared_libs: [
629 "libdl_preempt_test_1",
630 "libdl_preempt_test_2",
631
632 "libdl_test_df_1_global",
633 ],
634
635 whole_static_libs: [
636 "libBionicStandardTests",
637 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700638 "libfortify1-tests-clang",
639 "libfortify2-tests-clang",
640 ],
641
642 static_libs: [
643 "libbase",
644 "liblog",
645 "libcutils",
646 ],
647
648 host_ldlibs: [
649 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700650 "-lutil",
651 ],
652
653 include_dirs: ["bionic/libc"],
654
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800655 ldflags: [
656 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
657 "-Wl,--export-dynamic",
658 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700659
660 sanitize: {
661 never: false,
662 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700663
664 target: {
665 linux_bionic: {
666 enabled: false,
667 },
668 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700669}
670
Elliott Hughes21b56eb2017-10-20 17:57:17 -0700671subdirs = ["*"]