Loading ravenwood/scripts/list-ravenwood-tests.sh +19 −3 Original line number Original line Diff line number Diff line Loading @@ -18,12 +18,18 @@ set -e set -e fbr_only=0 fbr_only=0 while getopts "r" opt; do device_test=0 while getopts "rD" opt; do case "$opt" in case "$opt" in r) r) # Only print tests under frameworks/base/ravenwood/ # Only print tests under frameworks/base/ravenwood/ fbr_only=1 fbr_only=1 ;; ;; D) # Print device side tests under f/b/r. fbr_only=1 device_test=1 ;; '?') '?') exit 1 exit 1 ;; ;; Loading @@ -32,14 +38,24 @@ done shift $(($OPTIND - 1)) shift $(($OPTIND - 1)) in="$OUT/module-info.json" 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" cache_temp="${cache}.tmp" suite="ravenwood-tests" if (( $device_test )) ; then suite="device-tests" fi extra_select="" extra_select="" if (( $fbr_only )) ; then if (( $fbr_only )) ; then extra_select='| select( .value.path.[] | startswith("frameworks/base/ravenwood"))' extra_select='| select( .value.path.[] | startswith("frameworks/base/ravenwood"))' fi fi run() { # echo "Running: $*" 1>&2 # for debugging "$@" } # If module-info.json or this script itself is newer than the cache file, # If module-info.json or this script itself is newer than the cache file, # then re-generate it. # then re-generate it. if [[ "$in" -nt "$cache" ]] || [[ "$0" -nt "$cache" ]] ; then if [[ "$in" -nt "$cache" ]] || [[ "$0" -nt "$cache" ]] ; then Loading @@ -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 # 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, # to the actual cache file, so that if the command failed or is interrupted, # we don't update the cache. # 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" "$OUT/module-info.json" | sort > "$cache_temp" mv "$cache_temp" "$cache" mv "$cache_temp" "$cache" fi fi Loading ravenwood/scripts/run-ravenwood-tests.sh +11 −2 Original line number Original line Diff line number Diff line Loading @@ -39,7 +39,9 @@ exclude_large_tests=0 atest_opts="" atest_opts="" build_only=0 build_only=0 list_options="" 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 case "$opt" in s) s) # Remove slow tests. # Remove slow tests. Loading Loading @@ -79,6 +81,11 @@ case "$opt" in # only run tests under frameworks/base/ravenwood/ # only run tests under frameworks/base/ravenwood/ list_options="$list_options -r" list_options="$list_options -r" ;; ;; D) # Run device tests under f/b/r list_options="$list_options -D" with_tools_tests=0 ;; '?') '?') exit 1 exit 1 ;; ;; Loading @@ -86,7 +93,9 @@ esac done done shift $(($OPTIND - 1)) shift $(($OPTIND - 1)) 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) fi all_raven_tests=( $( ./list-ravenwood-tests.sh $list_options ) ) all_raven_tests=( $( ./list-ravenwood-tests.sh $list_options ) ) all_tests+=( "${all_raven_tests[@]}" ) all_tests+=( "${all_raven_tests[@]}" ) Loading Loading
ravenwood/scripts/list-ravenwood-tests.sh +19 −3 Original line number Original line Diff line number Diff line Loading @@ -18,12 +18,18 @@ set -e set -e fbr_only=0 fbr_only=0 while getopts "r" opt; do device_test=0 while getopts "rD" opt; do case "$opt" in case "$opt" in r) r) # Only print tests under frameworks/base/ravenwood/ # Only print tests under frameworks/base/ravenwood/ fbr_only=1 fbr_only=1 ;; ;; D) # Print device side tests under f/b/r. fbr_only=1 device_test=1 ;; '?') '?') exit 1 exit 1 ;; ;; Loading @@ -32,14 +38,24 @@ done shift $(($OPTIND - 1)) shift $(($OPTIND - 1)) in="$OUT/module-info.json" 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" cache_temp="${cache}.tmp" suite="ravenwood-tests" if (( $device_test )) ; then suite="device-tests" fi extra_select="" extra_select="" if (( $fbr_only )) ; then if (( $fbr_only )) ; then extra_select='| select( .value.path.[] | startswith("frameworks/base/ravenwood"))' extra_select='| select( .value.path.[] | startswith("frameworks/base/ravenwood"))' fi fi run() { # echo "Running: $*" 1>&2 # for debugging "$@" } # If module-info.json or this script itself is newer than the cache file, # If module-info.json or this script itself is newer than the cache file, # then re-generate it. # then re-generate it. if [[ "$in" -nt "$cache" ]] || [[ "$0" -nt "$cache" ]] ; then if [[ "$in" -nt "$cache" ]] || [[ "$0" -nt "$cache" ]] ; then Loading @@ -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 # 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, # to the actual cache file, so that if the command failed or is interrupted, # we don't update the cache. # 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" "$OUT/module-info.json" | sort > "$cache_temp" mv "$cache_temp" "$cache" mv "$cache_temp" "$cache" fi fi Loading
ravenwood/scripts/run-ravenwood-tests.sh +11 −2 Original line number Original line Diff line number Diff line Loading @@ -39,7 +39,9 @@ exclude_large_tests=0 atest_opts="" atest_opts="" build_only=0 build_only=0 list_options="" 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 case "$opt" in s) s) # Remove slow tests. # Remove slow tests. Loading Loading @@ -79,6 +81,11 @@ case "$opt" in # only run tests under frameworks/base/ravenwood/ # only run tests under frameworks/base/ravenwood/ list_options="$list_options -r" list_options="$list_options -r" ;; ;; D) # Run device tests under f/b/r list_options="$list_options -D" with_tools_tests=0 ;; '?') '?') exit 1 exit 1 ;; ;; Loading @@ -86,7 +93,9 @@ esac done done shift $(($OPTIND - 1)) shift $(($OPTIND - 1)) 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) fi all_raven_tests=( $( ./list-ravenwood-tests.sh $list_options ) ) all_raven_tests=( $( ./list-ravenwood-tests.sh $list_options ) ) all_tests+=( "${all_raven_tests[@]}" ) all_tests+=( "${all_raven_tests[@]}" ) Loading