blob: 5d623e0b6c364c51ce40b6082c38f9369cc29438 [file] [log] [blame]
Makoto Onuki450f9f32024-01-30 14:51:48 -08001#!/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 Onukid347a612024-02-14 10:10:12 -080016# Run all the ravenwood tests + hoststubgen unit tests.
Makoto Onuki00c2baf2024-10-23 15:40:21 -070017#
18# Options:
19#
20# -s: "Smoke" test -- skip slow tests (SysUI, ICU)
Makoto Onukid347a612024-02-14 10:10:12 -080021
Makoto Onuki00c2baf2024-10-23 15:40:21 -070022smoke=0
23while getopts "s" opt; do
24case "$opt" in
25 s)
26 smoke=1
27 ;;
28 '?')
29 exit 1
30 ;;
31esac
32done
33shift $(($OPTIND - 1))
Makoto Onuki450f9f32024-01-30 14:51:48 -080034
Makoto Onuki00c2baf2024-10-23 15:40:21 -070035all_tests=(hoststubgentest tiny-framework-dump-test hoststubgen-invoke-test ravenwood-stats-checker)
36all_tests+=( $(${0%/*}/list-ravenwood-tests.sh) )
37
38# Regex to identify slow tests, in PCRE
39slow_tests_re='^(SystemUiRavenTests|CtsIcuTestCasesRavenwood)$'
40
41if (( $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 ) )
48fi
Makoto Onuki450f9f32024-01-30 14:51:48 -080049
Makoto Onuki847ba782024-02-20 10:45:14 -080050run() {
51 echo "Running: $*"
52 "${@}"
53}
54
Makoto Onuki00c2baf2024-10-23 15:40:21 -070055run ${ATEST:-atest} "${all_tests[@]}"