blob: ec90296c6fdcbe195d85df8dd76a3a51cd64894e [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
51cc_test_library {
52 name: "libBionicStandardTests",
53 defaults: ["bionic_tests_defaults"],
54 srcs: [
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030055 "alloca_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070056 "arpa_inet_test.cpp",
Christopher Ferris7a3681e2017-04-24 17:48:32 -070057 "async_safe_test.cpp",
Elliott Hughesf6495c72016-07-25 09:20:57 -070058 "assert_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070059 "buffer_tests.cpp",
60 "bug_26110743_test.cpp",
Aleksandra Tsvetkova608b4512015-02-27 15:01:59 +030061 "byteswap_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070062 "complex_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070063 "complex_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070064 "ctype_test.cpp",
65 "dirent_test.cpp",
Elliott Hughesd390df12017-04-30 22:56:10 -070066 "elf_test.cpp",
Elliott Hughesba267f42017-02-24 16:19:53 -080067 "endian_test.cpp",
Elliott Hughese452cb12017-06-13 14:43:53 -070068 "errno_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070069 "error_test.cpp",
70 "eventfd_test.cpp",
71 "fcntl_test.cpp",
72 "fenv_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070073 "float_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070074 "ftw_test.cpp",
75 "getauxval_test.cpp",
76 "getcwd_test.cpp",
Elliott Hughesf1c568d2017-09-26 17:09:07 -070077 "glob_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070078 "grp_pwd_test.cpp",
Tom Cherry6034ef82018-02-02 16:10:07 -080079 "grp_pwd_file_test.cpp",
Elliott Hughesa6487332017-08-15 23:16:48 -070080 "iconv_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070081 "ifaddrs_test.cpp",
82 "inttypes_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070083 "iso646_test.c",
Elliott Hughesfc8e6882016-11-18 16:27:29 -080084 "langinfo_test.cpp",
Josh Gao7d15dc32017-03-13 17:10:46 -070085 "leak_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070086 "libgen_basename_test.cpp",
87 "libgen_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -070088 "limits_test.cpp",
Christopher Ferrisee1e0a32017-04-20 13:38:49 -070089 "linux_swab_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070090 "locale_test.cpp",
91 "malloc_test.cpp",
92 "math_test.cpp",
Elliott Hughes50cda382017-09-14 15:30:08 -070093 "math_force_long_double_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070094 "mntent_test.cpp",
95 "netdb_test.cpp",
96 "net_if_test.cpp",
97 "netinet_ether_test.cpp",
98 "netinet_in_test.cpp",
99 "netinet_udp_test.cpp",
100 "nl_types_test.cpp",
101 "pthread_test.cpp",
102 "pty_test.cpp",
103 "regex_test.cpp",
104 "resolv_test.cpp",
105 "sched_test.cpp",
Elliott Hughes50599392017-05-25 17:13:32 -0700106 "scsi_sg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700107 "search_test.cpp",
108 "semaphore_test.cpp",
109 "setjmp_test.cpp",
110 "signal_test.cpp",
Elliott Hughes14e3ff92017-10-06 16:58:36 -0700111 "spawn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700112 "stack_protector_test.cpp",
113 "stack_protector_test_helper.cpp",
114 "stack_unwinding_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700115 "stdalign_test.cpp",
116 "stdarg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700117 "stdatomic_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700118 "stdbool_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700119 "stdint_test.cpp",
120 "stdio_nofortify_test.cpp",
121 "stdio_test.cpp",
122 "stdio_ext_test.cpp",
123 "stdlib_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700124 "stdnoreturn_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700125 "string_nofortify_test.cpp",
126 "string_test.cpp",
127 "string_posix_strerror_r_test.cpp",
128 "strings_nofortify_test.cpp",
129 "strings_test.cpp",
130 "sstream_test.cpp",
131 "sys_epoll_test.cpp",
132 "sys_mman_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700133 "sys_msg_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700134 "sys_personality_test.cpp",
135 "sys_prctl_test.cpp",
136 "sys_procfs_test.cpp",
137 "sys_ptrace_test.cpp",
138 "sys_quota_test.cpp",
Elliott Hughes8465e962017-09-27 16:33:35 -0700139 "sys_random_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700140 "sys_resource_test.cpp",
141 "sys_select_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700142 "sys_sem_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700143 "sys_sendfile_test.cpp",
Elliott Hughes7c59f3f2016-08-16 18:14:26 -0700144 "sys_shm_test.cpp",
Elliott Hughes5905d6f2018-01-30 15:09:51 -0800145 "sys_signalfd_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700146 "sys_socket_test.cpp",
147 "sys_stat_test.cpp",
148 "sys_statvfs_test.cpp",
149 "sys_syscall_test.cpp",
150 "sys_sysinfo_test.cpp",
151 "sys_sysmacros_test.cpp",
152 "sys_time_test.cpp",
153 "sys_timex_test.cpp",
Elliott Hughes02fdd052017-07-06 10:33:15 -0700154 "sys_ttydefaults_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700155 "sys_types_test.cpp",
156 "sys_uio_test.cpp",
157 "sys_vfs_test.cpp",
158 "sys_xattr_test.cpp",
159 "system_properties_test.cpp",
Dimitry Ivanov16b2a4d2017-01-24 20:43:29 +0000160 "system_properties_test2.cpp",
Elliott Hughes5da96462017-12-14 09:43:59 -0800161 "termios_test.cpp",
Elliott Hughes45da3262017-08-29 15:28:33 -0700162 "tgmath_test.c",
Colin Cross2722ebb2016-07-11 16:20:06 -0700163 "time_test.cpp",
164 "uchar_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700165 "unistd_nofortify_test.cpp",
166 "unistd_test.cpp",
167 "utmp_test.cpp",
168 "wchar_test.cpp",
169 "wctype_test.cpp",
170 ],
171
172 include_dirs: [
173 "bionic/libc",
174 "external/tinyxml2",
175 ],
176
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700177 target: {
Dan Willemsen268ae362017-09-21 16:56:06 -0700178 bionic: {
Tom Cherrye275d6d2017-12-11 23:31:33 -0800179 whole_static_libs: [
180 "libasync_safe",
181 "libsystemproperties",
182 ],
Christopher Ferris7a3681e2017-04-24 17:48:32 -0700183 },
184 },
185
Dan Willemsen41567702016-08-31 16:35:01 -0700186 static_libs: [
187 "libtinyxml2",
188 "liblog",
189 "libbase",
190 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700191 shared: {
192 enabled: false,
193 },
Elliott Hughes3f6eee92016-12-13 23:47:25 +0000194
195 generated_headers: ["generated_android_ids"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700196}
197
198// -----------------------------------------------------------------------------
199// Fortify tests.
200// -----------------------------------------------------------------------------
201
202cc_defaults {
203 name: "bionic_fortify_tests_defaults",
204 cflags: [
Colin Cross2722ebb2016-07-11 16:20:06 -0700205 "-U_FORTIFY_SOURCE",
206 ],
207 srcs: ["fortify_test_main.cpp"],
208 target: {
209 host: {
210 clang_cflags: ["-D__clang__"],
211 },
212 },
213}
214
George Burgess IVd9551db2017-08-17 18:51:02 -0700215// If building this fails, then we have both FORTIFY and ASAN enabled, which
216// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
217// enabled, but that's not a reality today.) This is meant to be otherwise
218// unused.
219cc_test_library {
220 name: "fortify_disabled_for_asan",
221 cflags: [
222 "-Werror",
223 "-D_FORTIFY_SOURCE=2",
224 // "sanitize: address" doesn't work on platforms where libasan isn't
225 // enabled. Since the intent is just to build this, we can get away with
226 // passing this flag on its own.
227 "-fsanitize=address",
228 ],
229 // Ignore that we don't have ASAN symbols linked in.
230 allow_undefined_symbols: true,
George Burgess IV0086fc82017-10-31 11:22:47 -0700231 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVd9551db2017-08-17 18:51:02 -0700232}
233
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700234// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
235// it can confuse these tools pretty easily. If this builds successfully, then
236// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
237// enabled. The library that results from building this is meant to be unused.
238cc_test_library {
239 name: "fortify_disabled_for_tidy",
240 cflags: [
241 "-Werror",
242 "-D_FORTIFY_SOURCE=2",
243 "-D__clang_analyzer__",
244 ],
George Burgess IV0086fc82017-10-31 11:22:47 -0700245 srcs: ["fortify_filecheck_diagnostics_test.cpp"],
George Burgess IVe5d66eb2017-10-30 21:41:22 -0700246}
247
Colin Cross2722ebb2016-07-11 16:20:06 -0700248cc_test_library {
Colin Cross2722ebb2016-07-11 16:20:06 -0700249 name: "libfortify1-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800250 defaults: [
251 "bionic_fortify_tests_defaults",
252 "bionic_tests_defaults",
253 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700254 cflags: [
255 "-D_FORTIFY_SOURCE=1",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800256 "-DTEST_NAME=Fortify1_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700257 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700258 shared: {
259 enabled: false,
260 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700261}
262
263cc_test_library {
264 name: "libfortify2-tests-clang",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800265 defaults: [
266 "bionic_fortify_tests_defaults",
267 "bionic_tests_defaults",
268 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700269 cflags: [
270 "-D_FORTIFY_SOURCE=2",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800271 "-DTEST_NAME=Fortify2_clang",
Colin Cross2722ebb2016-07-11 16:20:06 -0700272 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700273 shared: {
274 enabled: false,
275 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700276}
277
278// -----------------------------------------------------------------------------
279// Library of all tests (excluding the dynamic linker tests).
280// -----------------------------------------------------------------------------
281cc_test_library {
282 name: "libBionicTests",
283 defaults: ["bionic_tests_defaults"],
284 whole_static_libs: [
285 "libBionicStandardTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700286 "libfortify1-tests-clang",
287 "libfortify2-tests-clang",
288 ],
Dan Willemsen41567702016-08-31 16:35:01 -0700289 shared: {
290 enabled: false,
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700291 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700292}
293
294// -----------------------------------------------------------------------------
295// Library of bionic customized gtest main function, with simplified output format.
296// -----------------------------------------------------------------------------
297cc_test_library {
298 name: "libBionicGtestMain",
299 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700300 srcs: [
301 "gtest_main.cpp",
302 "gtest_globals.cpp",
303 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800304 whole_static_libs: [
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700305 "libbase",
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800306 "liblog",
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700307 ],
308 include_dirs: [
309 "bionic/libc",
310 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700311 target: {
312 darwin: {
313 enabled: true,
314 },
315 },
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700316 shared: {
317 enabled: false,
318 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700319}
320
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700321cc_test_library {
322 name: "libBionicLoaderTests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800323 defaults: [
324 "bionic_tests_defaults",
325 "llvm-defaults",
326 ],
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700327 srcs: [
328 "atexit_test.cpp",
329 "dl_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700330 "dlfcn_symlink_support.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700331 "dlfcn_test.cpp",
Elliott Hughes7c10abb2017-04-21 17:15:41 -0700332 "link_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700333 "pthread_dlfcn_test.cpp",
334 ],
335 static_libs: [
336 "libbase",
337 ],
338 include_dirs: [
339 "bionic/libc",
340 ],
341 shared: {
342 enabled: false,
343 },
344 target: {
345 android: {
346 srcs: [
Evgenii Stepanov0a3637d2016-07-06 13:20:59 -0700347 "cfi_test.cpp",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700348 "dlext_test.cpp",
349 "libdl_test.cpp",
350 ],
351 static_libs: [
352 "libpagemap",
Andreas Gampeb9797fe2017-07-05 22:36:20 -0700353 "libziparchive",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800354 "libLLVMObject",
355 "libLLVMBitReader",
356 "libLLVMMC",
357 "libLLVMMCParser",
358 "libLLVMCore",
359 "libLLVMSupport",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700360 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800361 },
Jiyong Park02586a22017-05-20 01:01:24 +0900362 },
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700363}
364
Colin Cross2722ebb2016-07-11 16:20:06 -0700365// -----------------------------------------------------------------------------
366// Library of bionic customized gtest main function, with normal gtest output format,
367// which is needed by bionic cts test.
368// -----------------------------------------------------------------------------
369cc_test_library {
370 name: "libBionicCtsGtestMain",
371 defaults: ["bionic_tests_defaults"],
Dimitry Ivanov927877c2016-09-21 11:17:13 -0700372 srcs: [
373 "gtest_main.cpp",
374 "gtest_globals_cts.cpp",
375 ],
Elliott Hughes10ba4bd2017-11-14 13:11:41 -0800376 static_libs: [
377 "libbase",
378 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700379 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700380 shared: {
381 enabled: false,
382 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700383}
384
385// -----------------------------------------------------------------------------
386// Tests for the device using bionic's .so. Run with:
387// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
388// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
389// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
390// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
391// -----------------------------------------------------------------------------
392cc_defaults {
393 name: "bionic_unit_tests_defaults",
394 host_supported: false,
395
396 whole_static_libs: [
397 "libBionicTests",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700398 "libBionicLoaderTests",
Colin Cross2722ebb2016-07-11 16:20:06 -0700399 "libBionicGtestMain",
400 ],
401
402 static_libs: [
403 "libtinyxml2",
404 "liblog",
405 "libbase",
406 ],
407
408 srcs: [
409 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
Colin Cross2722ebb2016-07-11 16:20:06 -0700410 "__cxa_thread_atexit_test.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700411 "thread_local_test.cpp",
412 ],
413
414 conlyflags: [
415 "-fexceptions",
416 "-fnon-call-exceptions",
417 ],
418
419 ldflags: ["-Wl,--export-dynamic"],
420
421 include_dirs: ["bionic/libc"],
422
Yabin Cui1f553ea2017-01-13 12:31:59 -0800423 stl: "libc++_static",
424
Colin Cross2722ebb2016-07-11 16:20:06 -0700425 target: {
426 android: {
427 shared_libs: [
dimitry321476a2018-01-29 15:32:37 +0100428 "ld-android",
Colin Cross2722ebb2016-07-11 16:20:06 -0700429 "libdl",
Colin Cross2722ebb2016-07-11 16:20:06 -0700430 "libdl_preempt_test_1",
431 "libdl_preempt_test_2",
432 "libdl_test_df_1_global",
433 ],
434 static_libs: [
435 // The order of these libraries matters, do not shuffle them.
436 "libbase",
Dimitry Ivanovc462c282016-09-15 16:25:31 -0700437 "libpagemap",
Colin Cross2722ebb2016-07-11 16:20:06 -0700438 "libziparchive",
439 "libz",
440 "libutils",
Dimitry Ivanovac4bd2f2016-11-21 12:50:38 -0800441 "libLLVMObject",
442 "libLLVMBitReader",
443 "libLLVMMC",
444 "libLLVMMCParser",
445 "libLLVMCore",
446 "libLLVMSupport",
Colin Cross2722ebb2016-07-11 16:20:06 -0700447 ],
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700448 ldflags: [
Colin Cross7b294952016-09-29 14:08:13 -0700449 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
Dimitry Ivanova36e59b2016-09-01 11:37:39 -0700450 "-Wl,--enable-new-dtags",
451 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700452 },
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800453 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700454}
455
456cc_test {
457 name: "bionic-unit-tests",
Elliott Hughesd50a1de2018-02-05 17:30:57 -0800458 defaults: [
459 "bionic_unit_tests_defaults",
460 "bionic_tests_defaults",
461 ],
Elliott Hughesa57ca0d2016-11-17 18:18:08 -0800462
463 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",
472 "libtest_dt_runpath_a",
473 "libtest_dt_runpath_b",
474 "libtest_dt_runpath_c",
475 "libtest_dt_runpath_x",
476 "libatest_simple_zip",
477 "libcfi-test",
478 "libcfi-test-bad",
479 "libdlext_test_different_soname",
480 "libdlext_test_fd",
481 "libdlext_test_norelro",
482 "libdlext_test_runpath_zip_zipaligned",
483 "libdlext_test",
484 "libdlext_test_zip",
485 "libdlext_test_zip_zipaligned",
486 "libdl_preempt_test_1",
487 "libdl_preempt_test_2",
488 "libdl_test_df_1_global",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700489 "libgnu-hash-table-library",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700490 "libsysv-hash-table-library",
491 "libtest_atexit",
492 "libtest_check_order_dlsym_1_left",
493 "libtest_check_order_dlsym_2_right",
494 "libtest_check_order_dlsym_3_c",
495 "libtest_check_order_dlsym_a",
496 "libtest_check_order_dlsym_b",
497 "libtest_check_order_dlsym_d",
498 "libtest_check_order_dlsym",
499 "libtest_check_order_reloc_root_1",
500 "libtest_check_order_reloc_root_2",
501 "libtest_check_order_reloc_root",
502 "libtest_check_order_reloc_siblings_1",
503 "libtest_check_order_reloc_siblings_2",
504 "libtest_check_order_reloc_siblings_3",
505 "libtest_check_order_reloc_siblings_a",
506 "libtest_check_order_reloc_siblings_b",
507 "libtest_check_order_reloc_siblings_c_1",
508 "libtest_check_order_reloc_siblings_c_2",
509 "libtest_check_order_reloc_siblings_c",
510 "libtest_check_order_reloc_siblings_d",
511 "libtest_check_order_reloc_siblings_e",
512 "libtest_check_order_reloc_siblings_f",
513 "libtest_check_order_reloc_siblings",
514 "libtest_check_rtld_next_from_library",
515 "libtest_dlopen_from_ctor_main",
516 "libtest_dlopen_from_ctor",
517 "libtest_dlopen_weak_undefined_func",
518 "libtest_dlsym_df_1_global",
519 "libtest_dlsym_from_this_child",
520 "libtest_dlsym_from_this_grandchild",
521 "libtest_dlsym_from_this",
522 "libtest_dlsym_weak_func",
523 "libtest_dt_runpath_d",
524 "libtest_empty",
Dimitry Ivanovf1db8372017-04-19 11:58:52 -0700525 "libtest_ifunc",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700526 "libtest_init_fini_order_child",
527 "libtest_init_fini_order_grand_child",
528 "libtest_init_fini_order_root2",
529 "libtest_init_fini_order_root",
530 "libtest_nodelete_1",
531 "libtest_nodelete_2",
532 "libtest_nodelete_dt_flags_1",
533 "libtest_pthread_atfork",
534 "libtest_relo_check_dt_needed_order_1",
535 "libtest_relo_check_dt_needed_order_2",
536 "libtest_relo_check_dt_needed_order",
537 "libtest_simple",
538 "libtest_two_parents_child",
539 "libtest_two_parents_parent1",
540 "libtest_two_parents_parent2",
541 "libtest_versioned_lib",
542 "libtest_versioned_libv1",
543 "libtest_versioned_libv2",
544 "libtest_versioned_otherlib_empty",
545 "libtest_versioned_otherlib",
546 "libtest_versioned_uselibv1",
547 "libtest_versioned_uselibv2_other",
548 "libtest_versioned_uselibv2",
549 "libtest_versioned_uselibv3_other",
550 "libtest_with_dependency_loop_a",
551 "libtest_with_dependency_loop_b",
552 "libtest_with_dependency_loop_c",
553 "libtest_with_dependency_loop",
554 "libtest_with_dependency",
555 "libtest_invalid-empty_shdr_table.so",
556 "libtest_invalid-rw_load_segment.so",
557 "libtest_invalid-unaligned_shdr_offset.so",
558 "libtest_invalid-zero_shdr_table_content.so",
559 "libtest_invalid-zero_shdr_table_offset.so",
560 "libtest_invalid-zero_shentsize.so",
561 "libtest_invalid-zero_shstrndx.so",
562 "libtest_invalid-textrels.so",
563 "libtest_invalid-textrels2.so",
564 "preinit_getauxval_test_helper",
565 "preinit_syscall_test_helper",
566 "libnstest_private_external",
567 "libnstest_dlopened",
568 "libnstest_private",
569 "libnstest_root_not_isolated",
570 "libnstest_root",
571 "libnstest_public",
572 "libnstest_public_internal",
Logan Chien9ee45912018-01-18 12:05:09 +0800573 "libnstest_ns_a_public1",
574 "libnstest_ns_a_public1_internal",
575 "libnstest_ns_b_public2",
576 "libnstest_ns_b_public3",
Dimitry Ivanov4bd35422017-04-10 16:52:25 -0700577 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700578}
579
Colin Cross2722ebb2016-07-11 16:20:06 -0700580// -----------------------------------------------------------------------------
581// Tests for the device linked against bionic's static library. Run with:
582// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
583// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
584// -----------------------------------------------------------------------------
585cc_test {
586 name: "bionic-unit-tests-static",
587 defaults: ["bionic_tests_defaults"],
588 host_supported: false,
589
Dimitry Ivanov462ea662017-01-06 14:49:57 -0800590 srcs: [
591 "gtest_preinit_debuggerd.cpp",
592 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700593 whole_static_libs: [
594 "libBionicTests",
595 "libBionicGtestMain",
596 ],
597
598 static_libs: [
599 "libm",
600 "libc",
Colin Cross2722ebb2016-07-11 16:20:06 -0700601 "libdl",
602 "libtinyxml2",
603 "liblog",
604 "libbase",
Josh Gao2a3b4fa2016-10-26 17:55:49 -0700605 "libdebuggerd_handler",
Colin Cross2722ebb2016-07-11 16:20:06 -0700606 ],
607
608 static_executable: true,
609 stl: "libc++_static",
Colin Cross2722ebb2016-07-11 16:20:06 -0700610}
611
612// -----------------------------------------------------------------------------
613// Tests to run on the host and linked against glibc. Run with:
614// cd bionic/tests; mm bionic-unit-tests-glibc-run
615// -----------------------------------------------------------------------------
616
617cc_test_host {
618 name: "bionic-unit-tests-glibc",
619 defaults: ["bionic_tests_defaults"],
620
621 srcs: [
622 "atexit_test.cpp",
Dimitry Ivanov708589f2016-09-19 10:50:28 -0700623 "dlfcn_symlink_support.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -0700624 "dlfcn_test.cpp",
625 "dl_test.cpp",
626 "pthread_dlfcn_test.cpp",
627 ],
628
629 shared_libs: [
630 "libdl_preempt_test_1",
631 "libdl_preempt_test_2",
632
633 "libdl_test_df_1_global",
634 ],
635
636 whole_static_libs: [
637 "libBionicStandardTests",
638 "libBionicGtestMain",
Colin Cross2722ebb2016-07-11 16:20:06 -0700639 "libfortify1-tests-clang",
640 "libfortify2-tests-clang",
641 ],
642
643 static_libs: [
644 "libbase",
645 "liblog",
646 "libcutils",
647 ],
648
649 host_ldlibs: [
650 "-lresolv",
Colin Cross2722ebb2016-07-11 16:20:06 -0700651 "-lutil",
652 ],
653
654 include_dirs: ["bionic/libc"],
655
Dimitry Ivanovd0b5c3a2016-11-25 12:23:11 -0800656 ldflags: [
657 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
658 "-Wl,--export-dynamic",
659 ],
Colin Cross2722ebb2016-07-11 16:20:06 -0700660
661 sanitize: {
662 never: false,
663 },
Dan Willemsen268ae362017-09-21 16:56:06 -0700664
665 target: {
666 linux_bionic: {
667 enabled: false,
668 },
669 },
Colin Cross2722ebb2016-07-11 16:20:06 -0700670}
671
Elliott Hughes21b56eb2017-10-20 17:57:17 -0700672subdirs = ["*"]