summaryrefslogtreecommitdiff
path: root/tests/dl_test.cpp
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-06-30 10:01:22 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-06-30 10:01:22 +0000
commit0a96c69b1cc590982da826cd28e5ae4ea916c96f (patch)
tree0b54317ff0c75bef86b4b22e9b997d801a3e606d /tests/dl_test.cpp
parentc0fa380b2a08a30c323b26ed749495b1f36d8be6 (diff)
parentf30ccc297ab4b5b91fe3eb7efa9f568dccb1919c (diff)
Snap for 7508253 from f30ccc297ab4b5b91fe3eb7efa9f568dccb1919c to s-keystone-qcom-release
Change-Id: I96cd2124840debe5e222b713b396da434a34334a
Diffstat (limited to 'tests/dl_test.cpp')
-rw-r--r--tests/dl_test.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/dl_test.cpp b/tests/dl_test.cpp
index 766f27a0b..47bf13374 100644
--- a/tests/dl_test.cpp
+++ b/tests/dl_test.cpp
@@ -264,8 +264,11 @@ static void create_ld_config_file(const char* config_file) {
#endif
#if defined(__BIONIC__)
-static bool is_debuggable_build() {
- return android::base::GetBoolProperty("ro.debuggable", false);
+// This test can't rely on ro.debuggable, because it might have been forced on
+// in a user build ("Force Debuggable"). In that configuration, ro.debuggable is
+// true, but Bionic's LD_CONFIG_FILE testing support is still disabled.
+static bool is_user_build() {
+ return android::base::GetProperty("ro.build.type", "user") == std::string("user");
}
#endif
@@ -282,7 +285,7 @@ static bool is_debuggable_build() {
TEST(dl, exec_with_ld_config_file) {
#if defined(__BIONIC__)
SKIP_WITH_HWASAN << "libclang_rt.hwasan is not found with custom ld config";
- if (!is_debuggable_build()) {
+ if (is_user_build()) {
GTEST_SKIP() << "LD_CONFIG_FILE is not supported on user build";
}
std::string helper = GetTestlibRoot() +
@@ -319,7 +322,7 @@ TEST(dl, exec_with_ld_config_file) {
TEST(dl, exec_with_ld_config_file_with_ld_preload) {
#if defined(__BIONIC__)
SKIP_WITH_HWASAN << "libclang_rt.hwasan is not found with custom ld config";
- if (!is_debuggable_build()) {
+ if (is_user_build()) {
GTEST_SKIP() << "LD_CONFIG_FILE is not supported on user build";
}
std::string helper = GetTestlibRoot() +
@@ -356,8 +359,8 @@ TEST(dl, disable_ld_config_file) {
// This test is only for CTS.
GTEST_SKIP() << "test is not supported with root uid";
}
- if (is_debuggable_build()) {
- GTEST_SKIP() << "test is not supported on debuggable build";
+ if (!is_user_build()) {
+ GTEST_SKIP() << "test requires user build";
}
std::string error_message = std::string("CANNOT LINK EXECUTABLE ") +