blob: 899fc6691d994f5e524a8c4813340001ed993069 [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 ],
41 stl: "libc++",
42 sanitize: {
43 never: true,
44 },
45}
46
47// -----------------------------------------------------------------------------
48// All standard tests.
49// -----------------------------------------------------------------------------
50
George Burgess IVde45dcb2018-03-16 14:15:01 -070051// Test diagnostics emitted by clang. The library that results is useless; we
52// just want to run '-Xclang -verify', which will fail if the diagnostics don't
53// match up with what the source file says they should be.
54cc_test_library {
55 name: "clang_diagnostic_tests",
56 cflags: [
57 "-Xclang",
58 "-verify",
59 ],
60 srcs: ["sys_ioctl_diag_test.cpp"],
61}
62
Colin Cross2722ebb2016-07-11 16:20:06 -070063cc_test_library {
64 name: "libBionicStandardTests",
65 defaults: ["bionic_tests_defaults"],
66 srcs: [
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030067 "alloca_test.cpp",
Elliott Hughesce934e32018-09-06 13:26:08 -070068 "android_get_device_api_level.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070069 "arpa_inet_test.cpp",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070070 "async_safe_test.cpp",
Elliott Hughesf6495c72016-07-25 09:20:57 -070071 "assert_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070072 "buffer_tests.cpp",
73 "bug_26110743_test.cpp",
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030074 "byteswap_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070075 "complex_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070076 "complex_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070077 "ctype_test.cpp",
78 "dirent_test.cpp",
Elliott Hughesd390df12017-04-30 22:56:10 -070079 "elf_test.cpp",
Elliott Hughesba267f42017-02-24 16:19:53 -080080 "endian_test.cpp",
Elliott Hughese452cb12017-06-13 14:43:53 -070081 "errno_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070082 "error_test.cpp",
83 "eventfd_test.cpp",
84 "fcntl_test.cpp",
Josh Gaof6e5b582018-06-01 15:30:54 -070085 "fdsan_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070086 "fenv_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070087 "float_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070088 "ftw_test.cpp",
89 "getauxval_test.cpp",
90 "getcwd_test.cpp",
Elliott Hughesf1c568d2017-09-26 17:09:07 -070091 "glob_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070092 "grp_pwd_test.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -080093 "grp_pwd_file_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -070094 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070095 "ifaddrs_test.cpp",
96 "inttypes_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070097 "iso646_test.c",
Elliott Hughesfc8e6882016-11-18 16:27:29 -080098 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -070099 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700100 "libgen_basename_test.cpp",
101 "libgen_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700102 "limits_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -0700103 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700104 "locale_test.cpp",
Christopher Ferrisbfd3dc42018-10-15 10:02:38 -0700105 "malloc_iterate_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700106 "malloc_test.cpp",
107 "math_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -0700108 "math_force_long_double_test.cpp",
Orion Hodson6ba66942018-08-30 11:10:23 +0100109 "membarrier_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700110 "mntent_test.cpp",
111 "netdb_test.cpp",
112 "net_if_test.cpp",
113 "netinet_ether_test.cpp",
114 "netinet_in_test.cpp",
Elliott Hughese5a5eec2018-06-27 12:29:06 -0700115 "netinet_ip_icmp_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700116 "netinet_udp_test.cpp",
117 "nl_types_test.cpp",
Elliott Hugheseab65722018-08-30 12:15:56 -0700118 "poll_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700119 "pthread_test.cpp",
120 "pty_test.cpp",
121 "regex_test.cpp",
122 "resolv_test.cpp",
123 "sched_test.cpp",
Peter Collingbourne734beec2018-11-14 12:41:41 -0800124 "scs_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700125 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700126 "search_test.cpp",
127 "semaphore_test.cpp",
128 "setjmp_test.cpp",
129 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700130 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700131 "stack_protector_test.cpp",
132 "stack_protector_test_helper.cpp",
133 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700134 "stdalign_test.cpp",
135 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700136 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700137 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700138 "stdint_test.cpp",
139 "stdio_nofortify_test.cpp",
140 "stdio_test.cpp",
141 "stdio_ext_test.cpp",
142 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700143 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700144 "string_nofortify_test.cpp",
145 "string_test.cpp",
146 "string_posix_strerror_r_test.cpp",
147 "strings_nofortify_test.cpp",
148 "strings_test.cpp",
149 "sstream_test.cpp",
150 "sys_epoll_test.cpp",
151 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700152 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700153 "sys_personality_test.cpp",
154 "sys_prctl_test.cpp",
155 "sys_procfs_test.cpp",
156 "sys_ptrace_test.cpp",
157 "sys_quota_test.cpp",
Elliott Hughes8465e962017-09-27 16:33:35 -0700158 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700159 "sys_resource_test.cpp",
160 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700161 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700162 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700163 "sys_shm_test.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -0800164 "sys_signalfd_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700165 "sys_socket_test.cpp",
166 "sys_stat_test.cpp",
167 "sys_statvfs_test.cpp",
168 "sys_syscall_test.cpp",
169 "sys_sysinfo_test.cpp",
170 "sys_sysmacros_test.cpp",
171 "sys_time_test.cpp",
172 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700173 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700174 "sys_types_test.cpp",
175 "sys_uio_test.cpp",
Elliott Hughese7d185f2018-06-27 13:30:02 -0700176 "sys_un_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700177 "sys_vfs_test.cpp",
178 "sys_xattr_test.cpp",
179 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000180 "system_properties_test2.cpp",
Elliott Hughes5da96462017-12-14 09:43:59 -0800181 "termios_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700182 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700183 "time_test.cpp",
184 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700185 "unistd_nofortify_test.cpp",
186 "unistd_test.cpp",
187 "utmp_test.cpp",
188 "wchar_test.cpp",
189 "wctype_test.cpp",
190 ],
191
192 include_dirs: [
193 "bionic/libc",
194 "external/tinyxml2",
195 ],
196
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700197 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700198 bionic: {
Tom Cherrye275d6d2017-12-11 23:31:33 -0800199 whole_static_libs: [
200 "libasync_safe",
Christopher Ferrisbfd3dc42018-10-15 10:02:38 -0700201 "libprocinfo",
Tom Cherrye275d6d2017-12-11 23:31:33 -0800202 "libsystemproperties",
203 ],
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700204 },
205 },
206
Dan Willemsen41567702016-08-31 16:35:01 -0700207 static_libs: [
208 "libtinyxml2",
209 "liblog",
210 "libbase",
211 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700212 shared: {
213 enabled: false,
214 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000215
216 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700217}
218
219// -----------------------------------------------------------------------------
220// Fortify tests.
221// -----------------------------------------------------------------------------
222
223cc_defaults {
224 name: "bionic_fortify_tests_defaults",
225 cflags: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700226 "-U_FORTIFY_SOURCE",
227 ],
228 srcs: ["fortify_test_main.cpp"],
229 target: {
230 host: {
231 clang_cflags: ["-D__clang__"],
232 },
233 },
234}
235
George Burgess IVd9551db2017-08-17 18:51:02 -0700236// If building this fails, then we have both FORTIFY and ASAN enabled, which
237// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
238// enabled, but that's not a reality today.) This is meant to be otherwise
239// unused.
240cc_test_library {
241 name: "fortify_disabled_for_asan",
242 cflags: [
243 "-Werror",
244 "-D_FORTIFY_SOURCE=2",
245 // "sanitize: address" doesn't work on platforms where libasan isn't
246 // enabled. Since the intent is just to build this, we can get away with
247 // passing this flag on its own.
248 "-fsanitize=address",
249 ],
250 // Ignore that we don't have ASAN symbols linked in.
251 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700252 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700253}
254
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700255// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
256// it can confuse these tools pretty easily. If this builds successfully, then
257// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
258// enabled. The library that results from building this is meant to be unused.
259cc_test_library {
260 name: "fortify_disabled_for_tidy",
261 cflags: [
262 "-Werror",
263 "-D_FORTIFY_SOURCE=2",
264 "-D__clang_analyzer__",
265 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700266 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700267}
268
Colin Cross2722ebb2016-07-11 16:20:06 -0700269cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700270 name: "libfortify1-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800271 defaults: [
272 "bionic_fortify_tests_defaults",
273 "bionic_tests_defaults",
274 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700275 cflags: [
276 "-D_FORTIFY_SOURCE=1",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800277 "-DTEST_NAME=Fortify1_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700278 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700279 shared: {
280 enabled: false,
281 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700282}
283
284cc_test_library {
285 name: "libfortify2-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800286 defaults: [
287 "bionic_fortify_tests_defaults",
288 "bionic_tests_defaults",
289 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700290 cflags: [
291 "-D_FORTIFY_SOURCE=2",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800292 "-DTEST_NAME=Fortify2_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700293 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700294 shared: {
295 enabled: false,
296 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700297}
298
299// -----------------------------------------------------------------------------
300// Library of all tests (excluding the dynamic linker tests).
301// -----------------------------------------------------------------------------
302cc_test_library {
303 name: "libBionicTests",
304 defaults: ["bionic_tests_defaults"],
305 whole_static_libs: [
306 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700307 "libfortify1-tests-clang",
308 "libfortify2-tests-clang",
309 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700310 shared: {
311 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700312 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700313}
314
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700315cc_test_library {
316 name: "libBionicLoaderTests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800317 defaults: [
318 "bionic_tests_defaults",
319 "llvm-defaults",
320 ],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700321 srcs: [
322 "atexit_test.cpp",
323 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700324 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700325 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700326 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700327 "pthread_dlfcn_test.cpp",
328 ],
329 static_libs: [
330 "libbase",
331 ],
332 include_dirs: [
333 "bionic/libc",
334 ],
335 shared: {
336 enabled: false,
337 },
338 target: {
339 android: {
340 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700341 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700342 "dlext_test.cpp",
343 "libdl_test.cpp",
344 ],
345 static_libs: [
346 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700347 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800348 "libLLVMObject",
349 "libLLVMBitReader",
350 "libLLVMMC",
351 "libLLVMMCParser",
352 "libLLVMCore",
353 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700354 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800355 },
Jiyong Park02586a22017-05-20 01:01:24 +0900356 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700357}
358
Colin Cross2722ebb2016-07-11 16:20:06 -0700359// -----------------------------------------------------------------------------
360// Library of bionic customized gtest main function, with normal gtest output format,
361// which is needed by bionic cts test.
362// -----------------------------------------------------------------------------
363cc_test_library {
364 name: "libBionicCtsGtestMain",
365 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700366 srcs: [
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700367 "gtest_globals_cts.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700368 "gtest_main.cpp",
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700369 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700370 shared: {
371 enabled: false,
372 },
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700373 whole_static_libs: [
374 "libgtest_isolated",
375 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700376}
377
378// -----------------------------------------------------------------------------
379// Tests for the device using bionic's .so. Run with:
Bernie Innocentib6647242018-06-18 14:14:43 +0900380// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
381// adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests
Colin Cross2722ebb2016-07-11 16:20:06 -0700382// -----------------------------------------------------------------------------
383cc_defaults {
384 name: "bionic_unit_tests_defaults",
385 host_supported: false,
386
387 whole_static_libs: [
388 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700389 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700390 ],
391
392 static_libs: [
393 "libtinyxml2",
394 "liblog",
395 "libbase",
396 ],
397
398 srcs: [
399 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700400 "__cxa_thread_atexit_test.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700401 "gtest_globals.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700402 "thread_local_test.cpp",
403 ],
404
405 conlyflags: [
406 "-fexceptions",
407 "-fnon-call-exceptions",
408 ],
409
410 ldflags: ["-Wl,--export-dynamic"],
411
412 include_dirs: ["bionic/libc"],
413
Yabin Cui1f553ea2017-01-13 12:31:59 -0800414 stl: "libc++_static",
415
Colin Cross2722ebb2016-07-11 16:20:06 -0700416 target: {
417 android: {
418 shared_libs: [
dimitry321476a2018-01-29 15:32:37 +0100419 "ld-android",
Colin Cross2722ebb2016-07-11 16:20:06 -0700420 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700421 "libdl_preempt_test_1",
422 "libdl_preempt_test_2",
423 "libdl_test_df_1_global",
424 ],
425 static_libs: [
426 // The order of these libraries matters, do not shuffle them.
427 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700428 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700429 "libziparchive",
430 "libz",
431 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800432 "libLLVMObject",
433 "libLLVMBitReader",
434 "libLLVMMC",
435 "libLLVMMCParser",
436 "libLLVMCore",
437 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700438 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700439 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700440 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700441 "-Wl,--enable-new-dtags",
442 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700443 },
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800444 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700445}
446
447cc_test {
448 name: "bionic-unit-tests",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700449 gtest: false,
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800450 defaults: [
451 "bionic_unit_tests_defaults",
452 "bionic_tests_defaults",
453 ],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800454
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700455 srcs: [
456 "gtest_main.cpp",
457 ],
458
459 static_libs: [
460 "libgtest_isolated",
461 ],
462
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800463 target: {
464 android: {
465 shared_libs: ["libicuuc"],
466 },
467 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700468
469 required: [
470 "cfi_test_helper",
471 "cfi_test_helper2",
Ryan Prichard8f639a42018-10-01 23:10:05 -0700472 "exec_linker_helper",
473 "exec_linker_helper_lib",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700474 "libtest_dt_runpath_a",
475 "libtest_dt_runpath_b",
476 "libtest_dt_runpath_c",
477 "libtest_dt_runpath_x",
478 "libatest_simple_zip",
479 "libcfi-test",
480 "libcfi-test-bad",
481 "libdlext_test_different_soname",
482 "libdlext_test_fd",
483 "libdlext_test_norelro",
484 "libdlext_test_runpath_zip_zipaligned",
485 "libdlext_test",
486 "libdlext_test_zip",
487 "libdlext_test_zip_zipaligned",
488 "libdl_preempt_test_1",
489 "libdl_preempt_test_2",
490 "libdl_test_df_1_global",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700491 "libelf-tls-library",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700492 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700493 "libsysv-hash-table-library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700494 "libtestshared",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700495 "libtest_atexit",
496 "libtest_check_order_dlsym_1_left",
497 "libtest_check_order_dlsym_2_right",
498 "libtest_check_order_dlsym_3_c",
499 "libtest_check_order_dlsym_a",
500 "libtest_check_order_dlsym_b",
501 "libtest_check_order_dlsym_d",
502 "libtest_check_order_dlsym",
503 "libtest_check_order_reloc_root_1",
504 "libtest_check_order_reloc_root_2",
505 "libtest_check_order_reloc_root",
506 "libtest_check_order_reloc_siblings_1",
507 "libtest_check_order_reloc_siblings_2",
508 "libtest_check_order_reloc_siblings_3",
509 "libtest_check_order_reloc_siblings_a",
510 "libtest_check_order_reloc_siblings_b",
511 "libtest_check_order_reloc_siblings_c_1",
512 "libtest_check_order_reloc_siblings_c_2",
513 "libtest_check_order_reloc_siblings_c",
514 "libtest_check_order_reloc_siblings_d",
515 "libtest_check_order_reloc_siblings_e",
516 "libtest_check_order_reloc_siblings_f",
517 "libtest_check_order_reloc_siblings",
518 "libtest_check_rtld_next_from_library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700519 "libtest_dlopen_df_1_global",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700520 "libtest_dlopen_from_ctor_main",
521 "libtest_dlopen_from_ctor",
522 "libtest_dlopen_weak_undefined_func",
523 "libtest_dlsym_df_1_global",
524 "libtest_dlsym_from_this_child",
525 "libtest_dlsym_from_this_grandchild",
526 "libtest_dlsym_from_this",
527 "libtest_dlsym_weak_func",
528 "libtest_dt_runpath_d",
529 "libtest_empty",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700530 "libtest_ifunc_variable_impl",
531 "libtest_ifunc_variable",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700532 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700533 "libtest_init_fini_order_child",
534 "libtest_init_fini_order_grand_child",
535 "libtest_init_fini_order_root2",
536 "libtest_init_fini_order_root",
Pirama Arumuga Nainar1395f702018-03-28 15:27:12 -0700537 "libtest_missing_symbol_child_public",
Elliott Hughes06d31c92018-03-29 11:28:53 -0700538 "libtest_missing_symbol_child_private",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700539 "libtest_missing_symbol_root",
540 "libtest_missing_symbol",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700541 "libtest_nodelete_1",
542 "libtest_nodelete_2",
543 "libtest_nodelete_dt_flags_1",
544 "libtest_pthread_atfork",
545 "libtest_relo_check_dt_needed_order_1",
546 "libtest_relo_check_dt_needed_order_2",
547 "libtest_relo_check_dt_needed_order",
548 "libtest_simple",
549 "libtest_two_parents_child",
550 "libtest_two_parents_parent1",
551 "libtest_two_parents_parent2",
552 "libtest_versioned_lib",
553 "libtest_versioned_libv1",
554 "libtest_versioned_libv2",
555 "libtest_versioned_otherlib_empty",
556 "libtest_versioned_otherlib",
557 "libtest_versioned_uselibv1",
558 "libtest_versioned_uselibv2_other",
559 "libtest_versioned_uselibv2",
560 "libtest_versioned_uselibv3_other",
561 "libtest_with_dependency_loop_a",
562 "libtest_with_dependency_loop_b",
563 "libtest_with_dependency_loop_c",
564 "libtest_with_dependency_loop",
565 "libtest_with_dependency",
dimitry55547db2018-05-25 14:17:37 +0200566 "libtest_indirect_thread_local_dtor",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700567 "libtest_invalid-empty_shdr_table.so",
568 "libtest_invalid-rw_load_segment.so",
569 "libtest_invalid-unaligned_shdr_offset.so",
570 "libtest_invalid-zero_shdr_table_content.so",
571 "libtest_invalid-zero_shdr_table_offset.so",
572 "libtest_invalid-zero_shentsize.so",
573 "libtest_invalid-zero_shstrndx.so",
574 "libtest_invalid-textrels.so",
575 "libtest_invalid-textrels2.so",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700576 "libtest_thread_local_dtor",
dimitry55547db2018-05-25 14:17:37 +0200577 "libtest_thread_local_dtor2",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700578 "preinit_getauxval_test_helper",
579 "preinit_syscall_test_helper",
580 "libnstest_private_external",
581 "libnstest_dlopened",
582 "libnstest_private",
583 "libnstest_root_not_isolated",
584 "libnstest_root",
585 "libnstest_public",
586 "libnstest_public_internal",
Logan Chien9ee45912018-01-18 12:05:09 +0800587 "libnstest_ns_a_public1",
588 "libnstest_ns_a_public1_internal",
589 "libnstest_ns_b_public2",
590 "libnstest_ns_b_public3",
Jiyong Parkce10b162018-03-29 10:34:41 +0900591 "ld_preload_test_helper",
592 "ld_preload_test_helper_lib1",
Elliott Hughes51466522018-03-29 11:17:37 -0700593 "ld_preload_test_helper_lib2",
Jiyong Parkce10b162018-03-29 10:34:41 +0900594 "ld_config_test_helper",
595 "ld_config_test_helper_lib1",
596 "ld_config_test_helper_lib2",
597 "ld_config_test_helper_lib3",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700598 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700599}
600
Colin Cross2722ebb2016-07-11 16:20:06 -0700601// -----------------------------------------------------------------------------
602// Tests for the device linked against bionic's static library. Run with:
Bernie Innocentib6647242018-06-18 14:14:43 +0900603// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static
604// adb shell /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static
Colin Cross2722ebb2016-07-11 16:20:06 -0700605// -----------------------------------------------------------------------------
606cc_test {
607 name: "bionic-unit-tests-static",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700608 gtest: false,
Colin Cross2722ebb2016-07-11 16:20:06 -0700609 defaults: ["bionic_tests_defaults"],
610 host_supported: false,
611
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800612 srcs: [
613 "gtest_preinit_debuggerd.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700614 "gtest_globals.cpp",
615 "gtest_main.cpp",
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800616 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700617 whole_static_libs: [
618 "libBionicTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700619 ],
620
621 static_libs: [
622 "libm",
623 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700624 "libdl",
625 "libtinyxml2",
626 "liblog",
627 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700628 "libdebuggerd_handler",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700629 "libgtest_isolated",
Colin Cross2722ebb2016-07-11 16:20:06 -0700630 ],
631
632 static_executable: true,
633 stl: "libc++_static",
Yi Kongb011d592018-11-07 21:28:47 -0800634
635 // libclang_rt.builtins does not work with libm
636 // http://b/117167374
637 no_libcrt: true,
Colin Cross2722ebb2016-07-11 16:20:06 -0700638}
639
640// -----------------------------------------------------------------------------
641// Tests to run on the host and linked against glibc. Run with:
642// cd bionic/tests; mm bionic-unit-tests-glibc-run
643// -----------------------------------------------------------------------------
644
645cc_test_host {
646 name: "bionic-unit-tests-glibc",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700647 gtest: false,
Colin Cross2722ebb2016-07-11 16:20:06 -0700648 defaults: ["bionic_tests_defaults"],
649
650 srcs: [
651 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700652 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700653 "dlfcn_test.cpp",
654 "dl_test.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700655 "gtest_globals.cpp",
656 "gtest_main.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700657 "pthread_dlfcn_test.cpp",
658 ],
659
660 shared_libs: [
661 "libdl_preempt_test_1",
662 "libdl_preempt_test_2",
663
664 "libdl_test_df_1_global",
665 ],
666
667 whole_static_libs: [
668 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700669 "libfortify1-tests-clang",
670 "libfortify2-tests-clang",
671 ],
672
673 static_libs: [
674 "libbase",
675 "liblog",
676 "libcutils",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700677 "libgtest_isolated",
Colin Cross2722ebb2016-07-11 16:20:06 -0700678 ],
679
680 host_ldlibs: [
681 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700682 "-lutil",
683 ],
684
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700685 include_dirs: [
686 "bionic/libc",
687 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700688
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800689 ldflags: [
690 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
691 "-Wl,--export-dynamic",
692 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700693
694 sanitize: {
695 never: false,
696 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700697
698 target: {
699 linux_bionic: {
700 enabled: false,
701 },
702 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700703}
704
Elliott Hughes21b56eb2017-10-20 17:57:17 -0700705subdirs = ["*"]