#!/bin/sh

set -e

testdir=${AUTOPKGTEST_TMP:-/tmp}

cp -r examples ${testdir}
cd ${testdir}/examples
echo "** Compiling examples."
make
echo -n "** Executing pdfhello ... "
./pdfhello
echo "done."
echo -n "** Checking generated PDF ... "
pdftotext -layout hello.pdf - | grep -q 'Hello, World!'
echo "OK."
