Convert bionic dlext test zips to Android.bp
Use cc_genrules to create the dlext test zips needed by the bionic
tests. The genrules aren't visible to Make, and so don't work with
the `required` property. Move all of the dependencies to `data_bins`,
`data_libs` or `data` for helper binaries, shared libraries or
genrule zip files respectively. The `data*` properties copy the
files into the same directory as a test, respecting the
`bionic-loader-test-libs` relative path specified by each, but
does not put each helper binary in its own subdirectory, so update
the paths in each of the tests.
Bug: 200872604
Test: atest CtsBionicTestCases
Test: atest bionic-unit-tests
Test: cts-tradefed run commandAndExit cts -m CtsBionicTestCases
Test: adb push $OUT/data/nativetest/bionic-unit-tests /data/nativetest/ && adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
Change-Id: Ic4257cb4104ff558326df2363730acd20464b051
diff --git a/tests/Android.bp b/tests/Android.bp
index 3637404..f79dc3e 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -787,13 +787,14 @@
name: "libBionicCtsGtestMain",
defaults: ["bionic_tests_defaults"],
srcs: [
- "gtest_globals_cts.cpp",
+ "gtest_globals.cpp",
"gtest_main.cpp",
],
shared: {
enabled: false,
},
whole_static_libs: [
+ "libbase",
"libgtest_isolated",
],
}
@@ -870,13 +871,13 @@
"libLLVMSupport",
],
ldflags: [
- "-Wl,--rpath,${ORIGIN}/../bionic-loader-test-libs",
+ "-Wl,--rpath,${ORIGIN}/bionic-loader-test-libs",
"-Wl,--enable-new-dtags",
],
},
},
- required: [
+ data_bins: [
"cfi_test_helper",
"cfi_test_helper2",
"elftls_dlopen_ie_error_helper",
@@ -895,6 +896,14 @@
"ld_preload_test_helper",
"ld_preload_test_helper_lib1",
"ld_preload_test_helper_lib2",
+ "ns_hidden_child_helper",
+ "preinit_getauxval_test_helper",
+ "preinit_syscall_test_helper",
+ "thread_exit_cb_helper",
+ "tls_properties_helper",
+ ],
+
+ data_libs: [
"libatest_simple_zip",
"libcfi-test",
"libcfi-test-bad",
@@ -906,9 +915,7 @@
"libdlext_test_fd",
"libdlext_test_norelro",
"libdlext_test_recursive",
- "libdlext_test_runpath_zip_zipaligned",
"libdlext_test_zip",
- "libdlext_test_zip_zipaligned",
"libgnu-hash-table-library",
"libns_hidden_child_app",
"libns_hidden_child_global",
@@ -1028,11 +1035,6 @@
"libtest_with_dependency_loop_b",
"libtest_with_dependency_loop_c",
"libtestshared",
- "ns_hidden_child_helper",
- "preinit_getauxval_test_helper",
- "preinit_syscall_test_helper",
- "thread_exit_cb_helper",
- "tls_properties_helper",
],
}
@@ -1041,6 +1043,10 @@
defaults: [
"bionic_unit_tests_defaults",
],
+ data: [
+ ":libdlext_test_runpath_zip_zipaligned",
+ ":libdlext_test_zip_zipaligned",
+ ],
}
cc_test {