#!/bin/sh

set -e

cd "$AUTOPKGTEST_ARTIFACTS"

# start cdda and wait a bit
cataclysm-tiles &
PID=$!
sleep 15
xdotool search --onlyvisible --class cataclysm-tiles windowfocus

# take screenshot and OCR it
scrot --focused cdda.png
kill "$PID"
tesseract cdda.png cdda

grep "Version: " cdda.txt
grep "New Game" cdda.txt
grep "Help" cdda.txt
grep "Credits" cdda.txt
