1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#!/bin/sh
set -ex
cd "$AUTOPKGTEST_ARTIFACTS"
# need to create directories until upstream bug #26660 is fixed
mkdir -p ~/.config
mkdir -p ~/.local/share
export LANG=en_US.UTF-8
# cdda needs audio or it won't start (#59464)
export SDL_AUDIODRIVER=dummy
# start cdda and a window manager, and wait a bit
openbox &
PID_OPENBOX=$!
sleep 5
/usr/games/cataclysm-tiles &
PID_CDDA=$!
sleep 15
xdotool search --onlyvisible --class cataclysm-tiles windowfocus
# take screenshot and OCR it
scrot screen.png
scrot --focused cdda.png
kill "$PID_CDDA"
kill "$PID_OPENBOX"
tesseract cdda.png cdda
sed -e 's/^/# cdda.txt: /' < cdda.txt
grep -i "New Game" cdda.txt
grep -i "Help" cdda.txt
grep -i "Credits" cdda.txt
|