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

Commit 854a9986 authored by Makoto Onuki's avatar Makoto Onuki Committed by Android (Google) Code Review
Browse files

Merge "Starts adding tests for the scripts" into main

parents ee44c3b6 20ceb67b
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -79,6 +79,22 @@ filegroup {
    visibility: ["//visibility:private"],
}

filegroup {
    name: "ravenwood-all-text-files",
    srcs: [
        "texts/*",
    ],
    visibility: [":__subpackages__"],
}

filegroup {
    name: "ravenwood-all-scripts",
    srcs: [
        "scripts/*",
    ],
    visibility: [":__subpackages__"],
}

// Common code that is shared across host and device.
java_library {
    name: "ravenwood-common-utils",
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
    { "name": "ravenhelpertest" },
    { "name": "hoststubgen-test-tiny-test" },
    { "name": "hoststubgen-invoke-test" },
    { "name": "ravenwood-scripts-sh-golden-test" },
    { "name": "RavenwoodMockitoTest_device" },
    { "name": "RavenwoodBivalentTest_device" },
    { "name": "RavenwoodBivalentTest_device_ravenizer" },
+20 −23
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ smoke_exclude_re=""
dry_run=""
exclude_large_tests=0
atest_opts=""
build_only=0
list_options=""
with_tools_tests=1

@@ -73,11 +72,6 @@ case "$opt" in
        # Redirect log to terminal
        export RAVENWOOD_LOG_OUT=-
        ;;
    b)
        # Build only
        build_only=1
        ATEST=m
        ;;
    a)
        # atest options (e.g. "-t")
        atest_opts="$OPTARG"
@@ -105,14 +99,19 @@ shift $(($OPTIND - 1))
# If the rest of the arguments are available, just run these tests.
targets=("$@")


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

# Allow replacing 'list-ravenwood-tests.sh' with  $LIST_TEST_COMMAND.
all_raven_tests=( $( "${LIST_TEST_COMMAND:=./list-ravenwood-tests.sh}" $list_options ) )

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

# ROLLING_TF_SUBPROCESS_OUTPUT is often quite behind for large tests.
# let's disable it by default.
: ${ROLLING_TF_SUBPROCESS_OUTPUT:=0}
export ROLLING_TF_SUBPROCESS_OUTPUT

get_smoke_re() {
    # Extract tests from smoke-excluded-tests.txt
@@ -185,7 +184,7 @@ fi
# But if RAVENWOOD_TEST_ENABLEMENT_POLICY is already set, just use it.
if [[ "$RAVENWOOD_TEST_ENABLEMENT_POLICY" == "" ]] && (( "${#default_enablement_policy[@]}" > 0 )) ; then
    # This path must be a full path.
    combined_enablement_policy=/tmp/ravenwood-enablement-$$.txt
    combined_enablement_policy=/tmp/ravenwood-enablement-@@@$$@@@.txt

    cat "${default_enablement_policy[@]}" >$combined_enablement_policy

@@ -219,7 +218,6 @@ if (( $exclude_large_tests )) ; then
fi

# Add per-module arguments
if (( ! $build_only )) ; then
extra_args+=("--")

# Need to add the following two options for each module.
@@ -232,6 +230,5 @@ if (( ! $build_only )) ; then
            )
    done
done
fi

run $dry_run ${ATEST:-atest} --class-level-report $atest_opts "${targets[@]}" "${extra_args[@]}"
+10 −0
Original line number Diff line number Diff line
sh_test_host {
    name: "ravenwood-scripts-sh-golden-test",
    src: "ravenwood-scripts-sh-golden-test.sh",
    test_suites: ["general-tests"],
    data: [
        "golden-output/*.txt",
        ":ravenwood-all-scripts",
        ":ravenwood-all-text-files",
    ],
}
+222 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading