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

Commit dce75595 authored by Jaewan Kim's avatar Jaewan Kim
Browse files

MediaSession2: Add a way to only build test and run test in runcts.sh

'--test' is added for only rebuild test and run MediaSession2 related
CTS.

Bug: 74424357
Test: Run the test with the option
Change-Id: I13d0a78340b88ba6fe0c6f08c81214f1f8401f3c
parent 58a73fc8
Loading
Loading
Loading
Loading
+36 −24
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ function _runtest_cts_mediacomponent_usage() {
  echo '     -h|--help: This help'
  echo '     --skip: Skip build and flash. Just rerun-tests'
  echo '     --min: Only rebuild tests and updatable library.'
  echo '     --test: Only rebuild tests'
  echo '     -s [device_id]: Specify a device name to run test against.'
  echo '                     You can define ${ADBHOST} instead.'
  echo '     -r [count]: Repeat tests for given count. It will stop when fails.'
@@ -58,6 +59,7 @@ function runtest-cts-MediaComponents() {
  while true; do
    local OPTION_SKIP="false"
    local OPTION_MIN="false"
    local OPTION_TEST="false"
    local OPTION_REPEAT_COUNT="1"
    local OPTION_IGNORE="false"
    local OPTION_TEST_TARGET="${DEFAULT_TEST_TARGET}"
@@ -74,6 +76,9 @@ function runtest-cts-MediaComponents() {
        --min)
          OPTION_MIN="true"
          ;;
        --test)
          OPTION_TEST="true"
          ;;
        -s)
          shift
          adbhost_local=${1}
@@ -133,12 +138,18 @@ function runtest-cts-MediaComponents() {
      fi

      # Build test apk and required apk.
      local build_targets="${BUILD_TARGETS[@]}"
      if [[ "${OPTION_MIN}" != "true" ]]; then
        build_targets="${build_targets} droid"
      local build_targets
      if [[ "${OPTION_TEST}" == "true" ]]; then
        build_targets="${INSTALL_TARGETS[@]}"
      elif [[ "${OPTION_MIN}" == "true" ]]; then
        build_targets="${BUILD_TARGETS[@]}"
      else
        build_targets="${BUILD_TARGETS[@]} droid"
      fi
      m ${build_targets} -j || break

      if [[ "${OPTION_TEST}" != "true" ]]; then
        # Flash only when needed
        local device_build_type="$(${adb} shell getprop ro.build.type)"
        if [[ "${device_build_type}" == "user" ]]; then
          # User build. Cannot adb sync
@@ -163,6 +174,7 @@ function runtest-cts-MediaComponents() {
        # Ensure package manager is loaded.
        # TODO(jaewan): Find better way to wait
        sleep 15
      fi

      # Install apks
      local install_failed="false"