blob: ffa6b2a28ac3080ff6f9f7bd276a4408cdc5c770 [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",
Colin Cross2722ebb2016-07-11 16:20:06 -070068 "arpa_inet_test.cpp",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070069 "async_safe_test.cpp",
Elliott Hughesf6495c72016-07-25 09:20:57 -070070 "assert_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070071 "buffer_tests.cpp",
72 "bug_26110743_test.cpp",
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030073 "byteswap_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070074 "complex_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070075 "complex_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070076 "ctype_test.cpp",
77 "dirent_test.cpp",
Elliott Hughesd390df12017-04-30 22:56:10 -070078 "elf_test.cpp",
Elliott Hughesba267f42017-02-24 16:19:53 -080079 "endian_test.cpp",
Elliott Hughese452cb12017-06-13 14:43:53 -070080 "errno_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070081 "error_test.cpp",
82 "eventfd_test.cpp",
83 "fcntl_test.cpp",
Josh Gaof6e5b582018-06-01 15:30:54 -070084 "fdsan_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070085 "fenv_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070086 "float_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070087 "ftw_test.cpp",
88 "getauxval_test.cpp",
89 "getcwd_test.cpp",
Elliott Hughesf1c568d2017-09-26 17:09:07 -070090 "glob_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070091 "grp_pwd_test.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -080092 "grp_pwd_file_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -070093 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070094 "ifaddrs_test.cpp",
95 "inttypes_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070096 "iso646_test.c",
Elliott Hughesfc8e6882016-11-18 16:27:29 -080097 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -070098 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070099 "libgen_basename_test.cpp",
100 "libgen_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700101 "limits_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -0700102 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700103 "locale_test.cpp",
104 "malloc_test.cpp",
105 "math_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -0700106 "math_force_long_double_test.cpp",
Orion Hodson6ba66942018-08-30 11:10:23 +0100107 "membarrier_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700108 "mntent_test.cpp",
109 "netdb_test.cpp",
110 "net_if_test.cpp",
111 "netinet_ether_test.cpp",
112 "netinet_in_test.cpp",
Elliott Hughese5a5eec2018-06-27 12:29:06 -0700113 "netinet_ip_icmp_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700114 "netinet_udp_test.cpp",
115 "nl_types_test.cpp",
Elliott Hugheseab65722018-08-30 12:15:56 -0700116 "poll_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700117 "pthread_test.cpp",
118 "pty_test.cpp",
119 "regex_test.cpp",
120 "resolv_test.cpp",
121 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700122 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700123 "search_test.cpp",
124 "semaphore_test.cpp",
125 "setjmp_test.cpp",
126 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700127 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700128 "stack_protector_test.cpp",
129 "stack_protector_test_helper.cpp",
130 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700131 "stdalign_test.cpp",
132 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700133 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700134 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700135 "stdint_test.cpp",
136 "stdio_nofortify_test.cpp",
137 "stdio_test.cpp",
138 "stdio_ext_test.cpp",
139 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700140 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700141 "string_nofortify_test.cpp",
142 "string_test.cpp",
143 "string_posix_strerror_r_test.cpp",
144 "strings_nofortify_test.cpp",
145 "strings_test.cpp",
146 "sstream_test.cpp",
147 "sys_epoll_test.cpp",
148 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700149 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700150 "sys_personality_test.cpp",
151 "sys_prctl_test.cpp",
152 "sys_procfs_test.cpp",
153 "sys_ptrace_test.cpp",
154 "sys_quota_test.cpp",
Elliott Hughes8465e962017-09-27 16:33:35 -0700155 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700156 "sys_resource_test.cpp",
157 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700158 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700159 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700160 "sys_shm_test.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -0800161 "sys_signalfd_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700162 "sys_socket_test.cpp",
163 "sys_stat_test.cpp",
164 "sys_statvfs_test.cpp",
165 "sys_syscall_test.cpp",
166 "sys_sysinfo_test.cpp",
167 "sys_sysmacros_test.cpp",
168 "sys_time_test.cpp",
169 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700170 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700171 "sys_types_test.cpp",
172 "sys_uio_test.cpp",
Elliott Hughese7d185f2018-06-27 13:30:02 -0700173 "sys_un_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700174 "sys_vfs_test.cpp",
175 "sys_xattr_test.cpp",
176 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000177 "system_properties_test2.cpp",
Elliott Hughes5da96462017-12-14 09:43:59 -0800178 "termios_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700179 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700180 "time_test.cpp",
181 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700182 "unistd_nofortify_test.cpp",
183 "unistd_test.cpp",
184 "utmp_test.cpp",
185 "wchar_test.cpp",
186 "wctype_test.cpp",
187 ],
188
189 include_dirs: [
190 "bionic/libc",
191 "external/tinyxml2",
192 ],
193
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700194 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700195 bionic: {
Tom Cherrye275d6d2017-12-11 23:31:33 -0800196 whole_static_libs: [
197 "libasync_safe",
198 "libsystemproperties",
199 ],
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700200 },
201 },
202
Dan Willemsen41567702016-08-31 16:35:01 -0700203 static_libs: [
204 "libtinyxml2",
205 "liblog",
206 "libbase",
207 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700208 shared: {
209 enabled: false,
210 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000211
212 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700213}
214
215// -----------------------------------------------------------------------------
216// Fortify tests.
217// -----------------------------------------------------------------------------
218
219cc_defaults {
220 name: "bionic_fortify_tests_defaults",
221 cflags: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700222 "-U_FORTIFY_SOURCE",
223 ],
224 srcs: ["fortify_test_main.cpp"],
225 target: {
226 host: {
227 clang_cflags: ["-D__clang__"],
228 },
229 },
230}
231
George Burgess IVd9551db2017-08-17 18:51:02 -0700232// If building this fails, then we have both FORTIFY and ASAN enabled, which
233// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
234// enabled, but that's not a reality today.) This is meant to be otherwise
235// unused.
236cc_test_library {
237 name: "fortify_disabled_for_asan",
238 cflags: [
239 "-Werror",
240 "-D_FORTIFY_SOURCE=2",
241 // "sanitize: address" doesn't work on platforms where libasan isn't
242 // enabled. Since the intent is just to build this, we can get away with
243 // passing this flag on its own.
244 "-fsanitize=address",
245 ],
246 // Ignore that we don't have ASAN symbols linked in.
247 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700248 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700249}
250
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700251// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
252// it can confuse these tools pretty easily. If this builds successfully, then
253// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
254// enabled. The library that results from building this is meant to be unused.
255cc_test_library {
256 name: "fortify_disabled_for_tidy",
257 cflags: [
258 "-Werror",
259 "-D_FORTIFY_SOURCE=2",
260 "-D__clang_analyzer__",
261 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700262 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700263}
264
Colin Cross2722ebb2016-07-11 16:20:06 -0700265cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700266 name: "libfortify1-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800267 defaults: [
268 "bionic_fortify_tests_defaults",
269 "bionic_tests_defaults",
270 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700271 cflags: [
272 "-D_FORTIFY_SOURCE=1",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800273 "-DTEST_NAME=Fortify1_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700274 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700275 shared: {
276 enabled: false,
277 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700278}
279
280cc_test_library {
281 name: "libfortify2-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800282 defaults: [
283 "bionic_fortify_tests_defaults",
284 "bionic_tests_defaults",
285 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700286 cflags: [
287 "-D_FORTIFY_SOURCE=2",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800288 "-DTEST_NAME=Fortify2_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700289 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700290 shared: {
291 enabled: false,
292 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700293}
294
295// -----------------------------------------------------------------------------
296// Library of all tests (excluding the dynamic linker tests).
297// -----------------------------------------------------------------------------
298cc_test_library {
299 name: "libBionicTests",
300 defaults: ["bionic_tests_defaults"],
301 whole_static_libs: [
302 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700303 "libfortify1-tests-clang",
304 "libfortify2-tests-clang",
305 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700306 shared: {
307 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700308 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700309}
310
311// -----------------------------------------------------------------------------
312// Library of bionic customized gtest main function, with simplified output format.
313// -----------------------------------------------------------------------------
314cc_test_library {
315 name: "libBionicGtestMain",
316 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700317 srcs: [
318 "gtest_main.cpp",
319 "gtest_globals.cpp",
320 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800321 whole_static_libs: [
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700322 "libbase",
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800323 "liblog",
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700324 ],
325 include_dirs: [
326 "bionic/libc",
327 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700328 target: {
329 darwin: {
330 enabled: true,
331 },
332 },
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700333 shared: {
334 enabled: false,
335 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700336}
337
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700338cc_test_library {
339 name: "libBionicLoaderTests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800340 defaults: [
341 "bionic_tests_defaults",
342 "llvm-defaults",
343 ],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700344 srcs: [
345 "atexit_test.cpp",
346 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700347 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700348 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700349 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700350 "pthread_dlfcn_test.cpp",
351 ],
352 static_libs: [
353 "libbase",
354 ],
355 include_dirs: [
356 "bionic/libc",
357 ],
358 shared: {
359 enabled: false,
360 },
361 target: {
362 android: {
363 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700364 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700365 "dlext_test.cpp",
366 "libdl_test.cpp",
367 ],
368 static_libs: [
369 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700370 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800371 "libLLVMObject",
372 "libLLVMBitReader",
373 "libLLVMMC",
374 "libLLVMMCParser",
375 "libLLVMCore",
376 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700377 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800378 },
Jiyong Park02586a22017-05-20 01:01:24 +0900379 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700380}
381
Colin Cross2722ebb2016-07-11 16:20:06 -0700382// -----------------------------------------------------------------------------
383// Library of bionic customized gtest main function, with normal gtest output format,
384// which is needed by bionic cts test.
385// -----------------------------------------------------------------------------
386cc_test_library {
387 name: "libBionicCtsGtestMain",
388 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700389 srcs: [
390 "gtest_main.cpp",
391 "gtest_globals_cts.cpp",
392 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800393 static_libs: [
394 "libbase",
395 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700396 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700397 shared: {
398 enabled: false,
399 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700400}
401
402// -----------------------------------------------------------------------------
403// Tests for the device using bionic's .so. Run with:
Bernie Innocentib6647242018-06-18 14:14:43 +0900404// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
405// adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests
Colin Cross2722ebb2016-07-11 16:20:06 -0700406// -----------------------------------------------------------------------------
407cc_defaults {
408 name: "bionic_unit_tests_defaults",
409 host_supported: false,
410
411 whole_static_libs: [
412 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700413 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700414 "libBionicGtestMain",
415 ],
416
417 static_libs: [
418 "libtinyxml2",
419 "liblog",
420 "libbase",
421 ],
422
423 srcs: [
424 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700425 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700426 "thread_local_test.cpp",
427 ],
428
429 conlyflags: [
430 "-fexceptions",
431 "-fnon-call-exceptions",
432 ],
433
434 ldflags: ["-Wl,--export-dynamic"],
435
436 include_dirs: ["bionic/libc"],
437
Yabin Cui1f553ea2017-01-13 12:31:59 -0800438 stl: "libc++_static",
439
Colin Cross2722ebb2016-07-11 16:20:06 -0700440 target: {
441 android: {
442 shared_libs: [
dimitry321476a2018-01-29 15:32:37 +0100443 "ld-android",
Colin Cross2722ebb2016-07-11 16:20:06 -0700444 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700445 "libdl_preempt_test_1",
446 "libdl_preempt_test_2",
447 "libdl_test_df_1_global",
448 ],
449 static_libs: [
450 // The order of these libraries matters, do not shuffle them.
451 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700452 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700453 "libziparchive",
454 "libz",
455 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800456 "libLLVMObject",
457 "libLLVMBitReader",
458 "libLLVMMC",
459 "libLLVMMCParser",
460 "libLLVMCore",
461 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700462 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700463 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700464 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700465 "-Wl,--enable-new-dtags",
466 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700467 },
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800468 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700469}
470
471cc_test {
472 name: "bionic-unit-tests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800473 defaults: [
474 "bionic_unit_tests_defaults",
475 "bionic_tests_defaults",
476 ],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800477
478 target: {
479 android: {
480 shared_libs: ["libicuuc"],
481 },
482 },
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700483
484 required: [
485 "cfi_test_helper",
486 "cfi_test_helper2",
487 "libtest_dt_runpath_a",
488 "libtest_dt_runpath_b",
489 "libtest_dt_runpath_c",
490 "libtest_dt_runpath_x",
491 "libatest_simple_zip",
492 "libcfi-test",
493 "libcfi-test-bad",
494 "libdlext_test_different_soname",
495 "libdlext_test_fd",
496 "libdlext_test_norelro",
497 "libdlext_test_runpath_zip_zipaligned",
498 "libdlext_test",
499 "libdlext_test_zip",
500 "libdlext_test_zip_zipaligned",
501 "libdl_preempt_test_1",
502 "libdl_preempt_test_2",
503 "libdl_test_df_1_global",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700504 "libelf-tls-library",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700505 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700506 "libsysv-hash-table-library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700507 "libtestshared",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700508 "libtest_atexit",
509 "libtest_check_order_dlsym_1_left",
510 "libtest_check_order_dlsym_2_right",
511 "libtest_check_order_dlsym_3_c",
512 "libtest_check_order_dlsym_a",
513 "libtest_check_order_dlsym_b",
514 "libtest_check_order_dlsym_d",
515 "libtest_check_order_dlsym",
516 "libtest_check_order_reloc_root_1",
517 "libtest_check_order_reloc_root_2",
518 "libtest_check_order_reloc_root",
519 "libtest_check_order_reloc_siblings_1",
520 "libtest_check_order_reloc_siblings_2",
521 "libtest_check_order_reloc_siblings_3",
522 "libtest_check_order_reloc_siblings_a",
523 "libtest_check_order_reloc_siblings_b",
524 "libtest_check_order_reloc_siblings_c_1",
525 "libtest_check_order_reloc_siblings_c_2",
526 "libtest_check_order_reloc_siblings_c",
527 "libtest_check_order_reloc_siblings_d",
528 "libtest_check_order_reloc_siblings_e",
529 "libtest_check_order_reloc_siblings_f",
530 "libtest_check_order_reloc_siblings",
531 "libtest_check_rtld_next_from_library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700532 "libtest_dlopen_df_1_global",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700533 "libtest_dlopen_from_ctor_main",
534 "libtest_dlopen_from_ctor",
535 "libtest_dlopen_weak_undefined_func",
536 "libtest_dlsym_df_1_global",
537 "libtest_dlsym_from_this_child",
538 "libtest_dlsym_from_this_grandchild",
539 "libtest_dlsym_from_this",
540 "libtest_dlsym_weak_func",
541 "libtest_dt_runpath_d",
542 "libtest_empty",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700543 "libtest_ifunc_variable_impl",
544 "libtest_ifunc_variable",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700545 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700546 "libtest_init_fini_order_child",
547 "libtest_init_fini_order_grand_child",
548 "libtest_init_fini_order_root2",
549 "libtest_init_fini_order_root",
Pirama Arumuga Nainar1395f702018-03-28 15:27:12 -0700550 "libtest_missing_symbol_child_public",
Elliott Hughes06d31c92018-03-29 11:28:53 -0700551 "libtest_missing_symbol_child_private",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700552 "libtest_missing_symbol_root",
553 "libtest_missing_symbol",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700554 "libtest_nodelete_1",
555 "libtest_nodelete_2",
556 "libtest_nodelete_dt_flags_1",
557 "libtest_pthread_atfork",
558 "libtest_relo_check_dt_needed_order_1",
559 "libtest_relo_check_dt_needed_order_2",
560 "libtest_relo_check_dt_needed_order",
561 "libtest_simple",
562 "libtest_two_parents_child",
563 "libtest_two_parents_parent1",
564 "libtest_two_parents_parent2",
565 "libtest_versioned_lib",
566 "libtest_versioned_libv1",
567 "libtest_versioned_libv2",
568 "libtest_versioned_otherlib_empty",
569 "libtest_versioned_otherlib",
570 "libtest_versioned_uselibv1",
571 "libtest_versioned_uselibv2_other",
572 "libtest_versioned_uselibv2",
573 "libtest_versioned_uselibv3_other",
574 "libtest_with_dependency_loop_a",
575 "libtest_with_dependency_loop_b",
576 "libtest_with_dependency_loop_c",
577 "libtest_with_dependency_loop",
578 "libtest_with_dependency",
dimitry55547db2018-05-25 14:17:37 +0200579 "libtest_indirect_thread_local_dtor",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700580 "libtest_invalid-empty_shdr_table.so",
581 "libtest_invalid-rw_load_segment.so",
582 "libtest_invalid-unaligned_shdr_offset.so",
583 "libtest_invalid-zero_shdr_table_content.so",
584 "libtest_invalid-zero_shdr_table_offset.so",
585 "libtest_invalid-zero_shentsize.so",
586 "libtest_invalid-zero_shstrndx.so",
587 "libtest_invalid-textrels.so",
588 "libtest_invalid-textrels2.so",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700589 "libtest_thread_local_dtor",
dimitry55547db2018-05-25 14:17:37 +0200590 "libtest_thread_local_dtor2",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700591 "preinit_getauxval_test_helper",
592 "preinit_syscall_test_helper",
593 "libnstest_private_external",
594 "libnstest_dlopened",
595 "libnstest_private",
596 "libnstest_root_not_isolated",
597 "libnstest_root",
598 "libnstest_public",
599 "libnstest_public_internal",
Logan Chien9ee45912018-01-18 12:05:09 +0800600 "libnstest_ns_a_public1",
601 "libnstest_ns_a_public1_internal",
602 "libnstest_ns_b_public2",
603 "libnstest_ns_b_public3",
Jiyong Parkce10b162018-03-29 10:34:41 +0900604 "ld_preload_test_helper",
605 "ld_preload_test_helper_lib1",
Elliott Hughes51466522018-03-29 11:17:37 -0700606 "ld_preload_test_helper_lib2",
Jiyong Parkce10b162018-03-29 10:34:41 +0900607 "ld_config_test_helper",
608 "ld_config_test_helper_lib1",
609 "ld_config_test_helper_lib2",
610 "ld_config_test_helper_lib3",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700611 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700612}
613
Colin Cross2722ebb2016-07-11 16:20:06 -0700614// -----------------------------------------------------------------------------
615// Tests for the device linked against bionic's static library. Run with:
Bernie Innocentib6647242018-06-18 14:14:43 +0900616// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static
617// adb shell /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static
Colin Cross2722ebb2016-07-11 16:20:06 -0700618// -----------------------------------------------------------------------------
619cc_test {
620 name: "bionic-unit-tests-static",
621 defaults: ["bionic_tests_defaults"],
622 host_supported: false,
623
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800624 srcs: [
625 "gtest_preinit_debuggerd.cpp",
626 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700627 whole_static_libs: [
628 "libBionicTests",
629 "libBionicGtestMain",
630 ],
631
632 static_libs: [
633 "libm",
634 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700635 "libdl",
636 "libtinyxml2",
637 "liblog",
638 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700639 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700640 ],
641
642 static_executable: true,
643 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700644}
645
646// -----------------------------------------------------------------------------
647// Tests to run on the host and linked against glibc. Run with:
648// cd bionic/tests; mm bionic-unit-tests-glibc-run
649// -----------------------------------------------------------------------------
650
651cc_test_host {
652 name: "bionic-unit-tests-glibc",
653 defaults: ["bionic_tests_defaults"],
654
655 srcs: [
656 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700657 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700658 "dlfcn_test.cpp",
659 "dl_test.cpp",
660 "pthread_dlfcn_test.cpp",
661 ],
662
663 shared_libs: [
664 "libdl_preempt_test_1",
665 "libdl_preempt_test_2",
666
667 "libdl_test_df_1_global",
668 ],
669
670 whole_static_libs: [
671 "libBionicStandardTests",
672 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700673 "libfortify1-tests-clang",
674 "libfortify2-tests-clang",
675 ],
676
677 static_libs: [
678 "libbase",
679 "liblog",
680 "libcutils",
681 ],
682
683 host_ldlibs: [
684 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700685 "-lutil",
686 ],
687
688 include_dirs: ["bionic/libc"],
689
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800690 ldflags: [
691 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
692 "-Wl,--export-dynamic",
693 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700694
695 sanitize: {
696 never: false,
697 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700698
699 target: {
700 linux_bionic: {
701 enabled: false,
702 },
703 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700704}
705
Elliott Hughes21b56eb2017-10-20 17:57:17 -0700706subdirs = ["*"]