blob: cb1f6c09c2493a2973d91ea7583f8357195c64fb [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,
Tom Cherry60ddedf2018-02-20 15:40:02 -080020 cpp_std: "experimental",
Colin Cross2722ebb2016-07-11 16:20:06 -070021 target: {
22 darwin: {
23 enabled: false,
24 },
25 },
26 cflags: [
27 "-fstack-protector-all",
28 "-g",
29 "-Wall",
30 "-Wextra",
31 "-Wunused",
32 "-Werror",
33 "-fno-builtin",
34
35 // We want to test deprecated API too.
36 "-Wno-deprecated-declarations",
37
38 // For glibc.
39 "-D__STDC_LIMIT_MACROS",
40 ],
Peter Collingbourneda1bc792018-09-06 22:20:44 -070041 // Make the bionic tests implicitly test bionic's shadow call stack support.
42 arch: {
43 arm64: {
44 cflags: ["-fsanitize=shadow-call-stack"],
45 },
46 },
Colin Cross2722ebb2016-07-11 16:20:06 -070047 stl: "libc++",
48 sanitize: {
49 never: true,
50 },
51}
52
53// -----------------------------------------------------------------------------
54// All standard tests.
55// -----------------------------------------------------------------------------
56
George Burgess IVde45dcb2018-03-16 14:15:01 -070057// Test diagnostics emitted by clang. The library that results is useless; we
58// just want to run '-Xclang -verify', which will fail if the diagnostics don't
59// match up with what the source file says they should be.
60cc_test_library {
61 name: "clang_diagnostic_tests",
62 cflags: [
63 "-Xclang",
64 "-verify",
65 ],
66 srcs: ["sys_ioctl_diag_test.cpp"],
67}
68
Colin Cross2722ebb2016-07-11 16:20:06 -070069cc_test_library {
70 name: "libBionicStandardTests",
71 defaults: ["bionic_tests_defaults"],
72 srcs: [
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030073 "alloca_test.cpp",
Elliott Hughesce934e32018-09-06 13:26:08 -070074 "android_get_device_api_level.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070075 "arpa_inet_test.cpp",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070076 "async_safe_test.cpp",
Elliott Hughesf6495c72016-07-25 09:20:57 -070077 "assert_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070078 "buffer_tests.cpp",
79 "bug_26110743_test.cpp",
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030080 "byteswap_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070081 "complex_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070082 "complex_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070083 "ctype_test.cpp",
84 "dirent_test.cpp",
Elliott Hughesd390df12017-04-30 22:56:10 -070085 "elf_test.cpp",
Elliott Hughesba267f42017-02-24 16:19:53 -080086 "endian_test.cpp",
Elliott Hughese452cb12017-06-13 14:43:53 -070087 "errno_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070088 "error_test.cpp",
89 "eventfd_test.cpp",
90 "fcntl_test.cpp",
Josh Gaof6e5b582018-06-01 15:30:54 -070091 "fdsan_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070092 "fenv_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070093 "float_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070094 "ftw_test.cpp",
95 "getauxval_test.cpp",
96 "getcwd_test.cpp",
Elliott Hughesf1c568d2017-09-26 17:09:07 -070097 "glob_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070098 "grp_pwd_test.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -080099 "grp_pwd_file_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -0700100 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700101 "ifaddrs_test.cpp",
102 "inttypes_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700103 "iso646_test.c",
Elliott Hughesfc8e6882016-11-18 16:27:29 -0800104 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -0700105 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700106 "libgen_basename_test.cpp",
107 "libgen_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700108 "limits_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -0700109 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700110 "locale_test.cpp",
111 "malloc_test.cpp",
112 "math_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -0700113 "math_force_long_double_test.cpp",
Orion Hodson6ba66942018-08-30 11:10:23 +0100114 "membarrier_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700115 "mntent_test.cpp",
116 "netdb_test.cpp",
117 "net_if_test.cpp",
118 "netinet_ether_test.cpp",
119 "netinet_in_test.cpp",
Elliott Hughese5a5eec2018-06-27 12:29:06 -0700120 "netinet_ip_icmp_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700121 "netinet_udp_test.cpp",
122 "nl_types_test.cpp",
Elliott Hugheseab65722018-08-30 12:15:56 -0700123 "poll_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700124 "pthread_test.cpp",
125 "pty_test.cpp",
126 "regex_test.cpp",
127 "resolv_test.cpp",
128 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700129 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700130 "search_test.cpp",
131 "semaphore_test.cpp",
132 "setjmp_test.cpp",
133 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700134 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700135 "stack_protector_test.cpp",
136 "stack_protector_test_helper.cpp",
137 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700138 "stdalign_test.cpp",
139 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700140 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700141 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700142 "stdint_test.cpp",
143 "stdio_nofortify_test.cpp",
144 "stdio_test.cpp",
145 "stdio_ext_test.cpp",
146 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700147 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700148 "string_nofortify_test.cpp",
149 "string_test.cpp",
150 "string_posix_strerror_r_test.cpp",
151 "strings_nofortify_test.cpp",
152 "strings_test.cpp",
153 "sstream_test.cpp",
154 "sys_epoll_test.cpp",
155 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700156 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700157 "sys_personality_test.cpp",
158 "sys_prctl_test.cpp",
159 "sys_procfs_test.cpp",
160 "sys_ptrace_test.cpp",
161 "sys_quota_test.cpp",
Elliott Hughes8465e962017-09-27 16:33:35 -0700162 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700163 "sys_resource_test.cpp",
164 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700165 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700166 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700167 "sys_shm_test.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -0800168 "sys_signalfd_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700169 "sys_socket_test.cpp",
170 "sys_stat_test.cpp",
171 "sys_statvfs_test.cpp",
172 "sys_syscall_test.cpp",
173 "sys_sysinfo_test.cpp",
174 "sys_sysmacros_test.cpp",
175 "sys_time_test.cpp",
176 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700177 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700178 "sys_types_test.cpp",
179 "sys_uio_test.cpp",
Elliott Hughese7d185f2018-06-27 13:30:02 -0700180 "sys_un_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700181 "sys_vfs_test.cpp",
182 "sys_xattr_test.cpp",
183 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000184 "system_properties_test2.cpp",
Elliott Hughes5da96462017-12-14 09:43:59 -0800185 "termios_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700186 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700187 "time_test.cpp",
188 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700189 "unistd_nofortify_test.cpp",
190 "unistd_test.cpp",
191 "utmp_test.cpp",
192 "wchar_test.cpp",
193 "wctype_test.cpp",
194 ],
195
196 include_dirs: [
197 "bionic/libc",
198 "external/tinyxml2",
199 ],
200
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700201 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700202 bionic: {
Tom Cherrye275d6d2017-12-11 23:31:33 -0800203 whole_static_libs: [
204 "libasync_safe",
205 "libsystemproperties",
206 ],
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700207 },
208 },
209
Dan Willemsen41567702016-08-31 16:35:01 -0700210 static_libs: [
211 "libtinyxml2",
212 "liblog",
213 "libbase",
214 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700215 shared: {
216 enabled: false,
217 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000218
219 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700220}
221
222// -----------------------------------------------------------------------------
223// Fortify tests.
224// -----------------------------------------------------------------------------
225
226cc_defaults {
227 name: "bionic_fortify_tests_defaults",
228 cflags: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700229 "-U_FORTIFY_SOURCE",
230 ],
231 srcs: ["fortify_test_main.cpp"],
232 target: {
233 host: {
234 clang_cflags: ["-D__clang__"],
235 },
236 },
237}
238
George Burgess IVd9551db2017-08-17 18:51:02 -0700239// If building this fails, then we have both FORTIFY and ASAN enabled, which
240// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
241// enabled, but that's not a reality today.) This is meant to be otherwise
242// unused.
243cc_test_library {
244 name: "fortify_disabled_for_asan",
245 cflags: [
246 "-Werror",
247 "-D_FORTIFY_SOURCE=2",
248 // "sanitize: address" doesn't work on platforms where libasan isn't
249 // enabled. Since the intent is just to build this, we can get away with
250 // passing this flag on its own.
251 "-fsanitize=address",
252 ],
253 // Ignore that we don't have ASAN symbols linked in.
254 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700255 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700256}
257
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700258// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
259// it can confuse these tools pretty easily. If this builds successfully, then
260// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
261// enabled. The library that results from building this is meant to be unused.
262cc_test_library {
263 name: "fortify_disabled_for_tidy",
264 cflags: [
265 "-Werror",
266 "-D_FORTIFY_SOURCE=2",
267 "-D__clang_analyzer__",
268 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700269 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700270}
271
Colin Cross2722ebb2016-07-11 16:20:06 -0700272cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700273 name: "libfortify1-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800274 defaults: [
275 "bionic_fortify_tests_defaults",
276 "bionic_tests_defaults",
277 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700278 cflags: [
279 "-D_FORTIFY_SOURCE=1",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800280 "-DTEST_NAME=Fortify1_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700281 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700282 shared: {
283 enabled: false,
284 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700285}
286
287cc_test_library {
288 name: "libfortify2-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800289 defaults: [
290 "bionic_fortify_tests_defaults",
291 "bionic_tests_defaults",
292 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700293 cflags: [
294 "-D_FORTIFY_SOURCE=2",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800295 "-DTEST_NAME=Fortify2_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700296 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700297 shared: {
298 enabled: false,
299 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700300}
301
302// -----------------------------------------------------------------------------
303// Library of all tests (excluding the dynamic linker tests).
304// -----------------------------------------------------------------------------
305cc_test_library {
306 name: "libBionicTests",
307 defaults: ["bionic_tests_defaults"],
308 whole_static_libs: [
309 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700310 "libfortify1-tests-clang",
311 "libfortify2-tests-clang",
312 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700313 shared: {
314 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700315 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700316}
317
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700318cc_test_library {
319 name: "libBionicLoaderTests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800320 defaults: [
321 "bionic_tests_defaults",
322 "llvm-defaults",
323 ],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700324 srcs: [
325 "atexit_test.cpp",
326 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700327 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700328 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700329 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700330 "pthread_dlfcn_test.cpp",
331 ],
332 static_libs: [
333 "libbase",
334 ],
335 include_dirs: [
336 "bionic/libc",
337 ],
338 shared: {
339 enabled: false,
340 },
341 target: {
342 android: {
343 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700344 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700345 "dlext_test.cpp",
346 "libdl_test.cpp",
347 ],
348 static_libs: [
349 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700350 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800351 "libLLVMObject",
352 "libLLVMBitReader",
353 "libLLVMMC",
354 "libLLVMMCParser",
355 "libLLVMCore",
356 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700357 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800358 },
Jiyong Park02586a22017-05-20 01:01:24 +0900359 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700360}
361
Colin Cross2722ebb2016-07-11 16:20:06 -0700362// -----------------------------------------------------------------------------
363// Library of bionic customized gtest main function, with normal gtest output format,
364// which is needed by bionic cts test.
365// -----------------------------------------------------------------------------
366cc_test_library {
367 name: "libBionicCtsGtestMain",
368 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700369 srcs: [
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700370 "gtest_globals_cts.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700371 "gtest_main.cpp",
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700372 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700373 shared: {
374 enabled: false,
375 },
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700376 whole_static_libs: [
377 "libgtest_isolated",
378 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700379}
380
381// -----------------------------------------------------------------------------
382// Tests for the device using bionic's .so. Run with:
Bernie Innocentib6647242018-06-18 14:14:43 +0900383// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
384// adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests
Colin Cross2722ebb2016-07-11 16:20:06 -0700385// -----------------------------------------------------------------------------
386cc_defaults {
387 name: "bionic_unit_tests_defaults",
388 host_supported: false,
389
390 whole_static_libs: [
391 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700392 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700393 ],
394
395 static_libs: [
396 "libtinyxml2",
397 "liblog",
398 "libbase",
399 ],
400
401 srcs: [
402 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700403 "__cxa_thread_atexit_test.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700404 "gtest_globals.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700405 "thread_local_test.cpp",
406 ],
407
408 conlyflags: [
409 "-fexceptions",
410 "-fnon-call-exceptions",
411 ],
412
413 ldflags: ["-Wl,--export-dynamic"],
414
415 include_dirs: ["bionic/libc"],
416
Yabin Cui1f553ea2017-01-13 12:31:59 -0800417 stl: "libc++_static",
418
Colin Cross2722ebb2016-07-11 16:20:06 -0700419 target: {
420 android: {
421 shared_libs: [
dimitry321476a2018-01-29 15:32:37 +0100422 "ld-android",
Colin Cross2722ebb2016-07-11 16:20:06 -0700423 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700424 "libdl_preempt_test_1",
425 "libdl_preempt_test_2",
426 "libdl_test_df_1_global",
427 ],
428 static_libs: [
429 // The order of these libraries matters, do not shuffle them.
430 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700431 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700432 "libziparchive",
433 "libz",
434 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800435 "libLLVMObject",
436 "libLLVMBitReader",
437 "libLLVMMC",
438 "libLLVMMCParser",
439 "libLLVMCore",
440 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700441 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700442 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700443 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700444 "-Wl,--enable-new-dtags",
445 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700446 },
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800447 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700448}
449
450cc_test {
451 name: "bionic-unit-tests",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700452 gtest: false,
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800453 defaults: [
454 "bionic_unit_tests_defaults",
455 "bionic_tests_defaults",
456 ],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800457
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700458 srcs: [
459 "gtest_main.cpp",
460 ],
461
462 static_libs: [
463 "libgtest_isolated",
464 ],
465
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800466 target: {
467 android: {
468 shared_libs: ["libicuuc"],
469 },
470 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700471
472 required: [
473 "cfi_test_helper",
474 "cfi_test_helper2",
Ryan Prichard8f639a42018-10-01 23:10:05 -0700475 "exec_linker_helper",
476 "exec_linker_helper_lib",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700477 "libtest_dt_runpath_a",
478 "libtest_dt_runpath_b",
479 "libtest_dt_runpath_c",
480 "libtest_dt_runpath_x",
481 "libatest_simple_zip",
482 "libcfi-test",
483 "libcfi-test-bad",
484 "libdlext_test_different_soname",
485 "libdlext_test_fd",
486 "libdlext_test_norelro",
487 "libdlext_test_runpath_zip_zipaligned",
488 "libdlext_test",
489 "libdlext_test_zip",
490 "libdlext_test_zip_zipaligned",
491 "libdl_preempt_test_1",
492 "libdl_preempt_test_2",
493 "libdl_test_df_1_global",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700494 "libelf-tls-library",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700495 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700496 "libsysv-hash-table-library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700497 "libtestshared",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700498 "libtest_atexit",
499 "libtest_check_order_dlsym_1_left",
500 "libtest_check_order_dlsym_2_right",
501 "libtest_check_order_dlsym_3_c",
502 "libtest_check_order_dlsym_a",
503 "libtest_check_order_dlsym_b",
504 "libtest_check_order_dlsym_d",
505 "libtest_check_order_dlsym",
506 "libtest_check_order_reloc_root_1",
507 "libtest_check_order_reloc_root_2",
508 "libtest_check_order_reloc_root",
509 "libtest_check_order_reloc_siblings_1",
510 "libtest_check_order_reloc_siblings_2",
511 "libtest_check_order_reloc_siblings_3",
512 "libtest_check_order_reloc_siblings_a",
513 "libtest_check_order_reloc_siblings_b",
514 "libtest_check_order_reloc_siblings_c_1",
515 "libtest_check_order_reloc_siblings_c_2",
516 "libtest_check_order_reloc_siblings_c",
517 "libtest_check_order_reloc_siblings_d",
518 "libtest_check_order_reloc_siblings_e",
519 "libtest_check_order_reloc_siblings_f",
520 "libtest_check_order_reloc_siblings",
521 "libtest_check_rtld_next_from_library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700522 "libtest_dlopen_df_1_global",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700523 "libtest_dlopen_from_ctor_main",
524 "libtest_dlopen_from_ctor",
525 "libtest_dlopen_weak_undefined_func",
526 "libtest_dlsym_df_1_global",
527 "libtest_dlsym_from_this_child",
528 "libtest_dlsym_from_this_grandchild",
529 "libtest_dlsym_from_this",
530 "libtest_dlsym_weak_func",
531 "libtest_dt_runpath_d",
532 "libtest_empty",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700533 "libtest_ifunc_variable_impl",
534 "libtest_ifunc_variable",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700535 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700536 "libtest_init_fini_order_child",
537 "libtest_init_fini_order_grand_child",
538 "libtest_init_fini_order_root2",
539 "libtest_init_fini_order_root",
Pirama Arumuga Nainar1395f702018-03-28 15:27:12 -0700540 "libtest_missing_symbol_child_public",
Elliott Hughes06d31c92018-03-29 11:28:53 -0700541 "libtest_missing_symbol_child_private",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700542 "libtest_missing_symbol_root",
543 "libtest_missing_symbol",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700544 "libtest_nodelete_1",
545 "libtest_nodelete_2",
546 "libtest_nodelete_dt_flags_1",
547 "libtest_pthread_atfork",
548 "libtest_relo_check_dt_needed_order_1",
549 "libtest_relo_check_dt_needed_order_2",
550 "libtest_relo_check_dt_needed_order",
551 "libtest_simple",
552 "libtest_two_parents_child",
553 "libtest_two_parents_parent1",
554 "libtest_two_parents_parent2",
555 "libtest_versioned_lib",
556 "libtest_versioned_libv1",
557 "libtest_versioned_libv2",
558 "libtest_versioned_otherlib_empty",
559 "libtest_versioned_otherlib",
560 "libtest_versioned_uselibv1",
561 "libtest_versioned_uselibv2_other",
562 "libtest_versioned_uselibv2",
563 "libtest_versioned_uselibv3_other",
564 "libtest_with_dependency_loop_a",
565 "libtest_with_dependency_loop_b",
566 "libtest_with_dependency_loop_c",
567 "libtest_with_dependency_loop",
568 "libtest_with_dependency",
dimitry55547db2018-05-25 14:17:37 +0200569 "libtest_indirect_thread_local_dtor",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700570 "libtest_invalid-empty_shdr_table.so",
571 "libtest_invalid-rw_load_segment.so",
572 "libtest_invalid-unaligned_shdr_offset.so",
573 "libtest_invalid-zero_shdr_table_content.so",
574 "libtest_invalid-zero_shdr_table_offset.so",
575 "libtest_invalid-zero_shentsize.so",
576 "libtest_invalid-zero_shstrndx.so",
577 "libtest_invalid-textrels.so",
578 "libtest_invalid-textrels2.so",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700579 "libtest_thread_local_dtor",
dimitry55547db2018-05-25 14:17:37 +0200580 "libtest_thread_local_dtor2",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700581 "preinit_getauxval_test_helper",
582 "preinit_syscall_test_helper",
583 "libnstest_private_external",
584 "libnstest_dlopened",
585 "libnstest_private",
586 "libnstest_root_not_isolated",
587 "libnstest_root",
588 "libnstest_public",
589 "libnstest_public_internal",
Logan Chien9ee45912018-01-18 12:05:09 +0800590 "libnstest_ns_a_public1",
591 "libnstest_ns_a_public1_internal",
592 "libnstest_ns_b_public2",
593 "libnstest_ns_b_public3",
Jiyong Parkce10b162018-03-29 10:34:41 +0900594 "ld_preload_test_helper",
595 "ld_preload_test_helper_lib1",
Elliott Hughes51466522018-03-29 11:17:37 -0700596 "ld_preload_test_helper_lib2",
Jiyong Parkce10b162018-03-29 10:34:41 +0900597 "ld_config_test_helper",
598 "ld_config_test_helper_lib1",
599 "ld_config_test_helper_lib2",
600 "ld_config_test_helper_lib3",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700601 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700602}
603
Colin Cross2722ebb2016-07-11 16:20:06 -0700604// -----------------------------------------------------------------------------
605// Tests for the device linked against bionic's static library. Run with:
Bernie Innocentib6647242018-06-18 14:14:43 +0900606// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static
607// adb shell /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static
Colin Cross2722ebb2016-07-11 16:20:06 -0700608// -----------------------------------------------------------------------------
609cc_test {
610 name: "bionic-unit-tests-static",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700611 gtest: false,
Colin Cross2722ebb2016-07-11 16:20:06 -0700612 defaults: ["bionic_tests_defaults"],
613 host_supported: false,
614
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800615 srcs: [
616 "gtest_preinit_debuggerd.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700617 "gtest_globals.cpp",
618 "gtest_main.cpp",
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800619 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700620 whole_static_libs: [
621 "libBionicTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700622 ],
623
624 static_libs: [
625 "libm",
626 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700627 "libdl",
628 "libtinyxml2",
629 "liblog",
630 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700631 "libdebuggerd_handler",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700632 "libgtest_isolated",
Colin Cross2722ebb2016-07-11 16:20:06 -0700633 ],
634
635 static_executable: true,
636 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700637}
638
639// -----------------------------------------------------------------------------
640// Tests to run on the host and linked against glibc. Run with:
641// cd bionic/tests; mm bionic-unit-tests-glibc-run
642// -----------------------------------------------------------------------------
643
644cc_test_host {
645 name: "bionic-unit-tests-glibc",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700646 gtest: false,
Colin Cross2722ebb2016-07-11 16:20:06 -0700647 defaults: ["bionic_tests_defaults"],
648
649 srcs: [
650 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700651 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700652 "dlfcn_test.cpp",
653 "dl_test.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700654 "gtest_globals.cpp",
655 "gtest_main.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700656 "pthread_dlfcn_test.cpp",
657 ],
658
659 shared_libs: [
660 "libdl_preempt_test_1",
661 "libdl_preempt_test_2",
662
663 "libdl_test_df_1_global",
664 ],
665
666 whole_static_libs: [
667 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700668 "libfortify1-tests-clang",
669 "libfortify2-tests-clang",
670 ],
671
672 static_libs: [
673 "libbase",
674 "liblog",
675 "libcutils",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700676 "libgtest_isolated",
Colin Cross2722ebb2016-07-11 16:20:06 -0700677 ],
678
679 host_ldlibs: [
680 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700681 "-lutil",
682 ],
683
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700684 include_dirs: [
685 "bionic/libc",
686 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700687
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800688 ldflags: [
689 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
690 "-Wl,--export-dynamic",
691 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700692
693 sanitize: {
694 never: false,
695 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700696
697 target: {
698 linux_bionic: {
699 enabled: false,
700 },
701 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700702}
703
Elliott Hughes21b56eb2017-10-20 17:57:17 -0700704subdirs = ["*"]