#!/bin/sh

set -e

if ! [ "$AUTOPKGTEST_TMP" ] || [ ! -d $AUTOPKGTEST_TMP ] ; then
    echo error: missing AUTOPKGTEST_TMP directory
    exit 1
fi

# Copy the entire build directory because I was unable to figure out how
# to reuse the test/ directory without the entire stucture.
cp -r . $AUTOPKGTEST_TMP/sourcedirectory

cd $AUTOPKGTEST_TMP/sourcedirectory

# Make the build to avoid build error due to missing build dependencies
touch png23d

# Run normal test suite, with the installed binary
make PNG23D=/usr/bin/png23d check
