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

Commit 7b63e9d8 authored by Jaewan Kim's avatar Jaewan Kim
Browse files

MediaSession2: Fix bug in runtest.sh for finding test apk

The script had searched the apk under the ${OUT}, but it sometimes match
with the invalid apk under ${OUT}/obj/PACKAGING.

Limits the search directory to ${OUT}/system and ${OUT}/data to exclude
obj directory.

Test: Run all MediaComponents tests once
Change-Id: I733b381cbc8e56b5c28515bc93931ce1e5d67e40
parent 7a498a96
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -146,9 +146,10 @@ function runtest-MediaComponents() {
        fi
        target_dir=$(dirname ${target_dir})
        local package=$(sed -n 's/^.*\bpackage\b="\([a-z0-9\._]*\)".*$/\1/p' ${target_dir}/AndroidManifest.xml)
        local apk_path=$(find ${OUT} -name ${target}.apk)
        if [[ -z "${apk_path}" ]]; then
          echo "Cannot locate ${target}.apk" && break
        local apk_path=$(find ${OUT}/system ${OUT}/data -name ${target}.apk)
        local apk_num=$(find ${OUT}/system ${OUT}/data -name ${target}.apk | wc -l)
        if [[ "${apk_num}" != "1" ]]; then
          echo "Cannot locate a ${target}.apk. Found ${apk_num} apks" && break
        fi
        echo "Installing ${target}.apk. path=${apk_path}"
        ${adb} install -r ${apk_path}