#!/bin/sh -e

pkg=prottest

# Trivial test
prottest -h

if [ "$AUTOPKGTEST_TMP" = "" ] ; then
  AUTOPKGTEST_TMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

# enable MPI run as root to pass test also when called as root
export OMPI_MCA_rmaps_base_oversubscribe=1
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1


cd $AUTOPKGTEST_TMP

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

prottest -i COX2_PF0016/alignment -t COX2_PF0016/tree -S 0 -all-distributions -F -AIC -BIC -tc 0.5
prottest -i Ribosomal_L5_PF00673/alignment -t Ribosomal_L5_PF00673/tree -S 0 -all-distributions -F -AIC -BIC -tc 0.5

echo "PASS"
