Makoto Onuki | 450f9f3 | 2024-01-30 14:51:48 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright (C) 2024 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
Makoto Onuki | d347a61 | 2024-02-14 10:10:12 -0800 | [diff] [blame] | 16 | # Run all the ravenwood tests + hoststubgen unit tests. |
Makoto Onuki | 00c2baf | 2024-10-23 15:40:21 -0700 | [diff] [blame^] | 17 | # |
| 18 | # Options: |
| 19 | # |
| 20 | # -s: "Smoke" test -- skip slow tests (SysUI, ICU) |
Makoto Onuki | d347a61 | 2024-02-14 10:10:12 -0800 | [diff] [blame] | 21 | |
Makoto Onuki | 00c2baf | 2024-10-23 15:40:21 -0700 | [diff] [blame^] | 22 | smoke=0 |
| 23 | while getopts "s" opt; do |
| 24 | case "$opt" in |
| 25 | s) |
| 26 | smoke=1 |
| 27 | ;; |
| 28 | '?') |
| 29 | exit 1 |
| 30 | ;; |
| 31 | esac |
| 32 | done |
| 33 | shift $(($OPTIND - 1)) |
Makoto Onuki | 450f9f3 | 2024-01-30 14:51:48 -0800 | [diff] [blame] | 34 | |
Makoto Onuki | 00c2baf | 2024-10-23 15:40:21 -0700 | [diff] [blame^] | 35 | all_tests=(hoststubgentest tiny-framework-dump-test hoststubgen-invoke-test ravenwood-stats-checker) |
| 36 | all_tests+=( $(${0%/*}/list-ravenwood-tests.sh) ) |
| 37 | |
| 38 | # Regex to identify slow tests, in PCRE |
| 39 | slow_tests_re='^(SystemUiRavenTests|CtsIcuTestCasesRavenwood)$' |
| 40 | |
| 41 | if (( $smoke )) ; then |
| 42 | # Remove the slow tests. |
| 43 | all_tests=( $( |
| 44 | for t in "${all_tests[@]}"; do |
| 45 | echo $t | grep -vP "$slow_tests_re" |
| 46 | done |
| 47 | ) ) |
| 48 | fi |
Makoto Onuki | 450f9f3 | 2024-01-30 14:51:48 -0800 | [diff] [blame] | 49 | |
Makoto Onuki | 847ba78 | 2024-02-20 10:45:14 -0800 | [diff] [blame] | 50 | run() { |
| 51 | echo "Running: $*" |
| 52 | "${@}" |
| 53 | } |
| 54 | |
Makoto Onuki | 00c2baf | 2024-10-23 15:40:21 -0700 | [diff] [blame^] | 55 | run ${ATEST:-atest} "${all_tests[@]}" |