summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam McVicker <willmcvicker@google.com>2024-04-22 18:30:04 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-22 18:30:04 +0000
commit7b3637466893a4f07ae73ed388cb7c06e34361ba (patch)
tree8613d1da9275ce1544e59f256d78dadbcd07970e
parent90079fde40abc3468271ddb15ba1a93693de8f31 (diff)
parent31640a9d19405f9825283910a0ba7ede277c732a (diff)
downloadkernel-7b3637466893a4f07ae73ed388cb7c06e34361ba.tar.gz
Merge "16k: VTS: Add NoBionicPageSizeMacro test" into main
-rw-r--r--pagesize_16kb/Vts16KPageSizeTest.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/pagesize_16kb/Vts16KPageSizeTest.cpp b/pagesize_16kb/Vts16KPageSizeTest.cpp
index 5c237865..c29384f0 100644
--- a/pagesize_16kb/Vts16KPageSizeTest.cpp
+++ b/pagesize_16kb/Vts16KPageSizeTest.cpp
@@ -28,6 +28,12 @@ class Vts16KPageSizeTest : public ::testing::Test {
return android::base::GetIntProperty("ro.vendor.api_level", __ANDROID_API_S__);
}
+ static bool NoBionicPageSizeMacroProperty() {
+ // "ro.product.build.no_bionic_page_size_macro" was added in Android V and is
+ // set to true when Android is build with PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO := true.
+ return android::base::GetBoolProperty("ro.product.build.no_bionic_page_size_macro", false);
+ }
+
static std::string Architecture() { return android::base::GetProperty("ro.bionic.arch", ""); }
static ssize_t MaxPageSize(const std::string& filepath) {
@@ -93,3 +99,16 @@ TEST_F(Vts16KPageSizeTest, InitMaxPageSizeTest) {
<< "ELF " << initPath << " with page size " << initMaxPageSize
<< " was not built with the required max-page-size " << expectedMaxPageSize;
}
+
+/**
+ * Checks if the vendor's build was compiled with the define
+ * PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO based on the product property
+ * ro.product.build.no_bionic_page_size_macro.
+ */
+TEST_F(Vts16KPageSizeTest, NoBionicPageSizeMacro) {
+ /**
+ * TODO(b/315034809): switch to error when final decision is made.
+ */
+ if (!NoBionicPageSizeMacroProperty())
+ GTEST_SKIP() << "Device was not built with: PRODUCT_NO_BIONIC_PAGE_SIZE_MACRO := true";
+}