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",
|
|
|
|
],
|
2020-04-29 14:14:09 +02:00
|
|
|
header_libs: ["bionic_libc_platform_headers"],
|
2020-02-25 11:25:48 +01:00
|
|
|
// Ensure that the tests exercise shadow call stack support and
|
|
|
|
// the hint space PAC/BTI instructions.
|
2018-11-13 05:09:14 +01:00
|
|
|
arch: {
|
|
|
|
arm64: {
|
2020-02-25 11:25:48 +01:00
|
|
|
cflags: [
|
|
|
|
"-fsanitize=shadow-call-stack",
|
2020-03-13 01:09:38 +01:00
|
|
|
// Disable this option for now: see b/151372823
|
|
|
|
//"-mbranch-protection=standard",
|
2020-02-25 11:25:48 +01:00
|
|
|
],
|
2018-11-13 05:09:14 +01:00
|
|
|
},
|
|
|
|
},
|
2016-07-12 01:20:06 +02:00
|
|
|
stl: "libc++",
|
|
|
|
sanitize: {
|
2019-02-06 03:43:34 +01:00
|
|
|
address: false,
|
2016-07-12 01:20:06 +02:00
|
|
|
},
|
2020-04-01 02:34:03 +02:00
|
|
|
|
|
|
|
// Use the bootstrap version of bionic because some tests call private APIs
|
|
|
|
// that aren't exposed by the APEX bionic stubs.
|
2018-12-13 10:26:48 +01:00
|
|
|
bootstrap: true,
|
2020-01-30 01:27:31 +01:00
|
|
|
|
|
|
|
product_variables: {
|
|
|
|
experimental_mte: {
|
|
|
|
cflags: ["-DANDROID_EXPERIMENTAL_MTE"],
|
|
|
|
},
|
|
|
|
},
|
2016-07-12 01:20:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// 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: [
|
2018-12-31 06:10:26 +01:00
|
|
|
"__aeabi_read_tp_test.cpp",
|
2020-02-05 00:46:15 +01:00
|
|
|
"__cxa_atexit_test.cpp",
|
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",
|
2019-11-06 22:15:00 +01:00
|
|
|
"fdtrack_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"fenv_test.cpp",
|
2020-01-30 04:20:45 +01:00
|
|
|
"_FILE_OFFSET_BITS_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",
|
2019-01-24 02:56:24 +01:00
|
|
|
"ifunc_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"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",
|
2020-01-30 01:27:31 +01:00
|
|
|
"mte_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"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",
|
2018-11-14 21:41:41 +01:00
|
|
|
"scs_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",
|
2020-02-24 18:52:14 +01:00
|
|
|
"sys_auxv_test.cpp",
|
2016-07-12 01:20:06 +02:00
|
|
|
"sys_epoll_test.cpp",
|
|
|
|
"sys_mman_test.cpp",
|
2016-08-17 03:14:26 +02:00
|
|
|
"sys_msg_test.cpp",
|
2019-03-21 22:04:33 +01:00
|
|
|
"sys_param_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",
|
2019-04-18 23:27:24 +02:00
|
|
|
"threads_test.cpp",
|
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",
|
|
|
|
],
|
|
|
|
|
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",
|
|
|
|
],
|
2020-01-08 00:47:47 +01:00
|
|
|
srcs: [
|
|
|
|
"tagged_pointers_test.cpp",
|
|
|
|
],
|
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
|
|
|
}
|
|
|
|
|
2019-01-16 05:35:00 +01:00
|
|
|
cc_test_library {
|
|
|
|
name: "libBionicElfTlsTests",
|
|
|
|
defaults: ["bionic_tests_defaults"],
|
|
|
|
srcs: [
|
|
|
|
"elftls_test.cpp",
|
|
|
|
],
|
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc",
|
|
|
|
],
|
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
cflags: [
|
|
|
|
"-fno-emulated-tls",
|
|
|
|
],
|
2019-05-01 23:26:13 +02:00
|
|
|
// With fuzzer builds, compiler instrumentation generates a reference to the
|
|
|
|
// __sancov_lowest_stack variable, which (for now) is defined by the fuzzer
|
|
|
|
// library as an emutls symbol. The -fno-emulated-tls flag above configures
|
|
|
|
// the compiler to reference an ordinary ELF TLS __sancov_lowest_stack
|
|
|
|
// symbol instead, which isn't defined. Disable the fuzzer for this test
|
|
|
|
// until the platform is switched to ELF TLS.
|
|
|
|
sanitize: {
|
|
|
|
fuzzer: false,
|
|
|
|
},
|
2019-01-16 05:35:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_test_library {
|
|
|
|
name: "libBionicElfTlsLoaderTests",
|
|
|
|
defaults: ["bionic_tests_defaults"],
|
|
|
|
srcs: [
|
|
|
|
"elftls_dl_test.cpp",
|
|
|
|
],
|
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc",
|
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
"liblog",
|
|
|
|
"libbase",
|
|
|
|
],
|
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
cflags: [
|
|
|
|
"-fno-emulated-tls",
|
|
|
|
],
|
2019-05-01 23:26:13 +02:00
|
|
|
// With fuzzer builds, compiler instrumentation generates a reference to the
|
|
|
|
// __sancov_lowest_stack variable, which (for now) is defined by the fuzzer
|
|
|
|
// library as an emutls symbol. The -fno-emulated-tls flag above configures
|
|
|
|
// the compiler to reference an ordinary ELF TLS __sancov_lowest_stack
|
|
|
|
// symbol instead, which isn't defined. Disable the fuzzer for this test
|
|
|
|
// until the platform is switched to ELF TLS.
|
|
|
|
sanitize: {
|
|
|
|
fuzzer: false,
|
|
|
|
},
|
2019-01-16 05:35:00 +01:00
|
|
|
}
|
|
|
|
|
2020-01-15 02:59:41 +01:00
|
|
|
cc_test_library {
|
|
|
|
name: "libBionicFramePointerTests",
|
|
|
|
defaults: ["bionic_tests_defaults"],
|
|
|
|
srcs: [
|
|
|
|
"android_unsafe_frame_pointer_chase_test.cpp",
|
|
|
|
],
|
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc",
|
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-fno-omit-frame-pointer",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2016-07-12 01:20:06 +02:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Fortify tests.
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2019-06-05 00:39:52 +02:00
|
|
|
cc_defaults {
|
|
|
|
name: "bionic_clang_fortify_tests_w_flags",
|
|
|
|
cflags: [
|
|
|
|
"-Wno-builtin-memcpy-chk-size",
|
2019-06-07 02:45:05 +02:00
|
|
|
"-Wno-format-security",
|
2019-06-05 00:39:52 +02:00
|
|
|
"-Wno-format-zero-length",
|
Adapt tests due to the new Clang fortify-source warning
https://reviews.llvm.org/D58797 added several new compile time
_FORTIFY_SOURCE diagnostics. This broke clang_fortify_tests:
FAILED: out/target/product/walleye/obj/STATIC_LIBRARIES/bionic-compile-time-tests2-clang++_intermediates/clang_fortify_tests.o
error: 'warning' diagnostics seen but not expected:
Line 159: 'memcpy' will always overflow; destination buffer has size 8, but size argument is 9
Line 161: 'memmove' will always overflow; destination buffer has size 8, but size argument is 9
Line 165: 'memset' will always overflow; destination buffer has size 8, but size argument is 9
Line 183: 'strncpy' size argument is too large; destination buffer has size 8, but size argument is 9
Line 185: 'stpncpy' size argument is too large; destination buffer has size 8, but size argument is 9
Line 189: 'strncat' size argument is too large; destination buffer has size 8, but size argument is 9
Line 227: 'strncpy' size argument is too large; destination buffer has size 4, but size argument is 5
Line 232: 'stpncpy' size argument is too large; destination buffer has size 4, but size argument is 5
Line 242: 'strncat' size argument is too large; destination buffer has size 4, but size argument is 5
Line 490: 'snprintf' size argument is too large; destination buffer has size 8, but size argument is 9
Line 495: 'vsnprintf' size argument is too large; destination buffer has size 8, but size argument is 9
error: 'note' diagnostics seen but not expected:
File bionic/libc/include/bits/fortify/fcntl.h Line 50: 'open' has been explicitly marked unavailable here
File bionic/libc/include/bits/fortify/fcntl.h Line 102: 'open64' has been explicitly marked unavailable here
File bionic/libc/include/bits/fortify/fcntl.h Line 75: 'openat' has been explicitly marked unavailable here
File bionic/libc/include/bits/fortify/fcntl.h Line 121: 'openat64' has been explicitly marked unavailable here
File bionic/libc/include/bits/fortify/stdio.h Line 68: 'sprintf' has been explicitly marked unavailable here
16 errors generated.
Bug: 131328001
Bug: 138701853
Test: Build with r365631 toolchain
Change-Id: I103ecb7b3abcf4b5cfc4f36ccab69e03d0976275
2019-08-04 03:26:05 +02:00
|
|
|
"-Wno-fortify-source",
|
2019-06-05 00:39:52 +02:00
|
|
|
"-Wno-memset-transposed-args",
|
2019-06-06 23:14:52 +02:00
|
|
|
"-Wno-strlcpy-strlcat-size",
|
2019-06-05 00:39:52 +02:00
|
|
|
"-Wno-strncat-size",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2016-07-12 01:20:06 +02:00
|
|
|
cc_defaults {
|
|
|
|
name: "bionic_fortify_tests_defaults",
|
|
|
|
cflags: [
|
|
|
|
"-U_FORTIFY_SOURCE",
|
|
|
|
],
|
|
|
|
srcs: ["fortify_test_main.cpp"],
|
|
|
|
target: {
|
|
|
|
host: {
|
|
|
|
clang_cflags: ["-D__clang__"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2019-10-21 22:27:57 +02:00
|
|
|
// Ensures that FORTIFY checks aren't run when ASAN is on.
|
|
|
|
cc_test {
|
|
|
|
name: "bionic-fortify-runtime-asan-test",
|
2019-06-05 00:39:52 +02:00
|
|
|
defaults: [
|
|
|
|
"bionic_clang_fortify_tests_w_flags",
|
|
|
|
],
|
2017-08-18 03:51:02 +02:00
|
|
|
cflags: [
|
|
|
|
"-Werror",
|
|
|
|
"-D_FORTIFY_SOURCE=2",
|
|
|
|
],
|
2019-10-21 22:27:57 +02:00
|
|
|
sanitize: {
|
|
|
|
address: true,
|
|
|
|
},
|
|
|
|
srcs: ["clang_fortify_asan.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",
|
2019-06-05 00:39:52 +02:00
|
|
|
defaults: [
|
|
|
|
"bionic_clang_fortify_tests_w_flags",
|
|
|
|
],
|
2017-10-31 05:41:22 +01:00
|
|
|
cflags: [
|
|
|
|
"-Werror",
|
|
|
|
"-D_FORTIFY_SOURCE=2",
|
|
|
|
"-D__clang_analyzer__",
|
|
|
|
],
|
2019-06-05 00:39:52 +02:00
|
|
|
srcs: ["clang_fortify_tests.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
|
|
|
}
|
|
|
|
|
2019-06-05 00:39:52 +02:00
|
|
|
cc_defaults {
|
|
|
|
name: "bionic_new_fortify_tests_defaults",
|
|
|
|
defaults: [
|
|
|
|
"bionic_clang_fortify_tests_w_flags",
|
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-U_FORTIFY_SOURCE",
|
|
|
|
],
|
|
|
|
srcs: ["clang_fortify_tests.cpp"],
|
|
|
|
target: {
|
|
|
|
host: {
|
|
|
|
clang_cflags: ["-D__clang__"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_test_library {
|
|
|
|
name: "libfortify1-new-tests-clang",
|
|
|
|
defaults: [
|
|
|
|
"bionic_new_fortify_tests_defaults",
|
|
|
|
"bionic_tests_defaults",
|
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-D_FORTIFY_SOURCE=1",
|
|
|
|
"-DTEST_NAME=Fortify1_clang_new",
|
|
|
|
],
|
|
|
|
shared: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_test_library {
|
|
|
|
name: "libfortify2-new-tests-clang",
|
|
|
|
defaults: [
|
|
|
|
"bionic_new_fortify_tests_defaults",
|
|
|
|
"bionic_tests_defaults",
|
|
|
|
],
|
|
|
|
cflags: [
|
|
|
|
"-D_FORTIFY_SOURCE=2",
|
|
|
|
"-DTEST_NAME=Fortify2_clang_new",
|
|
|
|
],
|
|
|
|
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",
|
2019-01-16 05:35:00 +01:00
|
|
|
"libBionicElfTlsTests",
|
2020-01-15 02:59:41 +01:00
|
|
|
"libBionicFramePointerTests",
|
2016-07-12 01:20:06 +02:00
|
|
|
"libfortify1-tests-clang",
|
2019-06-05 00:39:52 +02:00
|
|
|
"libfortify1-new-tests-clang",
|
2016-07-12 01:20:06 +02:00
|
|
|
"libfortify2-tests-clang",
|
2019-06-05 00:39:52 +02:00
|
|
|
"libfortify2-new-tests-clang",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
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: [
|
2019-01-21 23:22:05 +01:00
|
|
|
"libmeminfo",
|
2018-10-17 21:59:38 +02:00
|
|
|
"libprocinfo",
|
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,
|
2019-02-28 03:07:55 +01:00
|
|
|
gtest: false,
|
|
|
|
|
|
|
|
defaults: [
|
|
|
|
"bionic_tests_defaults",
|
|
|
|
],
|
2016-07-12 01:20:06 +02:00
|
|
|
|
|
|
|
whole_static_libs: [
|
|
|
|
"libBionicTests",
|
2016-09-16 01:25:31 +02:00
|
|
|
"libBionicLoaderTests",
|
2019-01-16 05:35:00 +01:00
|
|
|
"libBionicElfTlsLoaderTests",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libtinyxml2",
|
|
|
|
"liblog",
|
|
|
|
"libbase",
|
2019-02-28 03:07:55 +01:00
|
|
|
"libgtest_isolated",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
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",
|
2019-02-28 03:07:55 +01:00
|
|
|
"gtest_main.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",
|
2019-03-19 13:01:42 +01:00
|
|
|
"libdl_android",
|
2016-07-12 01:20:06 +02:00
|
|
|
"libdl_preempt_test_1",
|
|
|
|
"libdl_preempt_test_2",
|
|
|
|
"libdl_test_df_1_global",
|
2019-01-16 05:35:00 +01:00
|
|
|
"libtest_elftls_shared_var",
|
|
|
|
"libtest_elftls_tprel",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
|
|
|
static_libs: [
|
|
|
|
// The order of these libraries matters, do not shuffle them.
|
|
|
|
"libbase",
|
2019-01-21 23:22:05 +01:00
|
|
|
"libmeminfo",
|
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
|
|
|
},
|
2017-04-11 01:52:25 +02:00
|
|
|
|
|
|
|
required: [
|
|
|
|
"cfi_test_helper",
|
|
|
|
"cfi_test_helper2",
|
2019-01-16 05:35:00 +01:00
|
|
|
"elftls_dlopen_ie_error_helper",
|
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",
|
2019-01-19 17:41:42 +01:00
|
|
|
"libtest_dt_runpath_y",
|
2017-04-11 01:52:25 +02:00
|
|
|
"libatest_simple_zip",
|
|
|
|
"libcfi-test",
|
|
|
|
"libcfi-test-bad",
|
|
|
|
"libdlext_test_different_soname",
|
|
|
|
"libdlext_test_fd",
|
|
|
|
"libdlext_test_norelro",
|
2018-10-17 21:59:38 +02:00
|
|
|
"libdlext_test_recursive",
|
2017-04-11 01:52:25 +02:00
|
|
|
"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",
|
2017-04-19 20:58:52 +02:00
|
|
|
"libgnu-hash-table-library",
|
2020-01-28 21:18:35 +01:00
|
|
|
"librelocations-ANDROID_RELR",
|
|
|
|
"librelocations-ANDROID_REL",
|
|
|
|
"librelocations-RELR",
|
|
|
|
"librelocations-fat",
|
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",
|
2019-01-24 08:19:19 +01:00
|
|
|
"libtest_elftls_dynamic",
|
|
|
|
"libtest_elftls_dynamic_filler_1",
|
|
|
|
"libtest_elftls_dynamic_filler_2",
|
|
|
|
"libtest_elftls_dynamic_filler_3",
|
2019-01-16 05:35:00 +01:00
|
|
|
"libtest_elftls_shared_var",
|
|
|
|
"libtest_elftls_shared_var_ie",
|
|
|
|
"libtest_elftls_tprel",
|
2017-04-11 01:52:25 +02:00
|
|
|
"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",
|
2020-01-31 23:47:48 +01:00
|
|
|
"ns_hidden_child_helper",
|
|
|
|
"libns_hidden_child_global",
|
|
|
|
"libns_hidden_child_internal",
|
|
|
|
"libns_hidden_child_public",
|
|
|
|
"libns_hidden_child_app",
|
2019-03-01 22:12:49 +01:00
|
|
|
"libsegment_gap_inner",
|
|
|
|
"libsegment_gap_outer",
|
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
|
|
|
}
|
|
|
|
|
2019-02-28 03:07:55 +01:00
|
|
|
cc_test {
|
|
|
|
name: "bionic-unit-tests",
|
|
|
|
defaults: [
|
|
|
|
"bionic_unit_tests_defaults",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2019-10-21 21:35:05 +02:00
|
|
|
cc_test {
|
|
|
|
name: "bionic-stress-tests",
|
|
|
|
defaults: [
|
|
|
|
"bionic_tests_defaults",
|
|
|
|
],
|
|
|
|
|
|
|
|
// For now, these tests run forever, so do not use the isolation framework.
|
|
|
|
isolated: false,
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"malloc_stress_test.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
android: {
|
|
|
|
static_libs: [
|
|
|
|
"libmeminfo",
|
|
|
|
"libprocinfo",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
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",
|
2019-01-24 22:47:13 +01:00
|
|
|
|
|
|
|
// The Bionic allocator has its own C++ API. It isn't packaged into its
|
|
|
|
// own library, so it can only be tested when it's part of libc.a.
|
|
|
|
"bionic_allocator_test.cpp",
|
|
|
|
],
|
|
|
|
include_dirs: [
|
|
|
|
"bionic/libc",
|
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",
|
2019-01-16 05:35:00 +01:00
|
|
|
"libtest_elftls_shared_var",
|
|
|
|
"libtest_elftls_tprel",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
static_executable: true,
|
|
|
|
stl: "libc++_static",
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// 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",
|
2019-01-16 05:35:00 +01:00
|
|
|
"libtest_elftls_shared_var",
|
|
|
|
"libtest_elftls_tprel",
|
2016-07-12 01:20:06 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
whole_static_libs: [
|
|
|
|
"libBionicStandardTests",
|
2019-01-16 05:35:00 +01:00
|
|
|
"libBionicElfTlsTests",
|
|
|
|
"libBionicElfTlsLoaderTests",
|
2016-07-12 01:20:06 +02:00
|
|
|
"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 = ["*"]
|