#!/bin/sh

cp -a po/de.po "$AUTOPKGTEST_TMP"

export HOME="$AUTOPKGTEST_TMP"
mkdir -p "$HOME/.local/share/"

xvfb-run -a --server-args="-screen 0 1024x768x24" virtaal --help
if [ $? -ne 0 ]; then
  echo "==== smoke test --help failed ===="
  exit 1
fi

xvfb-run -a --server-args="-screen 0 1024x768x24" virtaal "$AUTOPKGTEST_TMP/de.po" &
XPID=$!

(sleep 10; kill -1 $XPID) &

# get the return code of the xserver which should be 128 + signal == 129
wait $XPID

RETVAL=$?
if [ $RETVAL -ne 129 ]; then
  echo "==== smoke test open po failed ===="
  exit $RETVAL
fi

exit 0
