#!/bin/bash
set -e

pkg="paleomix"

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

cp -a /usr/share/doc/${pkg}/tests $ADTTMP

cd $ADTTMP

for gz in `find . -name "*.gz"` ; do
    # fasta_file.fasta.gz needs to stay compressed for testing
    if ! echo $gz | grep fasta_file.fasta.gz ; then
        gunzip $gz
    fi
done

tox