#!/bin/sh
#
# Run the fig2dev testsuite
#
# (c) 2017-2021 Roland Rosenfeld <roland@debian.org>

echo "Running dh_autoreconf"
dh_autoreconf 2>&1
echo "Running dh_auto_configure"
dh_auto_configure 2>&1

cd fig2dev/tests

echo "Rebuild testsuite"
rm -f testsuite
make testsuite

echo "Restoring required test programs"
cp /usr/libexec/fig2dev/test[12] .

echo "Running testsuite"
make installcheck-local

# Place testsuite output into artifacts:
if [ -d "$AUTOPKGTEST_ARTIFACTS" ]
then
    cp -a testsuite.log testsuite.dir $AUTOPKGTEST_ARTIFACTS/
fi
