#!/bin/sh

set -e

# Copy over some sample files that we want to test-build
mkdir -p $AUTOPKGTEST_TMP/mydocs/doc
cp doc/*.xml $AUTOPKGTEST_TMP/mydocs/doc/

# Setup the directory tree
echo "Trying to run setup-logidee-tools"
cd $AUTOPKGTEST_TMP/mydocs
setup-logidee-tools <<END
doc
END

# Try to build some output files
echo "Trying to run some make commands"
echo "make formations"
make formations
echo "make dtd.pdf"
make dtd.pdf
echo "make dtd.html"
make dtd.html

echo "Checking output files"
echo -n "doc/formation_doc.pdf... "
test -e doc/formation_doc.pdf
echo "ok."
echo -n "doc/dtd.pdf... "
test -e doc/dtd.pdf
echo "ok."
echo -n "doc/dtd.html... "
test -e doc/dtd.html
echo "ok."
