blob: c334032d7ec3c38bbffce430413359f7204afc43 [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",
Elliott Hughes50599392017-05-25 17:13:32 -0700124 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700125 "search_test.cpp",
126 "semaphore_test.cpp",
127 "setjmp_test.cpp",
128 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700129 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700130 "stack_protector_test.cpp",
131 "stack_protector_test_helper.cpp",
132 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700133 "stdalign_test.cpp",
134 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700135 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700136 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700137 "stdint_test.cpp",
138 "stdio_nofortify_test.cpp",
139 "stdio_test.cpp",
140 "stdio_ext_test.cpp",
141 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700142 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700143 "string_nofortify_test.cpp",
144 "string_test.cpp",
145 "string_posix_strerror_r_test.cpp",
146 "strings_nofortify_test.cpp",
147 "strings_test.cpp",
148 "sstream_test.cpp",
149 "sys_epoll_test.cpp",
150 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700151 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700152 "sys_personality_test.cpp",
153 "sys_prctl_test.cpp",
154 "sys_procfs_test.cpp",
155 "sys_ptrace_test.cpp",
156 "sys_quota_test.cpp",
Elliott Hughes8465e962017-09-27 16:33:35 -0700157 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700158 "sys_resource_test.cpp",
159 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700160 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700161 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700162 "sys_shm_test.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -0800163 "sys_signalfd_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700164 "sys_socket_test.cpp",
165 "sys_stat_test.cpp",
166 "sys_statvfs_test.cpp",
167 "sys_syscall_test.cpp",
168 "sys_sysinfo_test.cpp",
169 "sys_sysmacros_test.cpp",
170 "sys_time_test.cpp",
171 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700172 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700173 "sys_types_test.cpp",
174 "sys_uio_test.cpp",
Elliott Hughese7d185f2018-06-27 13:30:02 -0700175 "sys_un_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700176 "sys_vfs_test.cpp",
177 "sys_xattr_test.cpp",
178 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000179 "system_properties_test2.cpp",
Elliott Hughes5da96462017-12-14 09:43:59 -0800180 "termios_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700181 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700182 "time_test.cpp",
183 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700184 "unistd_nofortify_test.cpp",
185 "unistd_test.cpp",
186 "utmp_test.cpp",
187 "wchar_test.cpp",
188 "wctype_test.cpp",
189 ],
190
191 include_dirs: [
192 "bionic/libc",
193 "external/tinyxml2",
194 ],
195
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700196 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700197 bionic: {
Tom Cherrye275d6d2017-12-11 23:31:33 -0800198 whole_static_libs: [
199 "libasync_safe",
Christopher Ferrisbfd3dc42018-10-15 10:02:38 -0700200 "libprocinfo",
Tom Cherrye275d6d2017-12-11 23:31:33 -0800201 "libsystemproperties",
202 ],
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700203 },
204 },
205
Dan Willemsen41567702016-08-31 16:35:01 -0700206 static_libs: [
207 "libtinyxml2",
208 "liblog",
209 "libbase",
210 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700211 shared: {
212 enabled: false,
213 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000214
215 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700216}
217
218// -----------------------------------------------------------------------------
219// Fortify tests.
220// -----------------------------------------------------------------------------
221
222cc_defaults {
223 name: "bionic_fortify_tests_defaults",
224 cflags: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700225 "-U_FORTIFY_SOURCE",
226 ],
227 srcs: ["fortify_test_main.cpp"],
228 target: {
229 host: {
230 clang_cflags: ["-D__clang__"],
231 },
232 },
233}
234
George Burgess IVd9551db2017-08-17 18:51:02 -0700235// If building this fails, then we have both FORTIFY and ASAN enabled, which
236// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
237// enabled, but that's not a reality today.) This is meant to be otherwise
238// unused.
239cc_test_library {
240 name: "fortify_disabled_for_asan",
241 cflags: [
242 "-Werror",
243 "-D_FORTIFY_SOURCE=2",
244 // "sanitize: address" doesn't work on platforms where libasan isn't
245 // enabled. Since the intent is just to build this, we can get away with
246 // passing this flag on its own.
247 "-fsanitize=address",
248 ],
249 // Ignore that we don't have ASAN symbols linked in.
250 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700251 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700252}
253
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700254// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
255// it can confuse these tools pretty easily. If this builds successfully, then
256// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
257// enabled. The library that results from building this is meant to be unused.
258cc_test_library {
259 name: "fortify_disabled_for_tidy",
260 cflags: [
261 "-Werror",
262 "-D_FORTIFY_SOURCE=2",
263 "-D__clang_analyzer__",
264 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700265 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700266}
267
Colin Cross2722ebb2016-07-11 16:20:06 -0700268cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700269 name: "libfortify1-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800270 defaults: [
271 "bionic_fortify_tests_defaults",
272 "bionic_tests_defaults",
273 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700274 cflags: [
275 "-D_FORTIFY_SOURCE=1",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800276 "-DTEST_NAME=Fortify1_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700277 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700278 shared: {
279 enabled: false,
280 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700281}
282
283cc_test_library {
284 name: "libfortify2-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800285 defaults: [
286 "bionic_fortify_tests_defaults",
287 "bionic_tests_defaults",
288 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700289 cflags: [
290 "-D_FORTIFY_SOURCE=2",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800291 "-DTEST_NAME=Fortify2_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700292 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700293 shared: {
294 enabled: false,
295 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700296}
297
298// -----------------------------------------------------------------------------
299// Library of all tests (excluding the dynamic linker tests).
300// -----------------------------------------------------------------------------
301cc_test_library {
302 name: "libBionicTests",
303 defaults: ["bionic_tests_defaults"],
304 whole_static_libs: [
305 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700306 "libfortify1-tests-clang",
307 "libfortify2-tests-clang",
308 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700309 shared: {
310 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700311 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700312}
313
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700314cc_test_library {
315 name: "libBionicLoaderTests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800316 defaults: [
317 "bionic_tests_defaults",
318 "llvm-defaults",
319 ],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700320 srcs: [
321 "atexit_test.cpp",
322 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700323 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700324 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700325 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700326 "pthread_dlfcn_test.cpp",
327 ],
328 static_libs: [
329 "libbase",
330 ],
331 include_dirs: [
332 "bionic/libc",
333 ],
334 shared: {
335 enabled: false,
336 },
337 target: {
338 android: {
339 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700340 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700341 "dlext_test.cpp",
342 "libdl_test.cpp",
343 ],
344 static_libs: [
345 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700346 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800347 "libLLVMObject",
348 "libLLVMBitReader",
349 "libLLVMMC",
350 "libLLVMMCParser",
351 "libLLVMCore",
352 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700353 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800354 },
Jiyong Park02586a22017-05-20 01:01:24 +0900355 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700356}
357
Colin Cross2722ebb2016-07-11 16:20:06 -0700358// -----------------------------------------------------------------------------
359// Library of bionic customized gtest main function, with normal gtest output format,
360// which is needed by bionic cts test.
361// -----------------------------------------------------------------------------
362cc_test_library {
363 name: "libBionicCtsGtestMain",
364 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700365 srcs: [
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700366 "gtest_globals_cts.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700367 "gtest_main.cpp",
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700368 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700369 shared: {
370 enabled: false,
371 },
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700372 whole_static_libs: [
373 "libgtest_isolated",
374 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700375}
376
377// -----------------------------------------------------------------------------
378// Tests for the device using bionic's .so. Run with:
Bernie Innocentib6647242018-06-18 14:14:43 +0900379// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
380// adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests
Colin Cross2722ebb2016-07-11 16:20:06 -0700381// -----------------------------------------------------------------------------
382cc_defaults {
383 name: "bionic_unit_tests_defaults",
384 host_supported: false,
385
386 whole_static_libs: [
387 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700388 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700389 ],
390
391 static_libs: [
392 "libtinyxml2",
393 "liblog",
394 "libbase",
395 ],
396
397 srcs: [
398 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700399 "__cxa_thread_atexit_test.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700400 "gtest_globals.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700401 "thread_local_test.cpp",
402 ],
403
404 conlyflags: [
405 "-fexceptions",
406 "-fnon-call-exceptions",
407 ],
408
409 ldflags: ["-Wl,--export-dynamic"],
410
411 include_dirs: ["bionic/libc"],
412
Yabin Cui1f553ea2017-01-13 12:31:59 -0800413 stl: "libc++_static",
414
Colin Cross2722ebb2016-07-11 16:20:06 -0700415 target: {
416 android: {
417 shared_libs: [
dimitry321476a2018-01-29 15:32:37 +0100418 "ld-android",
Colin Cross2722ebb2016-07-11 16:20:06 -0700419 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700420 "libdl_preempt_test_1",
421 "libdl_preempt_test_2",
422 "libdl_test_df_1_global",
423 ],
424 static_libs: [
425 // The order of these libraries matters, do not shuffle them.
426 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700427 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700428 "libziparchive",
429 "libz",
430 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800431 "libLLVMObject",
432 "libLLVMBitReader",
433 "libLLVMMC",
434 "libLLVMMCParser",
435 "libLLVMCore",
436 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700437 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700438 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700439 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700440 "-Wl,--enable-new-dtags",
441 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700442 },
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800443 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700444}
445
446cc_test {
447 name: "bionic-unit-tests",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700448 gtest: false,
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800449 defaults: [
450 "bionic_unit_tests_defaults",
451 "bionic_tests_defaults",
452 ],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800453
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700454 srcs: [
455 "gtest_main.cpp",
456 ],
457
458 static_libs: [
459 "libgtest_isolated",
460 ],
461
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800462 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",
Ryan Prichard8f639a42018-10-01 23:10:05 -0700471 "exec_linker_helper",
472 "exec_linker_helper_lib",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700473 "libtest_dt_runpath_a",
474 "libtest_dt_runpath_b",
475 "libtest_dt_runpath_c",
476 "libtest_dt_runpath_x",
477 "libatest_simple_zip",
478 "libcfi-test",
479 "libcfi-test-bad",
480 "libdlext_test_different_soname",
481 "libdlext_test_fd",
482 "libdlext_test_norelro",
483 "libdlext_test_runpath_zip_zipaligned",
484 "libdlext_test",
485 "libdlext_test_zip",
486 "libdlext_test_zip_zipaligned",
487 "libdl_preempt_test_1",
488 "libdl_preempt_test_2",
489 "libdl_test_df_1_global",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700490 "libelf-tls-library",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700491 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700492 "libsysv-hash-table-library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700493 "libtestshared",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700494 "libtest_atexit",
495 "libtest_check_order_dlsym_1_left",
496 "libtest_check_order_dlsym_2_right",
497 "libtest_check_order_dlsym_3_c",
498 "libtest_check_order_dlsym_a",
499 "libtest_check_order_dlsym_b",
500 "libtest_check_order_dlsym_d",
501 "libtest_check_order_dlsym",
502 "libtest_check_order_reloc_root_1",
503 "libtest_check_order_reloc_root_2",
504 "libtest_check_order_reloc_root",
505 "libtest_check_order_reloc_siblings_1",
506 "libtest_check_order_reloc_siblings_2",
507 "libtest_check_order_reloc_siblings_3",
508 "libtest_check_order_reloc_siblings_a",
509 "libtest_check_order_reloc_siblings_b",
510 "libtest_check_order_reloc_siblings_c_1",
511 "libtest_check_order_reloc_siblings_c_2",
512 "libtest_check_order_reloc_siblings_c",
513 "libtest_check_order_reloc_siblings_d",
514 "libtest_check_order_reloc_siblings_e",
515 "libtest_check_order_reloc_siblings_f",
516 "libtest_check_order_reloc_siblings",
517 "libtest_check_rtld_next_from_library",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700518 "libtest_dlopen_df_1_global",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700519 "libtest_dlopen_from_ctor_main",
520 "libtest_dlopen_from_ctor",
521 "libtest_dlopen_weak_undefined_func",
522 "libtest_dlsym_df_1_global",
523 "libtest_dlsym_from_this_child",
524 "libtest_dlsym_from_this_grandchild",
525 "libtest_dlsym_from_this",
526 "libtest_dlsym_weak_func",
527 "libtest_dt_runpath_d",
528 "libtest_empty",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700529 "libtest_ifunc_variable_impl",
530 "libtest_ifunc_variable",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700531 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700532 "libtest_init_fini_order_child",
533 "libtest_init_fini_order_grand_child",
534 "libtest_init_fini_order_root2",
535 "libtest_init_fini_order_root",
Pirama Arumuga Nainar1395f702018-03-28 15:27:12 -0700536 "libtest_missing_symbol_child_public",
Elliott Hughes06d31c92018-03-29 11:28:53 -0700537 "libtest_missing_symbol_child_private",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700538 "libtest_missing_symbol_root",
539 "libtest_missing_symbol",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700540 "libtest_nodelete_1",
541 "libtest_nodelete_2",
542 "libtest_nodelete_dt_flags_1",
543 "libtest_pthread_atfork",
544 "libtest_relo_check_dt_needed_order_1",
545 "libtest_relo_check_dt_needed_order_2",
546 "libtest_relo_check_dt_needed_order",
547 "libtest_simple",
548 "libtest_two_parents_child",
549 "libtest_two_parents_parent1",
550 "libtest_two_parents_parent2",
551 "libtest_versioned_lib",
552 "libtest_versioned_libv1",
553 "libtest_versioned_libv2",
554 "libtest_versioned_otherlib_empty",
555 "libtest_versioned_otherlib",
556 "libtest_versioned_uselibv1",
557 "libtest_versioned_uselibv2_other",
558 "libtest_versioned_uselibv2",
559 "libtest_versioned_uselibv3_other",
560 "libtest_with_dependency_loop_a",
561 "libtest_with_dependency_loop_b",
562 "libtest_with_dependency_loop_c",
563 "libtest_with_dependency_loop",
564 "libtest_with_dependency",
dimitry55547db2018-05-25 14:17:37 +0200565 "libtest_indirect_thread_local_dtor",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700566 "libtest_invalid-empty_shdr_table.so",
567 "libtest_invalid-rw_load_segment.so",
568 "libtest_invalid-unaligned_shdr_offset.so",
569 "libtest_invalid-zero_shdr_table_content.so",
570 "libtest_invalid-zero_shdr_table_offset.so",
571 "libtest_invalid-zero_shentsize.so",
572 "libtest_invalid-zero_shstrndx.so",
573 "libtest_invalid-textrels.so",
574 "libtest_invalid-textrels2.so",
Pirama Arumuga Nainarc53e8b82018-03-27 10:32:19 -0700575 "libtest_thread_local_dtor",
dimitry55547db2018-05-25 14:17:37 +0200576 "libtest_thread_local_dtor2",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700577 "preinit_getauxval_test_helper",
578 "preinit_syscall_test_helper",
579 "libnstest_private_external",
580 "libnstest_dlopened",
581 "libnstest_private",
582 "libnstest_root_not_isolated",
583 "libnstest_root",
584 "libnstest_public",
585 "libnstest_public_internal",
Logan Chien9ee45912018-01-18 12:05:09 +0800586 "libnstest_ns_a_public1",
587 "libnstest_ns_a_public1_internal",
588 "libnstest_ns_b_public2",
589 "libnstest_ns_b_public3",
Jiyong Parkce10b162018-03-29 10:34:41 +0900590 "ld_preload_test_helper",
591 "ld_preload_test_helper_lib1",
Elliott Hughes51466522018-03-29 11:17:37 -0700592 "ld_preload_test_helper_lib2",
Jiyong Parkce10b162018-03-29 10:34:41 +0900593 "ld_config_test_helper",
594 "ld_config_test_helper_lib1",
595 "ld_config_test_helper_lib2",
596 "ld_config_test_helper_lib3",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700597 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700598}
599
Colin Cross2722ebb2016-07-11 16:20:06 -0700600// -----------------------------------------------------------------------------
601// Tests for the device linked against bionic's static library. Run with:
Bernie Innocentib6647242018-06-18 14:14:43 +0900602// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static
603// adb shell /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static
Colin Cross2722ebb2016-07-11 16:20:06 -0700604// -----------------------------------------------------------------------------
605cc_test {
606 name: "bionic-unit-tests-static",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700607 gtest: false,
Colin Cross2722ebb2016-07-11 16:20:06 -0700608 defaults: ["bionic_tests_defaults"],
609 host_supported: false,
610
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800611 srcs: [
612 "gtest_preinit_debuggerd.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700613 "gtest_globals.cpp",
614 "gtest_main.cpp",
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800615 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700616 whole_static_libs: [
617 "libBionicTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700618 ],
619
620 static_libs: [
621 "libm",
622 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700623 "libdl",
624 "libtinyxml2",
625 "liblog",
626 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700627 "libdebuggerd_handler",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700628 "libgtest_isolated",
Colin Cross2722ebb2016-07-11 16:20:06 -0700629 ],
630
631 static_executable: true,
632 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700633}
634
635// -----------------------------------------------------------------------------
636// Tests to run on the host and linked against glibc. Run with:
637// cd bionic/tests; mm bionic-unit-tests-glibc-run
638// -----------------------------------------------------------------------------
639
640cc_test_host {
641 name: "bionic-unit-tests-glibc",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700642 gtest: false,
Colin Cross2722ebb2016-07-11 16:20:06 -0700643 defaults: ["bionic_tests_defaults"],
644
645 srcs: [
646 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700647 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700648 "dlfcn_test.cpp",
649 "dl_test.cpp",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700650 "gtest_globals.cpp",
651 "gtest_main.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700652 "pthread_dlfcn_test.cpp",
653 ],
654
655 shared_libs: [
656 "libdl_preempt_test_1",
657 "libdl_preempt_test_2",
658
659 "libdl_test_df_1_global",
660 ],
661
662 whole_static_libs: [
663 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700664 "libfortify1-tests-clang",
665 "libfortify2-tests-clang",
666 ],
667
668 static_libs: [
669 "libbase",
670 "liblog",
671 "libcutils",
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700672 "libgtest_isolated",
Colin Cross2722ebb2016-07-11 16:20:06 -0700673 ],
674
675 host_ldlibs: [
676 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700677 "-lutil",
678 ],
679
Christopher Ferris6d2c0bd2018-08-21 18:13:10 -0700680 include_dirs: [
681 "bionic/libc",
682 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700683
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800684 ldflags: [
685 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
686 "-Wl,--export-dynamic",
687 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700688
689 sanitize: {
690 never: false,
691 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700692
693 target: {
694 linux_bionic: {
695 enabled: false,
696 },
697 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700698}
699
Elliott Hughes21b56eb2017-10-20 17:57:17 -0700700subdirs = ["*"]