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

Commit fe03ee41 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

"run-ravenwood-tests.sh -D" for running all device side tests

Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh -D
Flag: TEST_ONLY
Bug: 292141694
Change-Id: Ibbca7c755b03ff1c74725565963381ebe11f8155
parent c5a28975
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
@@ -18,12 +18,18 @@
set -e

fbr_only=0
while getopts "r" opt; do
device_test=0
while getopts "rD" opt; do
case "$opt" in
    r)
        # Only print tests under frameworks/base/ravenwood/
        fbr_only=1
        ;;
    D)
        # Print device side tests under f/b/r.
        fbr_only=1
        device_test=1
        ;;
    '?')
        exit 1
        ;;
@@ -32,14 +38,24 @@ done
shift $(($OPTIND - 1))

in="$OUT/module-info.json"
cache="$OUT/ravenwood-test-list-fbr${fbr_only}.cached.txt"
cache="$OUT/ravenwood-test-list-fbr${fbr_only}-dev${device_test}.cached.txt"
cache_temp="${cache}.tmp"

suite="ravenwood-tests"
if (( $device_test )) ; then
    suite="device-tests"
fi

extra_select=""
if (( $fbr_only )) ; then
    extra_select='| select( .value.path.[] | startswith("frameworks/base/ravenwood"))'
fi

run() {
    # echo "Running: $*" 1>&2 # for debugging
    "$@"
}

# If module-info.json or this script itself is newer than the cache file,
# then re-generate it.
if [[ "$in" -nt "$cache" ]] || [[ "$0" -nt "$cache" ]] ; then
@@ -48,7 +64,7 @@ if [[ "$in" -nt "$cache" ]] || [[ "$0" -nt "$cache" ]] ; then
    # First, create to a temp file, and once it's completed, rename it
    # to the actual cache file, so that if the command failed or is interrupted,
    # we don't update the cache.
    jq -r 'to_entries[] | select( .value.compatibility_suites | index("ravenwood-tests") ) '"$extra_select"' | .key' \
    run jq -r 'to_entries[] | select( .value.compatibility_suites | index("'$suite'") ) '"$extra_select"' | .key' \
            "$OUT/module-info.json" | sort > "$cache_temp"
    mv "$cache_temp" "$cache"
fi
+11 −2
Original line number Diff line number Diff line
@@ -39,7 +39,9 @@ exclude_large_tests=0
atest_opts=""
build_only=0
list_options=""
while getopts "sx:f:dtbLa:r" opt; do
with_tools_tests=1

while getopts "sx:f:dtbLa:rD" opt; do
case "$opt" in
    s)
        # Remove slow tests.
@@ -79,6 +81,11 @@ case "$opt" in
        # only run tests under frameworks/base/ravenwood/
        list_options="$list_options -r"
        ;;
    D)
        # Run device tests under f/b/r
        list_options="$list_options -D"
        with_tools_tests=0
        ;;
    '?')
        exit 1
        ;;
@@ -86,7 +93,9 @@ esac
done
shift $(($OPTIND - 1))

if (( $with_tools_tests )) ; then
    all_tests=(hoststubgentest tiny-framework-dump-test hoststubgen-invoke-test ravenwood-stats-checker ravenhelpertest)
fi
all_raven_tests=( $( ./list-ravenwood-tests.sh $list_options ) )

all_tests+=( "${all_raven_tests[@]}" )