From f5c9a65046dd85ae4922572d9729bb56409e688a Mon Sep 17 00:00:00 2001 From: Mitch Phillips Date: Mon, 21 Aug 2023 13:53:15 +0200 Subject: [PATCH] Move bionic test libraries to a default, for easy consumption in cts. This list has diverged between cts/ and bionic/. Instead of having to maintain the list, let's just make cts/ inherit the one from bionic. Bug: 296832150 Test: atest bionic-unit-tests CtsBionicTestCases Change-Id: I271668e83aed239107b9129dfb707f03bae47cfa --- tests/Android.bp | 149 ++++++++++++++++++++++++----------------------- 1 file changed, 76 insertions(+), 73 deletions(-) diff --git a/tests/Android.bp b/tests/Android.bp index a4298ab0b..b105f6a74 100644 --- a/tests/Android.bp +++ b/tests/Android.bp @@ -867,79 +867,8 @@ cc_test_library { ], } -// ----------------------------------------------------------------------------- -// Tests for the device using bionic's .so. Run with: -// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests -// adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests -// ----------------------------------------------------------------------------- cc_defaults { - name: "bionic_unit_tests_defaults", - host_supported: false, - gtest: false, - - defaults: [ - "bionic_tests_defaults", - ], - - whole_static_libs: [ - "libBionicTests", - "libBionicLoaderTests", - "libBionicElfTlsLoaderTests", - ], - - static_libs: [ - "libtinyxml2", - "liblog", - "libbase", - "libgtest_isolated", - ], - - srcs: [ - // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+) - "__cxa_thread_atexit_test.cpp", - "gtest_globals.cpp", - "gtest_main.cpp", - "gwp_asan_test.cpp", - "thread_local_test.cpp", - ], - - conlyflags: [ - "-fexceptions", - "-fnon-call-exceptions", - ], - - ldflags: ["-Wl,--export-dynamic"], - - include_dirs: ["bionic/libc"], - - stl: "libc++_static", - - target: { - android: { - shared_libs: [ - "ld-android", - "libdl", - "libdl_android", - "libdl_preempt_test_1", - "libdl_preempt_test_2", - "libdl_test_df_1_global", - "libtest_elftls_shared_var", - "libtest_elftls_tprel", - ], - static_libs: [ - // The order of these libraries matters, do not shuffle them. - "libmeminfo", - "libziparchive", - "libz", - "libutils", - ], - ldflags: [ - "-Wl,--rpath,${ORIGIN}/bionic-loader-test-libs", - "-Wl,--enable-new-dtags", - ], - }, - }, - + name: "bionic_unit_tests_data", data_bins: [ "cfi_test_helper", "cfi_test_helper2", @@ -967,7 +896,6 @@ cc_defaults { "thread_exit_cb_helper", "tls_properties_helper", ], - data_libs: [ "libatest_simple_zip", "libcfi-test", @@ -1104,6 +1032,81 @@ cc_defaults { ], } +// ----------------------------------------------------------------------------- +// Tests for the device using bionic's .so. Run with: +// adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests +// adb shell /data/nativetest64/bionic-unit-tests/bionic-unit-tests +// ----------------------------------------------------------------------------- +cc_defaults { + name: "bionic_unit_tests_defaults", + host_supported: false, + gtest: false, + + defaults: [ + "bionic_tests_defaults", + "bionic_unit_tests_data", + ], + + whole_static_libs: [ + "libBionicTests", + "libBionicLoaderTests", + "libBionicElfTlsLoaderTests", + ], + + static_libs: [ + "libtinyxml2", + "liblog", + "libbase", + "libgtest_isolated", + ], + + srcs: [ + // TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+) + "__cxa_thread_atexit_test.cpp", + "gtest_globals.cpp", + "gtest_main.cpp", + "gwp_asan_test.cpp", + "thread_local_test.cpp", + ], + + conlyflags: [ + "-fexceptions", + "-fnon-call-exceptions", + ], + + ldflags: ["-Wl,--export-dynamic"], + + include_dirs: ["bionic/libc"], + + stl: "libc++_static", + + target: { + android: { + shared_libs: [ + "ld-android", + "libdl", + "libdl_android", + "libdl_preempt_test_1", + "libdl_preempt_test_2", + "libdl_test_df_1_global", + "libtest_elftls_shared_var", + "libtest_elftls_tprel", + ], + static_libs: [ + // The order of these libraries matters, do not shuffle them. + "libmeminfo", + "libziparchive", + "libz", + "libutils", + ], + ldflags: [ + "-Wl,--rpath,${ORIGIN}/bionic-loader-test-libs", + "-Wl,--enable-new-dtags", + ], + }, + }, +} + cc_test { name: "bionic-unit-tests", defaults: [