2 // Copyright (C) 2012 The Android Open Source Project
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 name: "bionic_tests_defaults",
26 "-fstack-protector-all",
34 // We want to test deprecated API too.
35 "-Wno-deprecated-declarations",
38 "-D__STDC_LIMIT_MACROS",
46 // -----------------------------------------------------------------------------
47 // All standard tests.
48 // -----------------------------------------------------------------------------
51 name: "libBionicStandardTests",
52 defaults: ["bionic_tests_defaults"],
57 "bug_26110743_test.cpp",
73 "libc_logging_test.cpp",
74 "libgen_basename_test.cpp",
82 "netinet_ether_test.cpp",
83 "netinet_in_test.cpp",
84 "netinet_udp_test.cpp",
95 "stack_protector_test.cpp",
96 "stack_protector_test_helper.cpp",
97 "stack_unwinding_test.cpp",
100 "stdio_nofortify_test.cpp",
102 "stdio_ext_test.cpp",
104 "string_nofortify_test.cpp",
106 "string_posix_strerror_r_test.cpp",
107 "strings_nofortify_test.cpp",
110 "sys_epoll_test.cpp",
113 "sys_personality_test.cpp",
114 "sys_prctl_test.cpp",
115 "sys_procfs_test.cpp",
116 "sys_ptrace_test.cpp",
117 "sys_quota_test.cpp",
118 "sys_resource_test.cpp",
119 "sys_select_test.cpp",
121 "sys_sendfile_test.cpp",
123 "sys_socket_test.cpp",
125 "sys_statvfs_test.cpp",
126 "sys_syscall_test.cpp",
127 "sys_sysinfo_test.cpp",
128 "sys_sysmacros_test.cpp",
130 "sys_timex_test.cpp",
131 "sys_types_test.cpp",
134 "sys_xattr_test.cpp",
135 "system_properties_test.cpp",
136 "system_properties_test2.cpp",
139 "unistd_nofortify_test.cpp",
156 host_ldlibs: ["-lrt"],
161 generated_headers: ["generated_android_ids"],
164 // -----------------------------------------------------------------------------
166 // -----------------------------------------------------------------------------
169 name: "bionic_fortify_tests_defaults",
174 srcs: ["fortify_test_main.cpp"],
177 clang_cflags: ["-D__clang__"],
183 name: "libfortify1-tests-clang",
184 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
187 "-D_FORTIFY_SOURCE=1",
188 "-DTEST_NAME=Fortify1_clang"
196 name: "libfortify2-tests-clang",
197 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
200 "-D_FORTIFY_SOURCE=2",
201 "-DTEST_NAME=Fortify2_clang"
208 // -----------------------------------------------------------------------------
209 // Library of all tests (excluding the dynamic linker tests).
210 // -----------------------------------------------------------------------------
212 name: "libBionicTests",
213 defaults: ["bionic_tests_defaults"],
215 "libBionicStandardTests",
216 "libfortify1-tests-clang",
217 "libfortify2-tests-clang",
224 // -----------------------------------------------------------------------------
225 // Library of bionic customized gtest main function, with simplified output format.
226 // -----------------------------------------------------------------------------
228 name: "libBionicGtestMain",
229 defaults: ["bionic_tests_defaults"],
251 name: "libBionicLoaderTests",
252 defaults: ["bionic_tests_defaults", "llvm-defaults"],
256 "dlfcn_symlink_support.cpp",
258 "pthread_dlfcn_test.cpp",
289 // -----------------------------------------------------------------------------
290 // Library of bionic customized gtest main function, with normal gtest output format,
291 // which is needed by bionic cts test.
292 // -----------------------------------------------------------------------------
294 name: "libBionicCtsGtestMain",
295 defaults: ["bionic_tests_defaults"],
298 "gtest_globals_cts.cpp",
300 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
306 // -----------------------------------------------------------------------------
307 // Tests for the device using bionic's .so. Run with:
308 // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
309 // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
310 // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
311 // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
312 // -----------------------------------------------------------------------------
314 name: "bionic_unit_tests_defaults",
315 host_supported: false,
319 "libBionicLoaderTests",
320 "libBionicGtestMain",
330 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
331 "__cxa_thread_atexit_test.cpp",
332 "thread_local_test.cpp",
337 "-fnon-call-exceptions",
340 ldflags: ["-Wl,--export-dynamic"],
342 include_dirs: ["bionic/libc"],
344 stl: "libc++_static",
350 "libdl_preempt_test_1",
351 "libdl_preempt_test_2",
352 "libdl_test_df_1_global",
355 // The order of these libraries matters, do not shuffle them.
369 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
370 "-Wl,--enable-new-dtags",
377 name: "bionic-unit-tests",
378 defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"],
383 shared_libs: ["libicuuc"],
388 // -----------------------------------------------------------------------------
389 // Tests for the device linked against bionic's static library. Run with:
390 // adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
391 // adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
392 // -----------------------------------------------------------------------------
394 name: "bionic-unit-tests-static",
395 defaults: ["bionic_tests_defaults"],
396 host_supported: false,
399 "gtest_preinit_debuggerd.cpp",
403 "libBionicGtestMain",
414 "libdebuggerd_handler",
417 static_executable: true,
418 stl: "libc++_static",
420 // libc and libc++ both define std::nothrow. libc's is a private symbol, but this
421 // still causes issues when linking libc.a and libc++.a, since private isn't
422 // effective until it has been linked. To fix this, just allow multiple symbol
423 // definitions for the static tests.
424 ldflags: ["-Wl,--allow-multiple-definition"],
427 // -----------------------------------------------------------------------------
428 // Tests to run on the host and linked against glibc. Run with:
429 // cd bionic/tests; mm bionic-unit-tests-glibc-run
430 // -----------------------------------------------------------------------------
433 name: "bionic-unit-tests-glibc",
434 defaults: ["bionic_tests_defaults"],
438 "dlfcn_symlink_support.cpp",
441 "pthread_dlfcn_test.cpp",
445 "libdl_preempt_test_1",
446 "libdl_preempt_test_2",
448 "libdl_test_df_1_global",
452 "libBionicStandardTests",
453 "libBionicGtestMain",
454 "libfortify1-tests-clang",
455 "libfortify2-tests-clang",
471 include_dirs: ["bionic/libc"],
474 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
475 "-Wl,--export-dynamic",