2016-07-12 01:20:06 +02:00
|
|
|
//
|
|
|
|
// Copyright (C) 2012 The Android Open Source Project
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
|
|
|
cc_defaults {
|
|
|
|
name: "bionic_tests_defaults",
|
|
|
|
host_supported: true,
|
2018-02-21 00:40:02 +01:00
|
|
|
cpp_std: "experimental",
|
2016-07-12 01:20:06 +02:00
|
|
|
target: {
|
|
|
|
darwin: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
cflags: [
|
|
|
|
"-fstack-protector-all",
|
|
|
|
"-g",
|
|
|
|
"-Wall",
|
|
|
|
"-Wextra",
|
|
|
|
"-Wunused",
|
|
|
|
"-Werror",
|
|
|
|
"-fno-builtin",
|
|
|
|
|
|
|
|
// We want to test deprecated API too.
|
|
|
|
"-Wno-deprecated-declarations",
|
|
|
|
|
|
|
|
// For glibc.
|
|
|
|
"-D__STDC_LIMIT_MACROS",
|
|
|
|
],
|
|
|
|
stl: "libc++",
|
|
|
|
sanitize: {
|
|
|
|
never: true,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// All standard tests.
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2018-03-16 22:15:01 +01:00
|
|
|
// Test diagnostics emitted by clang. The library that results is useless; we
|
|
|
|
// just want to run '-Xclang -verify', which will fail if the diagnostics don't
|
|
|
|
// match up with what the source file says they should be.
|
|
|
|
cc_test_library {
|
|
|
|
name: "clang_diagnostic_tests",
|
|
|
|
cflags: [
|
|
|
|
"-Xclang",
|
|
|
|
"-verify",
|
|
|
|
],
|
|
|
|
srcs: ["sys_ioctl_diag_test.cpp"],
|
|
|
|
}
|
|
|
|
|
2016-07-12 01:20:06 +02:00
|
|
|
cc_test_library {
|
|
|
|
name: "libBionicStandardTests",
|
|
|
|
defaults: ["bionic_tests_defaults"],
|
|
|
|
srcs: [
|
2015-02-27 13:01:59 +01:00
|
|
|
"alloca_test.cpp",
|
2018-09-06 22:26:08 +02:00
|
|
|
"android_get_device_api_level.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"arpa_inet_test.cpp",
|
2017-04-25 02:48:32 +02:00
|
|
|
"async_safe_test.cpp",
|
2016-07-25 18:20:57 +02:00
|
|
|
"assert_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"buffer_tests.cpp",
|
|
|
|
"bug_26110743_test.cpp",
|
2015-02-27 13:01:59 +01:00
|
|
|
"byteswap_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"complex_test.cpp",
|
2017-09-15 00:30:08 +02:00
|
|
|
"complex_force_long_double_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"ctype_test.cpp",
|
|
|
|
"dirent_test.cpp",
|
2017-05-01 07:56:10 +02:00
|
|
|
"elf_test.cpp",
|
2017-02-25 01:19:53 +01:00
|
|
|
"endian_test.cpp",
|
2017-06-13 23:43:53 +02:00
|
|
|
"errno_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"error_test.cpp",
|
|
|
|
"eventfd_test.cpp",
|
|
|
|
"fcntl_test.cpp",
|
2018-06-02 00:30:54 +02:00
|
|
|
"fdsan_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"fenv_test.cpp",
|
2017-08-30 00:28:33 +02:00
|
|
|
"float_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"ftw_test.cpp",
|
|
|
|
"getauxval_test.cpp",
|
|
|
|
"getcwd_test.cpp",
|
2017-09-27 02:09:07 +02:00
|
|
|
"glob_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"grp_pwd_test.cpp",
|
2018-02-03 01:10:07 +01:00
|
|
|
"grp_pwd_file_test.cpp",
|
2017-08-16 08:16:48 +02:00
|
|
|
"iconv_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"ifaddrs_test.cpp",
|
|
|
|
"inttypes_test.cpp",
|
2017-08-30 00:28:33 +02:00
|
|
|
"iso646_test.c",
|
2016-11-19 01:27:29 +01:00
|
|
|
"langinfo_test.cpp",
|
2017-03-14 01:10:46 +01:00
|
|
|
"leak_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"libgen_basename_test.cpp",
|
|
|
|
"libgen_test.cpp",
|
2017-08-30 00:28:33 +02:00
|
|
|
"limits_test.cpp",
|
2017-04-20 22:38:49 +02:00
|
|
|
"linux_swab_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"locale_test.cpp",
|
2018-10-15 19:02:38 +02:00
|
|
|
"malloc_iterate_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"malloc_test.cpp",
|
|
|
|
"math_test.cpp",
|
2017-09-15 00:30:08 +02:00
|
|
|
"math_force_long_double_test.cpp",
|
2018-08-30 12:10:23 +02:00
|
|
|
"membarrier_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"mntent_test.cpp",
|
|
|
|
"netdb_test.cpp",
|
|
|
|
"net_if_test.cpp",
|
|
|
|
"netinet_ether_test.cpp",
|
|
|
|
"netinet_in_test.cpp",
|
2018-06-27 21:29:06 +02:00
|
|
|
"netinet_ip_icmp_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"netinet_udp_test.cpp",
|
|
|
|
"nl_types_test.cpp",
|
2018-08-30 21:15:56 +02:00
|
|
|
"poll_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"pthread_test.cpp",
|
|
|
|
"pty_test.cpp",
|
|
|
|
"regex_test.cpp",
|
|
|
|
"resolv_test.cpp",
|
|
|
|
"sched_test.cpp",
|
2017-05-26 02:13:32 +02:00
|
|
|
"scsi_sg_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"search_test.cpp",
|
|
|
|
"semaphore_test.cpp",
|
|
|
|
"setjmp_test.cpp",
|
|
|
|
"signal_test.cpp",
|
2017-10-07 01:58:36 +02:00
|
|
|
"spawn_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"stack_protector_test.cpp",
|
|
|
|
"stack_protector_test_helper.cpp",
|
|
|
|
"stack_unwinding_test.cpp",
|
2017-08-30 00:28:33 +02:00
|
|
|
"stdalign_test.cpp",
|
|
|
|
"stdarg_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"stdatomic_test.cpp",
|
2017-08-30 00:28:33 +02:00
|
|
|
"stdbool_test.c",
|
2016-07-12 01:20:06 +02:00
|
|
|
"stdint_test.cpp",
|
|
|
|
"stdio_nofortify_test.cpp",
|
|
|
|
"stdio_test.cpp",
|
|
|
|
"stdio_ext_test.cpp",
|
|
|
|
"stdlib_test.cpp",
|
2017-08-30 00:28:33 +02:00
|
|
|
"stdnoreturn_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"string_nofortify_test.cpp",
|
|
|
|
"string_test.cpp",
|
|
|
|
"string_posix_strerror_r_test.cpp",
|
|
|
|
"strings_nofortify_test.cpp",
|
|
|
|
"strings_test.cpp",
|
|
|
|
"sstream_test.cpp",
|
|
|
|
"sys_epoll_test.cpp",
|
|
|
|
"sys_mman_test.cpp",
|
2016-08-17 03:14:26 +02:00
|
|
|
"sys_msg_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"sys_personality_test.cpp",
|
|
|
|
"sys_prctl_test.cpp",
|
|
|
|
"sys_procfs_test.cpp",
|
|
|
|
"sys_ptrace_test.cpp",
|
|
|
|
"sys_quota_test.cpp",
|
2017-09-28 01:33:35 +02:00
|
|
|
"sys_random_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"sys_resource_test.cpp",
|
|
|
|
"sys_select_test.cpp",
|
2016-08-17 03:14:26 +02:00
|
|
|
"sys_sem_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"sys_sendfile_test.cpp",
|
2016-08-17 03:14:26 +02:00
|
|
|
"sys_shm_test.cpp",
|
2018-01-31 00:09:51 +01:00
|
|
|
"sys_signalfd_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"sys_socket_test.cpp",
|
|
|
|
"sys_stat_test.cpp",
|
|
|
|
"sys_statvfs_test.cpp",
|
|
|
|
"sys_syscall_test.cpp",
|
|
|
|
"sys_sysinfo_test.cpp",
|
|
|
|
"sys_sysmacros_test.cpp",
|
|
|
|
"sys_time_test.cpp",
|
|
|
|
"sys_timex_test.cpp",
|
2017-07-06 19:33:15 +02:00
|
|
|
"sys_ttydefaults_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"sys_types_test.cpp",
|
|
|
|
"sys_uio_test.cpp",
|
2018-06-27 22:30:02 +02:00
|
|
|
"sys_un_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"sys_vfs_test.cpp",
|
|
|
|
"sys_xattr_test.cpp",
|
|
|
|
"system_properties_test.cpp",
|
2017-01-24 21:43:29 +01:00
|
|
|
"system_properties_test2.cpp",
|
2017-12-14 18:43:59 +01:00
|
|
|
"termios_test.cpp",
|
2017-08-30 00:28:33 +02:00
|
|
|
"tgmath_test.c",
|
2016-07-12 01:20:06 +02:00
|
|
|
"time_test.cpp",
|
|
|
|
"uchar_test.cpp",
|
|
|
|
"unistd_nofortify_test.cpp",
|
|
|
|
"unistd_test.cpp",
|
|
|
|
"utmp_test.cpp",
|
|
|
|
"wchar_test.cpp",
|
|
|
|
"wctype_test.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc",
|
|
|
|
"external/tinyxml2",
|
|
|
|
],
|
|
|
|
|
2017-04-25 02:48:32 +02:00
|
|
|
target: {
|
2017-09-22 01:56:06 +02:00
|
|
|
bionic: {
|
2017-12-12 08:31:33 +01:00
|
|
|
whole_static_libs: [
|
|
|
|
"libasync_safe",
|
2018-10-15 19:02:38 +02:00
|
|
|
"libprocinfo",
|
2017-12-12 08:31:33 +01:00
|
|
|
"libsystemproperties",
|
|
|
|
],
|
2017-04-25 02:48:32 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2016-09-01 01:35:01 +02:00
|
|
|
static_libs: [
|
|
|
|
"libtinyxml2",
|
|
|
|
"liblog",
|
|
|
|
"libbase",
|
|
|
|
],
|
2016-09-01 20:37:39 +02:00
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
2016-12-14 00:47:25 +01:00
|
|
|
|
|
|
|
generated_headers: ["generated_android_ids"],
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Fortify tests.
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
cc_defaults {
|
|
|
|
name: "bionic_fortify_tests_defaults",
|
|
|
|
cflags: [
|
|
|
|
"-U_FORTIFY_SOURCE",
|
|
|
|
],
|
|
|
|
srcs: ["fortify_test_main.cpp"],
|
|
|
|
target: {
|
|
|
|
host: {
|
|
|
|
clang_cflags: ["-D__clang__"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2017-08-18 03:51:02 +02:00
|
|
|
// If building this fails, then we have both FORTIFY and ASAN enabled, which
|
|
|
|
// isn't desirable. (Ideally, we'd emit FORTIFY diagnostics even with ASAN
|
|
|
|
// enabled, but that's not a reality today.) This is meant to be otherwise
|
|
|
|
// unused.
|
|
|
|
cc_test_library {
|
|
|
|
name: "fortify_disabled_for_asan",
|
|
|
|
cflags: [
|
|
|
|
"-Werror",
|
|
|
|
"-D_FORTIFY_SOURCE=2",
|
|
|
|
// "sanitize: address" doesn't work on platforms where libasan isn't
|
|
|
|
// enabled. Since the intent is just to build this, we can get away with
|
|
|
|
// passing this flag on its own.
|
|
|
|
"-fsanitize=address",
|
|
|
|
],
|
|
|
|
// Ignore that we don't have ASAN symbols linked in.
|
|
|
|
allow_undefined_symbols: true,
|
2017-10-31 19:22:47 +01:00
|
|
|
srcs: ["fortify_filecheck_diagnostics_test.cpp"],
|
2017-08-18 03:51:02 +02:00
|
|
|
}
|
|
|
|
|
2017-10-31 05:41:22 +01:00
|
|
|
// Ensure we don't use FORTIFY'ed functions with the static analyzer/clang-tidy:
|
|
|
|
// it can confuse these tools pretty easily. If this builds successfully, then
|
|
|
|
// __clang_analyzer__ overrode FORTIFY. Otherwise, FORTIFY was incorrectly
|
|
|
|
// enabled. The library that results from building this is meant to be unused.
|
|
|
|
cc_test_library {
|
|
|
|
name: "fortify_disabled_for_tidy",
|
|
|
|
cflags: [
|
|
|
|
"-Werror",
|
|
|
|
"-D_FORTIFY_SOURCE=2",
|
|
|
|
"-D__clang_analyzer__",
|
|
|
|
],
|
2017-10-31 19:22:47 +01:00
|
|
|
srcs: ["fortify_filecheck_diagnostics_test.cpp"],
|
2017-10-31 05:41:22 +01:00
|
|
|
}
|
|
|
|
|
2016-07-12 01:20:06 +02:00
|
|
|
cc_test_library {
|
|
|
|
name: "libfortify1-tests-clang",
|
2018-02-06 02:30:57 +01:00
|
|
|
defaults: [
|
|
|
|
"bionic_fortify_tests_defaults",
|
|
|
|
"bionic_tests_defaults",
|
|
|
|
],
|
2016-07-12 01:20:06 +02:00
|
|
|
cflags: [
|
|
|
|
"-D_FORTIFY_SOURCE=1",
|
2018-02-06 02:30:57 +01:00
|
|
|
"-DTEST_NAME=Fortify1_clang",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
2016-09-01 20:37:39 +02:00
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_test_library {
|
|
|
|
name: "libfortify2-tests-clang",
|
2018-02-06 02:30:57 +01:00
|
|
|
defaults: [
|
|
|
|
"bionic_fortify_tests_defaults",
|
|
|
|
"bionic_tests_defaults",
|
|
|
|
],
|
2016-07-12 01:20:06 +02:00
|
|
|
cflags: [
|
|
|
|
"-D_FORTIFY_SOURCE=2",
|
2018-02-06 02:30:57 +01:00
|
|
|
"-DTEST_NAME=Fortify2_clang",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
2016-09-01 20:37:39 +02:00
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Library of all tests (excluding the dynamic linker tests).
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
cc_test_library {
|
|
|
|
name: "libBionicTests",
|
|
|
|
defaults: ["bionic_tests_defaults"],
|
|
|
|
whole_static_libs: [
|
|
|
|
"libBionicStandardTests",
|
|
|
|
"libfortify1-tests-clang",
|
|
|
|
"libfortify2-tests-clang",
|
|
|
|
],
|
2016-09-01 01:35:01 +02:00
|
|
|
shared: {
|
|
|
|
enabled: false,
|
2016-09-01 20:37:39 +02:00
|
|
|
},
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
2016-09-16 01:25:31 +02:00
|
|
|
cc_test_library {
|
|
|
|
name: "libBionicLoaderTests",
|
2018-02-06 02:30:57 +01:00
|
|
|
defaults: [
|
|
|
|
"bionic_tests_defaults",
|
|
|
|
"llvm-defaults",
|
|
|
|
],
|
2016-09-16 01:25:31 +02:00
|
|
|
srcs: [
|
|
|
|
"atexit_test.cpp",
|
|
|
|
"dl_test.cpp",
|
2016-09-19 19:50:28 +02:00
|
|
|
"dlfcn_symlink_support.cpp",
|
2016-09-16 01:25:31 +02:00
|
|
|
"dlfcn_test.cpp",
|
2017-04-22 02:15:41 +02:00
|
|
|
"link_test.cpp",
|
2016-09-16 01:25:31 +02:00
|
|
|
"pthread_dlfcn_test.cpp",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"libbase",
|
|
|
|
],
|
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc",
|
|
|
|
],
|
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
target: {
|
|
|
|
android: {
|
|
|
|
srcs: [
|
2016-07-06 22:20:59 +02:00
|
|
|
"cfi_test.cpp",
|
2016-09-16 01:25:31 +02:00
|
|
|
"dlext_test.cpp",
|
|
|
|
"libdl_test.cpp",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"libpagemap",
|
2017-07-06 07:36:20 +02:00
|
|
|
"libziparchive",
|
2016-11-21 21:50:38 +01:00
|
|
|
"libLLVMObject",
|
|
|
|
"libLLVMBitReader",
|
|
|
|
"libLLVMMC",
|
|
|
|
"libLLVMMCParser",
|
|
|
|
"libLLVMCore",
|
|
|
|
"libLLVMSupport",
|
2016-09-16 01:25:31 +02:00
|
|
|
],
|
2018-02-06 02:30:57 +01:00
|
|
|
},
|
2017-05-19 18:01:24 +02:00
|
|
|
},
|
2016-09-16 01:25:31 +02:00
|
|
|
}
|
|
|
|
|
2016-07-12 01:20:06 +02:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Library of bionic customized gtest main function, with normal gtest output format,
|
|
|
|
// which is needed by bionic cts test.
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
cc_test_library {
|
|
|
|
name: "libBionicCtsGtestMain",
|
|
|
|
defaults: ["bionic_tests_defaults"],
|
2016-09-21 20:17:13 +02:00
|
|
|
srcs: [
|
|
|
|
"gtest_globals_cts.cpp",
|
2018-08-22 03:13:10 +02:00
|
|
|
"gtest_main.cpp",
|
2016-09-21 20:17:13 +02:00
|
|
|
],
|
2016-09-01 20:37:39 +02:00
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
2018-08-22 03:13:10 +02:00
|
|
|
whole_static_libs: [
|
|
|
|
"libgtest_isolated",
|
|
|
|
],
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Tests for the device using bionic's .so. Run with:
|
2018-06-18 07:14:43 +02:00
|
|
|
// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
|
|
|
|
// adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests
|
2016-07-12 01:20:06 +02:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
cc_defaults {
|
|
|
|
name: "bionic_unit_tests_defaults",
|
|
|
|
host_supported: false,
|
|
|
|
|
|
|
|
whole_static_libs: [
|
|
|
|
"libBionicTests",
|
2016-09-16 01:25:31 +02:00
|
|
|
"libBionicLoaderTests",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libtinyxml2",
|
|
|
|
"liblog",
|
|
|
|
"libbase",
|
|
|
|
],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
// TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
|
|
|
|
"__cxa_thread_atexit_test.cpp",
|
2018-08-22 03:13:10 +02:00
|
|
|
"gtest_globals.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"thread_local_test.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
conlyflags: [
|
|
|
|
"-fexceptions",
|
|
|
|
"-fnon-call-exceptions",
|
|
|
|
],
|
|
|
|
|
|
|
|
ldflags: ["-Wl,--export-dynamic"],
|
|
|
|
|
|
|
|
include_dirs: ["bionic/libc"],
|
|
|
|
|
2017-01-13 21:31:59 +01:00
|
|
|
stl: "libc++_static",
|
|
|
|
|
2016-07-12 01:20:06 +02:00
|
|
|
target: {
|
|
|
|
android: {
|
|
|
|
shared_libs: [
|
2018-01-29 15:32:37 +01:00
|
|
|
"ld-android",
|
2016-07-12 01:20:06 +02:00
|
|
|
"libdl",
|
|
|
|
"libdl_preempt_test_1",
|
|
|
|
"libdl_preempt_test_2",
|
|
|
|
"libdl_test_df_1_global",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
// The order of these libraries matters, do not shuffle them.
|
|
|
|
"libbase",
|
2016-09-16 01:25:31 +02:00
|
|
|
"libpagemap",
|
2016-07-12 01:20:06 +02:00
|
|
|
"libziparchive",
|
|
|
|
"libz",
|
|
|
|
"libutils",
|
2016-11-21 21:50:38 +01:00
|
|
|
"libLLVMObject",
|
|
|
|
"libLLVMBitReader",
|
|
|
|
"libLLVMMC",
|
|
|
|
"libLLVMMCParser",
|
|
|
|
"libLLVMCore",
|
|
|
|
"libLLVMSupport",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
2016-09-01 20:37:39 +02:00
|
|
|
ldflags: [
|
2016-09-29 23:08:13 +02:00
|
|
|
"-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
|
2016-09-01 20:37:39 +02:00
|
|
|
"-Wl,--enable-new-dtags",
|
|
|
|
],
|
2016-07-12 01:20:06 +02:00
|
|
|
},
|
2018-02-06 02:30:57 +01:00
|
|
|
},
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "bionic-unit-tests",
|
2018-08-22 03:13:10 +02:00
|
|
|
gtest: false,
|
2018-02-06 02:30:57 +01:00
|
|
|
defaults: [
|
|
|
|
"bionic_unit_tests_defaults",
|
|
|
|
"bionic_tests_defaults",
|
|
|
|
],
|
2016-11-18 03:18:08 +01:00
|
|
|
|
2018-08-22 03:13:10 +02:00
|
|
|
srcs: [
|
|
|
|
"gtest_main.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libgtest_isolated",
|
|
|
|
],
|
|
|
|
|
2016-11-18 03:18:08 +01:00
|
|
|
target: {
|
|
|
|
android: {
|
|
|
|
shared_libs: ["libicuuc"],
|
|
|
|
},
|
|
|
|
},
|
2017-04-11 01:52:25 +02:00
|
|
|
|
|
|
|
required: [
|
|
|
|
"cfi_test_helper",
|
|
|
|
"cfi_test_helper2",
|
2018-10-02 08:10:05 +02:00
|
|
|
"exec_linker_helper",
|
|
|
|
"exec_linker_helper_lib",
|
2017-04-11 01:52:25 +02:00
|
|
|
"libtest_dt_runpath_a",
|
|
|
|
"libtest_dt_runpath_b",
|
|
|
|
"libtest_dt_runpath_c",
|
|
|
|
"libtest_dt_runpath_x",
|
|
|
|
"libatest_simple_zip",
|
|
|
|
"libcfi-test",
|
|
|
|
"libcfi-test-bad",
|
|
|
|
"libdlext_test_different_soname",
|
|
|
|
"libdlext_test_fd",
|
|
|
|
"libdlext_test_norelro",
|
|
|
|
"libdlext_test_runpath_zip_zipaligned",
|
|
|
|
"libdlext_test",
|
|
|
|
"libdlext_test_zip",
|
|
|
|
"libdlext_test_zip_zipaligned",
|
|
|
|
"libdl_preempt_test_1",
|
|
|
|
"libdl_preempt_test_2",
|
|
|
|
"libdl_test_df_1_global",
|
2018-03-27 19:32:19 +02:00
|
|
|
"libelf-tls-library",
|
2017-04-19 20:58:52 +02:00
|
|
|
"libgnu-hash-table-library",
|
2017-04-11 01:52:25 +02:00
|
|
|
"libsysv-hash-table-library",
|
2018-03-27 19:32:19 +02:00
|
|
|
"libtestshared",
|
2017-04-11 01:52:25 +02:00
|
|
|
"libtest_atexit",
|
|
|
|
"libtest_check_order_dlsym_1_left",
|
|
|
|
"libtest_check_order_dlsym_2_right",
|
|
|
|
"libtest_check_order_dlsym_3_c",
|
|
|
|
"libtest_check_order_dlsym_a",
|
|
|
|
"libtest_check_order_dlsym_b",
|
|
|
|
"libtest_check_order_dlsym_d",
|
|
|
|
"libtest_check_order_dlsym",
|
|
|
|
"libtest_check_order_reloc_root_1",
|
|
|
|
"libtest_check_order_reloc_root_2",
|
|
|
|
"libtest_check_order_reloc_root",
|
|
|
|
"libtest_check_order_reloc_siblings_1",
|
|
|
|
"libtest_check_order_reloc_siblings_2",
|
|
|
|
"libtest_check_order_reloc_siblings_3",
|
|
|
|
"libtest_check_order_reloc_siblings_a",
|
|
|
|
"libtest_check_order_reloc_siblings_b",
|
|
|
|
"libtest_check_order_reloc_siblings_c_1",
|
|
|
|
"libtest_check_order_reloc_siblings_c_2",
|
|
|
|
"libtest_check_order_reloc_siblings_c",
|
|
|
|
"libtest_check_order_reloc_siblings_d",
|
|
|
|
"libtest_check_order_reloc_siblings_e",
|
|
|
|
"libtest_check_order_reloc_siblings_f",
|
|
|
|
"libtest_check_order_reloc_siblings",
|
|
|
|
"libtest_check_rtld_next_from_library",
|
2018-03-27 19:32:19 +02:00
|
|
|
"libtest_dlopen_df_1_global",
|
2017-04-11 01:52:25 +02:00
|
|
|
"libtest_dlopen_from_ctor_main",
|
|
|
|
"libtest_dlopen_from_ctor",
|
|
|
|
"libtest_dlopen_weak_undefined_func",
|
|
|
|
"libtest_dlsym_df_1_global",
|
|
|
|
"libtest_dlsym_from_this_child",
|
|
|
|
"libtest_dlsym_from_this_grandchild",
|
|
|
|
"libtest_dlsym_from_this",
|
|
|
|
"libtest_dlsym_weak_func",
|
|
|
|
"libtest_dt_runpath_d",
|
|
|
|
"libtest_empty",
|
2018-03-27 19:32:19 +02:00
|
|
|
"libtest_ifunc_variable_impl",
|
|
|
|
"libtest_ifunc_variable",
|
2017-04-19 20:58:52 +02:00
|
|
|
"libtest_ifunc",
|
2017-04-11 01:52:25 +02:00
|
|
|
"libtest_init_fini_order_child",
|
|
|
|
"libtest_init_fini_order_grand_child",
|
|
|
|
"libtest_init_fini_order_root2",
|
|
|
|
"libtest_init_fini_order_root",
|
2018-03-29 00:27:12 +02:00
|
|
|
"libtest_missing_symbol_child_public",
|
2018-03-29 20:28:53 +02:00
|
|
|
"libtest_missing_symbol_child_private",
|
2018-03-27 19:32:19 +02:00
|
|
|
"libtest_missing_symbol_root",
|
|
|
|
"libtest_missing_symbol",
|
2017-04-11 01:52:25 +02:00
|
|
|
"libtest_nodelete_1",
|
|
|
|
"libtest_nodelete_2",
|
|
|
|
"libtest_nodelete_dt_flags_1",
|
|
|
|
"libtest_pthread_atfork",
|
|
|
|
"libtest_relo_check_dt_needed_order_1",
|
|
|
|
"libtest_relo_check_dt_needed_order_2",
|
|
|
|
"libtest_relo_check_dt_needed_order",
|
|
|
|
"libtest_simple",
|
|
|
|
"libtest_two_parents_child",
|
|
|
|
"libtest_two_parents_parent1",
|
|
|
|
"libtest_two_parents_parent2",
|
|
|
|
"libtest_versioned_lib",
|
|
|
|
"libtest_versioned_libv1",
|
|
|
|
"libtest_versioned_libv2",
|
|
|
|
"libtest_versioned_otherlib_empty",
|
|
|
|
"libtest_versioned_otherlib",
|
|
|
|
"libtest_versioned_uselibv1",
|
|
|
|
"libtest_versioned_uselibv2_other",
|
|
|
|
"libtest_versioned_uselibv2",
|
|
|
|
"libtest_versioned_uselibv3_other",
|
|
|
|
"libtest_with_dependency_loop_a",
|
|
|
|
"libtest_with_dependency_loop_b",
|
|
|
|
"libtest_with_dependency_loop_c",
|
|
|
|
"libtest_with_dependency_loop",
|
|
|
|
"libtest_with_dependency",
|
2018-05-25 14:17:37 +02:00
|
|
|
"libtest_indirect_thread_local_dtor",
|
2017-04-11 01:52:25 +02:00
|
|
|
"libtest_invalid-empty_shdr_table.so",
|
|
|
|
"libtest_invalid-rw_load_segment.so",
|
|
|
|
"libtest_invalid-unaligned_shdr_offset.so",
|
|
|
|
"libtest_invalid-zero_shdr_table_content.so",
|
|
|
|
"libtest_invalid-zero_shdr_table_offset.so",
|
|
|
|
"libtest_invalid-zero_shentsize.so",
|
|
|
|
"libtest_invalid-zero_shstrndx.so",
|
|
|
|
"libtest_invalid-textrels.so",
|
|
|
|
"libtest_invalid-textrels2.so",
|
2018-03-27 19:32:19 +02:00
|
|
|
"libtest_thread_local_dtor",
|
2018-05-25 14:17:37 +02:00
|
|
|
"libtest_thread_local_dtor2",
|
2017-04-11 01:52:25 +02:00
|
|
|
"preinit_getauxval_test_helper",
|
|
|
|
"preinit_syscall_test_helper",
|
|
|
|
"libnstest_private_external",
|
|
|
|
"libnstest_dlopened",
|
|
|
|
"libnstest_private",
|
|
|
|
"libnstest_root_not_isolated",
|
|
|
|
"libnstest_root",
|
|
|
|
"libnstest_public",
|
|
|
|
"libnstest_public_internal",
|
2018-01-18 05:05:09 +01:00
|
|
|
"libnstest_ns_a_public1",
|
|
|
|
"libnstest_ns_a_public1_internal",
|
|
|
|
"libnstest_ns_b_public2",
|
|
|
|
"libnstest_ns_b_public3",
|
2018-03-29 03:34:41 +02:00
|
|
|
"ld_preload_test_helper",
|
|
|
|
"ld_preload_test_helper_lib1",
|
2018-03-29 20:17:37 +02:00
|
|
|
"ld_preload_test_helper_lib2",
|
2018-03-29 03:34:41 +02:00
|
|
|
"ld_config_test_helper",
|
|
|
|
"ld_config_test_helper_lib1",
|
|
|
|
"ld_config_test_helper_lib2",
|
|
|
|
"ld_config_test_helper_lib3",
|
2017-04-11 01:52:25 +02:00
|
|
|
],
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Tests for the device linked against bionic's static library. Run with:
|
2018-06-18 07:14:43 +02:00
|
|
|
// adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static
|
|
|
|
// adb shell /data/nativetest64/bionic-unit-tests-static/bionic-unit-tests-static
|
2016-07-12 01:20:06 +02:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
cc_test {
|
|
|
|
name: "bionic-unit-tests-static",
|
2018-08-22 03:13:10 +02:00
|
|
|
gtest: false,
|
2016-07-12 01:20:06 +02:00
|
|
|
defaults: ["bionic_tests_defaults"],
|
|
|
|
host_supported: false,
|
|
|
|
|
2017-01-06 23:49:57 +01:00
|
|
|
srcs: [
|
|
|
|
"gtest_preinit_debuggerd.cpp",
|
2018-08-22 03:13:10 +02:00
|
|
|
"gtest_globals.cpp",
|
|
|
|
"gtest_main.cpp",
|
2017-01-06 23:49:57 +01:00
|
|
|
],
|
2016-07-12 01:20:06 +02:00
|
|
|
whole_static_libs: [
|
|
|
|
"libBionicTests",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libm",
|
|
|
|
"libc",
|
|
|
|
"libdl",
|
|
|
|
"libtinyxml2",
|
|
|
|
"liblog",
|
|
|
|
"libbase",
|
2016-10-27 02:55:49 +02:00
|
|
|
"libdebuggerd_handler",
|
2018-08-22 03:13:10 +02:00
|
|
|
"libgtest_isolated",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
static_executable: true,
|
|
|
|
stl: "libc++_static",
|
2018-11-08 06:28:47 +01:00
|
|
|
|
|
|
|
// libclang_rt.builtins does not work with libm
|
|
|
|
// http://b/117167374
|
|
|
|
no_libcrt: true,
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Tests to run on the host and linked against glibc. Run with:
|
|
|
|
// cd bionic/tests; mm bionic-unit-tests-glibc-run
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
cc_test_host {
|
|
|
|
name: "bionic-unit-tests-glibc",
|
2018-08-22 03:13:10 +02:00
|
|
|
gtest: false,
|
2016-07-12 01:20:06 +02:00
|
|
|
defaults: ["bionic_tests_defaults"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"atexit_test.cpp",
|
2016-09-19 19:50:28 +02:00
|
|
|
"dlfcn_symlink_support.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"dlfcn_test.cpp",
|
|
|
|
"dl_test.cpp",
|
2018-08-22 03:13:10 +02:00
|
|
|
"gtest_globals.cpp",
|
|
|
|
"gtest_main.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"pthread_dlfcn_test.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libdl_preempt_test_1",
|
|
|
|
"libdl_preempt_test_2",
|
|
|
|
|
|
|
|
"libdl_test_df_1_global",
|
|
|
|
],
|
|
|
|
|
|
|
|
whole_static_libs: [
|
|
|
|
"libBionicStandardTests",
|
|
|
|
"libfortify1-tests-clang",
|
|
|
|
"libfortify2-tests-clang",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
|
|
|
"libcutils",
|
2018-08-22 03:13:10 +02:00
|
|
|
"libgtest_isolated",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
host_ldlibs: [
|
|
|
|
"-lresolv",
|
|
|
|
"-lutil",
|
|
|
|
],
|
|
|
|
|
2018-08-22 03:13:10 +02:00
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc",
|
|
|
|
],
|
2016-07-12 01:20:06 +02:00
|
|
|
|
2016-11-25 21:23:11 +01:00
|
|
|
ldflags: [
|
|
|
|
"-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
|
|
|
|
"-Wl,--export-dynamic",
|
|
|
|
],
|
2016-07-12 01:20:06 +02:00
|
|
|
|
|
|
|
sanitize: {
|
|
|
|
never: false,
|
|
|
|
},
|
2017-09-22 01:56:06 +02:00
|
|
|
|
|
|
|
target: {
|
|
|
|
linux_bionic: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
},
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
2017-10-21 02:57:17 +02:00
|
|
|
subdirs = ["*"]
|