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

Commit 7a315608 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Improve run-ravenwood-tests.sh

- Add `-b` -- build only option.
- Print the command before executing it.
- Clean up the diff output.

Flag: EXEMPT host test change only
Bug: 292141694
Test: manual test
Change-Id: I104f7c38ea5a87c75288b270f39338a1eba53c59
parent 998761e5
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ include_re=""
exclude_re=""
smoke_exclude_re=""
dry_run=""
while getopts "sx:f:dt" opt; do
while getopts "sx:f:dtb" opt; do
case "$opt" in
    s)
        # Remove slow tests.
@@ -52,8 +52,13 @@ case "$opt" in
        dry_run="echo"
        ;;
    t)
        # Redirect log to terminal
        export RAVENWOOD_LOG_OUT=$(tty)
        ;;
    b)
        # Build only
        ATEST=m
        ;;
    '?')
        exit 1
        ;;
@@ -99,11 +104,16 @@ done

# Calculate the removed tests.

diff="$(diff  <(echo "${all_tests[@]}" | tr ' ' '\n') <(echo "${targets[@]}" | tr ' ' '\n') )"
diff="$(diff  <(echo "${all_tests[@]}" | tr ' ' '\n') <(echo "${targets[@]}" | tr ' ' '\n') | grep -v [0-9] )"

if [[ "$diff" != "" ]]; then
    echo "Excluded tests:"
    echo "$diff"
fi

$dry_run ${ATEST:-atest} "${targets[@]}"
run() {
    echo "Running: ${@}"
    "${@}"
}

run $dry_run ${ATEST:-atest} "${targets[@]}"