mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-12-04 15:44:06 +08:00
06d8171994
We need to support different fastboot fetch strings for different bootloader solutions. Lets extend expect-output.sh to support multiple fetch strings (-f) and add support for error catch strings (-e) to stop the CI run early. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5258>
31 lines
459 B
Bash
Executable File
31 lines
459 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
STRINGS=$(mktemp)
|
|
ERRORS=$(mktemp)
|
|
|
|
trap "rm $STRINGS; rm $ERRORS;" EXIT
|
|
|
|
FILE=$1
|
|
shift 1
|
|
|
|
while getopts "f:e:" opt; do
|
|
case $opt in
|
|
f) echo "$OPTARG" >> $STRINGS;;
|
|
e) echo "$OPTARG" >> $STRINGS ; echo "$OPTARG" >> $ERRORS;;
|
|
esac
|
|
done
|
|
shift $((OPTIND -1))
|
|
|
|
echo "Waiting for $FILE to say one of following strings"
|
|
cat $STRINGS
|
|
|
|
while ! egrep -wf $STRINGS $FILE; do
|
|
sleep 2
|
|
done
|
|
|
|
if egrep -wf $ERRORS $FILE; then
|
|
exit 1
|
|
fi
|