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",
72 "libc_logging_test.cpp",
73 "libgen_basename_test.cpp",
81 "netinet_ether_test.cpp",
82 "netinet_in_test.cpp",
83 "netinet_udp_test.cpp",
94 "stack_protector_test.cpp",
95 "stack_protector_test_helper.cpp",
96 "stack_unwinding_test.cpp",
99 "stdio_nofortify_test.cpp",
101 "stdio_ext_test.cpp",
103 "string_nofortify_test.cpp",
105 "string_posix_strerror_r_test.cpp",
106 "strings_nofortify_test.cpp",
109 "sys_epoll_test.cpp",
112 "sys_personality_test.cpp",
113 "sys_prctl_test.cpp",
114 "sys_procfs_test.cpp",
115 "sys_ptrace_test.cpp",
116 "sys_quota_test.cpp",
117 "sys_resource_test.cpp",
118 "sys_select_test.cpp",
120 "sys_sendfile_test.cpp",
122 "sys_socket_test.cpp",
124 "sys_statvfs_test.cpp",
125 "sys_syscall_test.cpp",
126 "sys_sysinfo_test.cpp",
127 "sys_sysmacros_test.cpp",
129 "sys_timex_test.cpp",
130 "sys_types_test.cpp",
133 "sys_xattr_test.cpp",
134 "system_properties_test.cpp",
137 "unistd_nofortify_test.cpp",
154 host_ldlibs: ["-lrt"],
160 // -----------------------------------------------------------------------------
162 // -----------------------------------------------------------------------------
165 name: "bionic_fortify_tests_defaults",
170 srcs: ["fortify_test_main.cpp"],
173 clang_cflags: ["-D__clang__"],
179 name: "libfortify1-tests-gcc",
180 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
183 "-D_FORTIFY_SOURCE=1",
184 "-DTEST_NAME=Fortify1_gcc"
192 name: "libfortify2-tests-gcc",
193 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
196 "-D_FORTIFY_SOURCE=2",
197 "-DTEST_NAME=Fortify2_gcc"
205 name: "libfortify1-tests-clang",
206 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
209 "-D_FORTIFY_SOURCE=1",
210 "-DTEST_NAME=Fortify1_clang"
218 name: "libfortify2-tests-clang",
219 defaults: ["bionic_fortify_tests_defaults", "bionic_tests_defaults"],
222 "-D_FORTIFY_SOURCE=2",
223 "-DTEST_NAME=Fortify2_clang"
230 // -----------------------------------------------------------------------------
231 // Library of all tests (excluding the dynamic linker tests).
232 // -----------------------------------------------------------------------------
234 name: "libBionicTests",
235 defaults: ["bionic_tests_defaults"],
237 "libBionicStandardTests",
238 "libfortify1-tests-gcc",
239 "libfortify2-tests-gcc",
240 "libfortify1-tests-clang",
241 "libfortify2-tests-clang",
248 // -----------------------------------------------------------------------------
249 // Library of bionic customized gtest main function, with simplified output format.
250 // -----------------------------------------------------------------------------
252 name: "libBionicGtestMain",
253 defaults: ["bionic_tests_defaults"],
275 name: "libBionicLoaderTests",
276 defaults: ["bionic_tests_defaults"],
280 "dlfcn_symlink_support.cpp",
282 "pthread_dlfcn_test.cpp",
306 // -----------------------------------------------------------------------------
307 // Library of bionic customized gtest main function, with normal gtest output format,
308 // which is needed by bionic cts test.
309 // -----------------------------------------------------------------------------
311 name: "libBionicCtsGtestMain",
312 defaults: ["bionic_tests_defaults"],
315 "gtest_globals_cts.cpp",
317 cppflags: ["-DUSING_GTEST_OUTPUT_FORMAT"],
323 // -----------------------------------------------------------------------------
324 // Tests for the device using bionic's .so. Run with:
325 // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests32
326 // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests64
327 // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc32
328 // adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests-gcc64
329 // -----------------------------------------------------------------------------
331 name: "bionic_unit_tests_defaults",
332 host_supported: false,
336 "libBionicLoaderTests",
337 "libBionicGtestMain",
347 // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
348 "__cxa_thread_atexit_test.cpp",
349 "thread_local_test.cpp",
354 "-fnon-call-exceptions",
357 ldflags: ["-Wl,--export-dynamic"],
359 include_dirs: ["bionic/libc"],
365 "libdl_preempt_test_1",
366 "libdl_preempt_test_2",
367 "libdl_test_df_1_global",
370 // The order of these libraries matters, do not shuffle them.
378 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
379 "-Wl,--enable-new-dtags",
386 name: "bionic-unit-tests",
387 defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"],
392 shared_libs: ["libicuuc"],
398 name: "bionic-unit-tests-gcc",
399 defaults: ["bionic_unit_tests_defaults", "bionic_tests_defaults"],
403 // -----------------------------------------------------------------------------
404 // Tests for the device linked against bionic's static library. Run with:
405 // adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static32
406 // adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static64
407 // -----------------------------------------------------------------------------
409 name: "bionic-unit-tests-static",
410 defaults: ["bionic_tests_defaults"],
411 host_supported: false,
415 "libBionicGtestMain",
428 static_executable: true,
429 stl: "libc++_static",
431 // libc and libc++ both define std::nothrow. libc's is a private symbol, but this
432 // still causes issues when linking libc.a and libc++.a, since private isn't
433 // effective until it has been linked. To fix this, just allow multiple symbol
434 // definitions for the static tests.
435 ldflags: ["-Wl,--allow-multiple-definition"],
438 // -----------------------------------------------------------------------------
439 // Tests to run on the host and linked against glibc. Run with:
440 // cd bionic/tests; mm bionic-unit-tests-glibc-run
441 // -----------------------------------------------------------------------------
444 name: "bionic-unit-tests-glibc",
445 defaults: ["bionic_tests_defaults"],
449 "dlfcn_symlink_support.cpp",
452 "pthread_dlfcn_test.cpp",
456 "libdl_preempt_test_1",
457 "libdl_preempt_test_2",
459 "libdl_test_df_1_global",
463 "libBionicStandardTests",
464 "libBionicGtestMain",
465 "libfortify1-tests-gcc",
466 "libfortify2-tests-gcc",
467 "libfortify1-tests-clang",
468 "libfortify2-tests-clang",
484 include_dirs: ["bionic/libc"],
487 "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
488 "-Wl,--export-dynamic",