summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcore/jni/runtime_native_boot-flags-test.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/core/jni/runtime_native_boot-flags-test.sh b/core/jni/runtime_native_boot-flags-test.sh
index a39078f61039..a5d7a5a9ca61 100755
--- a/core/jni/runtime_native_boot-flags-test.sh
+++ b/core/jni/runtime_native_boot-flags-test.sh
@@ -172,6 +172,32 @@ function check_no_zygote_gc_runtime_option {
done
}
+# check_android_runtime_message CONTEXT MESSAGE
+# ---------------------------------------------
+# Return whether AndroidRuntime generated MESSAGE in logcat. Use CONTEXT in
+# logging.
+function check_android_runtime_message {
+ local context=$1
+ local message=$2
+
+ say "[$context] Check that AndroidRuntime generated expected message in logcat..."
+ adb logcat -d -s AndroidRuntime | grep -F -q "$message" \
+ || fail "Found no message \"$message\" generated by AndroidRuntime"
+}
+
+# check_no_android_runtime_message CONTEXT MESSAGE
+# ------------------------------------------------
+# Return whether AndroidRuntime did not generate MESSAGE in logcat. Use CONTEXT
+# in logging.
+function check_no_android_runtime_message {
+ local context=$1
+ local message=$2
+
+ say "[$context] Check that AndroidRuntime did not generate unexpected message in logcat..."
+ adb logcat -d -s AndroidRuntime | grep -F -q -v "$message" \
+ || fail "Found message \"$message\" generated by AndroidRuntime"
+}
+
# test_android_runtime_flag FLAG VALUE CHECK_EFFECT CHECK_NO_EFFECT
# -----------------------------------------------------------------
# Test device configuration FLAG with VALUE. CHECK_EFFECT and CHECK_NO_EFFECT
@@ -262,6 +288,30 @@ test_android_runtime_flag \
test_android_runtime_flag \
enable_generational_cc true check_generational_cc check_no_generational_cc
+# Test "enable_apex_image" flag values.
+# =====================================
+
+default_boot_image_message="Using default boot image"
+function check_default_boot_image {
+ check_android_runtime_message "$1" "$default_boot_image_message"
+}
+function check_no_default_boot_image {
+ check_no_android_runtime_message "$1" "$default_boot_image_message"
+}
+
+apex_boot_image_message="Using Apex boot image: '-Ximage:/system/framework/apex.art'"
+function check_apex_boot_image {
+ check_android_runtime_message "$1" "$apex_boot_image_message"
+}
+function check_no_apex_boot_image {
+ check_no_android_runtime_message "$1" "$apex_boot_image_message"
+}
+
+test_android_runtime_flag \
+ enable_apex_image false check_default_boot_image check_no_default_boot_image
+test_android_runtime_flag \
+ enable_apex_image true check_apex_boot_image check_no_apex_boot_image
+
# Post-test actions.
# ==================