Loading ravenwood/scripts/list-ravenwood-tests.sh +26 −4 Original line number Diff line number Diff line Loading @@ -17,17 +17,39 @@ set -e fbr_only=0 while getopts "r" opt; do case "$opt" in r) # Only print tests under frameworks/base/ravenwood/ fbr_only=1 ;; '?') exit 1 ;; esac done shift $(($OPTIND - 1)) in="$OUT/module-info.json" cache="$OUT/ravenwood-test-list.cached.tmp" cache_temp="$OUT/ravenwood-test-list.temp.tmp" cache="$OUT/ravenwood-test-list-fbr${fbr_only}.cached.txt" cache_temp="${cache}.tmp" extra_select="" if (( $fbr_only )) ; then extra_select='| select( .value.path.[] | startswith("frameworks/base/ravenwood"))' fi if [[ "$in" -nt "$cache" ]] ; then # 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 rm -f "$cache_temp" "$cache" # 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") ) | .key' "$OUT/module-info.json" | sort > "$cache_temp" jq -r 'to_entries[] | select( .value.compatibility_suites | index("ravenwood-tests") ) '"$extra_select"' | .key' \ "$OUT/module-info.json" | sort > "$cache_temp" mv "$cache_temp" "$cache" fi Loading ravenwood/scripts/run-ravenwood-tests.sh +8 −3 Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ dry_run="" exclude_large_tests=0 atest_opts="" build_only=0 while getopts "sx:f:dtbLa:" opt; do list_options="" while getopts "sx:f:dtbLa:r" opt; do case "$opt" in s) # Remove slow tests. Loading Loading @@ -74,6 +75,10 @@ case "$opt" in # exclude large tests exclude_large_tests=1 ;; r) # only run tests under frameworks/base/ravenwood/ list_options="$list_options -r" ;; '?') exit 1 ;; Loading @@ -82,7 +87,7 @@ done shift $(($OPTIND - 1)) all_tests=(hoststubgentest tiny-framework-dump-test hoststubgen-invoke-test ravenwood-stats-checker ravenhelpertest) all_raven_tests=( $( ./list-ravenwood-tests.sh ) ) all_raven_tests=( $( ./list-ravenwood-tests.sh $list_options ) ) all_tests+=( "${all_raven_tests[@]}" ) Loading Loading @@ -144,7 +149,7 @@ done # Calculate the removed tests. diff="$(diff <(echo "${all_tests[@]}" | tr ' ' '\n') <(echo "${targets[@]}" | tr ' ' '\n') | grep -v [0-9] )" diff="$(diff <(echo "${all_tests[@]}" | tr ' ' '\n') <(echo "${targets[@]}" | tr ' ' '\n') | grep -v [0-9] || true)" if [[ "$diff" != "" ]]; then echo "Excluded tests:" Loading Loading
ravenwood/scripts/list-ravenwood-tests.sh +26 −4 Original line number Diff line number Diff line Loading @@ -17,17 +17,39 @@ set -e fbr_only=0 while getopts "r" opt; do case "$opt" in r) # Only print tests under frameworks/base/ravenwood/ fbr_only=1 ;; '?') exit 1 ;; esac done shift $(($OPTIND - 1)) in="$OUT/module-info.json" cache="$OUT/ravenwood-test-list.cached.tmp" cache_temp="$OUT/ravenwood-test-list.temp.tmp" cache="$OUT/ravenwood-test-list-fbr${fbr_only}.cached.txt" cache_temp="${cache}.tmp" extra_select="" if (( $fbr_only )) ; then extra_select='| select( .value.path.[] | startswith("frameworks/base/ravenwood"))' fi if [[ "$in" -nt "$cache" ]] ; then # 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 rm -f "$cache_temp" "$cache" # 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") ) | .key' "$OUT/module-info.json" | sort > "$cache_temp" jq -r 'to_entries[] | select( .value.compatibility_suites | index("ravenwood-tests") ) '"$extra_select"' | .key' \ "$OUT/module-info.json" | sort > "$cache_temp" mv "$cache_temp" "$cache" fi Loading
ravenwood/scripts/run-ravenwood-tests.sh +8 −3 Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ dry_run="" exclude_large_tests=0 atest_opts="" build_only=0 while getopts "sx:f:dtbLa:" opt; do list_options="" while getopts "sx:f:dtbLa:r" opt; do case "$opt" in s) # Remove slow tests. Loading Loading @@ -74,6 +75,10 @@ case "$opt" in # exclude large tests exclude_large_tests=1 ;; r) # only run tests under frameworks/base/ravenwood/ list_options="$list_options -r" ;; '?') exit 1 ;; Loading @@ -82,7 +87,7 @@ done shift $(($OPTIND - 1)) all_tests=(hoststubgentest tiny-framework-dump-test hoststubgen-invoke-test ravenwood-stats-checker ravenhelpertest) all_raven_tests=( $( ./list-ravenwood-tests.sh ) ) all_raven_tests=( $( ./list-ravenwood-tests.sh $list_options ) ) all_tests+=( "${all_raven_tests[@]}" ) Loading Loading @@ -144,7 +149,7 @@ done # Calculate the removed tests. diff="$(diff <(echo "${all_tests[@]}" | tr ' ' '\n') <(echo "${targets[@]}" | tr ' ' '\n') | grep -v [0-9] )" diff="$(diff <(echo "${all_tests[@]}" | tr ' ' '\n') <(echo "${targets[@]}" | tr ' ' '\n') | grep -v [0-9] || true)" if [[ "$diff" != "" ]]; then echo "Excluded tests:" Loading