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

Commit 464c2d69 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add -R to run all disabled tests to run-ravenwood-tests.sh" into main

parents 19908f58 d6960532
Loading
Loading
Loading
Loading
+44 −26
Original line number Diff line number Diff line
@@ -13,22 +13,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Run all the ravenwood tests + hoststubgen unit tests.
#
# Major options:
# Run all or selected the ravenwood tests + hoststubgen unit tests.
#
#   -s: "Smoke" test -- skip slow tests (SysUI, ICU) and large tests.
# Use -h to see the help.
#
#   -x PCRE: Specify exclusion filter in PCRE
#            Example: -x '^(Cts|hoststub)' # Exclude CTS and hoststubgen tests.
#
#   -f PCRE: Specify inclusion filter in PCRE

set -e
shopt -s nullglob # if a glob matches no file, expands to an empty string.

# Move to the script's directory
cd "${0%/*}"
my_command="${0##*/}"

# Find the enablement files. This may be an empty list if there's no match.
default_enablement_policy=(../texts/enablement-policy-*.txt)
@@ -38,6 +34,26 @@ default_enablement_policy=(../texts/enablement-policy-*.txt)
: ${ROLLING_TF_SUBPROCESS_OUTPUT:=0}
export ROLLING_TF_SUBPROCESS_OUTPUT


show_help() {
    cat <<EOF

$my_command: Run all or specified ravenwood tests

  Usage:
     $my_command [OPTIONS]
        Run all ravenwood tests and relevant host side tests.

     $my_command [OPTIONS] TEST-MODULE-NAME...
        Run specified test module

  Options:
EOF
    sed -n -e '/OPTIONS-START/,/OPTIONS-END/s/^ *\([a-zA-Z]\)) #/   -\1/p' "$my_command"
    echo
    return
}

smoke=0
include_re=""
exclude_re=""
@@ -49,49 +65,49 @@ atest_opts=""
list_options=""
with_tools_tests=1

while getopts "sx:f:dtbLa:rD" opt; do
while getopts "sx:f:dtbLa:rDRh" opt; do
case "$opt" in
    s)
        # Remove slow tests.
# OPTIONS-START
    s) # Remove slow tests
        smoke=1
        exclude_large_tests=1
        ;;
    x)
        # Take a PCRE from the arg, and use it as an exclusion filter.
    x) # Take a PCRE from the arg, and use it as an exclusion filter. Example: -x '^(Cts|hoststub)' # Exclude CTS and hoststubgen tests.
        exclude_re="$OPTARG"
        ;;
    f)
        # Take a PCRE from the arg, and use it as an inclusion filter.
    f) # Take a PCRE from the arg, and use it as an inclusion filter.
        include_re="$OPTARG"
        ;;
    d)
        # Dry run
    d) # Dry run
        dry_run="echo"
        ;;
    t)
        # Redirect log to terminal
    t) # Redirect log to terminal
        export RAVENWOOD_LOG_OUT=-
        ;;
    a)
        # atest options (e.g. "-t")
    a) # atest options (e.g. "-t")
        atest_opts="$OPTARG"
        ;;
    L)
        # exclude large tests
    L) # exclude large tests
        exclude_large_tests=1
        ;;
    r)
        # only run tests under frameworks/base/ravenwood/
    r) # only run tests under frameworks/base/ravenwood/
        list_options="$list_options -r"
        ;;
    D)
        # Run device tests under f/b/r
    D) # Only run device tests under frameworks/base/ravenwood/
        list_options="$list_options -D"
        with_tools_tests=0
        ;;
    R) # Run disabled tests too
        export RAVENWOOD_RUN_DISABLED_TESTS=1
        ;;
    h) # Show help
        show_help
        exit 0
        ;;
    '?')
        exit 1
        ;;
# OPTIONS-END
esac
done
shift $(($OPTIND - 1))
@@ -199,6 +215,8 @@ for test in $(remove_comments ../texts/experimental-api-allowed-tests.txt); do
    export RAVENWOOD_ENABLE_EXP_API_${test}=1
done

echo "RAVENWOOD_RUN_DISABLED_TESTS=$RAVENWOOD_RUN_DISABLED_TESTS"

# =========================================================

run() {
+65 −0

File changed.

Preview size limit exceeded, changes collapsed.

+4 −0
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ run_all_commands() {

    run_test "Run with no arguments" run-ravenwood-tests-wrapper

    run_test "Help" run-ravenwood-tests-wrapper -h

    run_test "Smoke tests" run-ravenwood-tests-wrapper -s

    run_test "Exclude large tests" run-ravenwood-tests-wrapper -L
@@ -111,6 +113,8 @@ run_all_commands() {

    ALL_TESTS="DeviceTest1 DeviceTest2" run_test "Run device tests (-D) " run-ravenwood-tests-wrapper -D

    run_test "Run with disabled tests" run-ravenwood-tests-wrapper -R

    echo "== All commands finished =="
}

+5 −2
Original line number Diff line number Diff line
@@ -20,8 +20,10 @@

set -e

# Tests that shouldn't be in presubmit.
EXEMPT='^(SystemUiRavenTests|CtsViewTestCasesRavenwood)$'
# Tests that shouldn't be in presubmit:
# - See b/440069724 for CarSystemUIRavenTests and CarLibHostUnitTest
# - RavenwoodUiTest_exp uses experimental APIs, so it shouldn't be executed.
EXEMPT='^(SystemUiRavenTests|CtsViewTestCasesRavenwood|CarSystemUIRavenTests|CarLibHostUnitTest|RavenwoodUiTest_exp)$'

is_car() {
    local module="$1"
@@ -90,6 +92,7 @@ main() {
    echo "Updated $test_mapping"

    # `|| true` is needed because of `set -e`.
    # (Otherwise, this script would fail when there's a diff.)
    diff -u "$test_mapping_bak" "$test_mapping" || true
    return 0
}