#!/bin/bash
set -e

pkg=pilercr

export LC_ALL=C.UTF-8
if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}"

cd "${AUTOPKGTEST_TMP}"

pilercr -in example.fasta -out report
if [ $(dpkg-architecture -qDEB_BUILD_ARCH) = "amd64" ]
then
	echo "c22c584448be758568a1f06d30d55ebd  report" > checksums
    md5sum --check checksums
    echo "PASS"
else
	[ -s "report" ] || exit 1
	echo "PASS"
fi
