#!/bin/bash
set -e

pkg=pal2nal

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 /usr/share/doc/${pkg}/examples/* -a "${AUTOPKGTEST_TMP}"

cd "${AUTOPKGTEST_TMP}"
gunzip -r *

echo 'Test'
pal2nal.pl test.aln test.nuc -output paml -nogap > res 2>/dev/null
diff -u res test.expected
echo 'PASS'

