Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7bb0a13 authored by Roland Levillain's avatar Roland Levillain
Browse files

Check Android Runtime (Boot) device configuration flag `enable_apex_image`.

Test: core/jni/runtime_native_boot-flags-test.sh
Bug: 119800099
Change-Id: I10c6ed68eceebef14207bc38cab4e96fb2f75939
parent 0bef4103
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
@@ -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.
# ==================