#!/bin/sh
set -eu

# Run outside the source tree so imports exercise the installed package.
test_dir=$(mktemp -d "${AUTOPKGTEST_TMP:-/tmp}/osteosarc-tests.XXXXXX")
trap 'rm -rf "$test_dir"' EXIT HUP INT TERM
cp -a tests scripts docs pyproject.toml "$test_dir/"
cd "$test_dir"
export PYTHONPATH="$test_dir"
export PYTHONDONTWRITEBYTECODE=1
export OPENVAX_DATA_CACHE="$test_dir/cache"
export OSTEOSARC_CACHE="$test_dir/cache"
for python in $(py3versions -s); do
    "$python" -m pytest -q tests
done
