#!/bin/sh
set -e -u
export PYTHONWARNINGS=d

cp pytest.ini "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"

# opencl needs somewhere to cache compiled objects
export POCL_CACHE_DIR="$PWD/.cache/"
export XDG_CACHE_HOME="$PWD/.cache/"
mkdir "$POCL_CACHE_DIR"
export SAS_MODELPATH="$PWD/.sasmodels/"
mkdir "$SAS_MODELPATH"
# and also tell pyopencl not to cache
export PYOPENCL_NO_CACHE=1
# stop matplotlib from thinking it should display plots
export MPLBACKEND=Agg

for py in $(py3versions -i); do
  echo "##### These tests are likely to fail #####"
  $py -m pytest -v --pyargs sasmodels || true
done
