#!/bin/bash
set -e

pkg=python3-cogent3

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

cd "$AUTOPKGTEST_TMP"

cp -a /usr/share/doc/${pkg}/tests .
unset GZIP
for gz in `find . -name "*.gz"` ; do
    if echo $gz | grep -q formattest.fasta.gz ; then continue ; fi
    gunzip $gz
done
cd tests

NUMBA_CACHE_DIR="${AUTOPKGTEST_TMP}" python3 -m pytest
