#!/bin/bash
set -e

pkg=q2_phylogeny

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/lib/python3/dist-packages/${pkg}* "${AUTOPKGTEST_TMP}"

cd "${AUTOPKGTEST_TMP}"

if [ ! -f /usr/lib/python3/dist-packages/pytest_cov/__init__.py ] ; then
	echo "Please install package python3-pytest-cov to run this script"
	exit 1
fi

# Run build-time tests
# for py in $(py3versions -s 2> /dev/null)
# do
#     ${py} -m pytest -v  --cov=${pkg}
# done

python3.11 -m pytest -v  --cov=${pkg}
