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

echo "Symlink /usr/sbin/mailfromd to src dir"
ln -s /usr/sbin/mailfromd src/

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

echo "Build libmf.a"
cd lib
make libmf.a 2>&1

cd ../tests
echo "Run testsuite"
make check 2>&1 || true

# Place testsuite output into artifacts:
cp -a testsuite.log testsuite.dir $AUTOPKGTEST_ARTIFACTS/
