#!/bin/sh -e

# run most of the test suite without the OpenCL part

# temporarly install the ascent dataset

mkdir -p "$AUTOPKGTEST_TMP"/.cache/scipy-data/
cp debian/dataset-ascent/ascent.dat "$AUTOPKGTEST_TMP"/.cache/scipy-data/

# do not run Qt test on armel and armhf
hostarch=$(dpkg-architecture -qDEB_BUILD_ARCH)
if [ "$hostarch" = "armel" ] || [ "$hostarch" = "armhf" ]; then
    export WITH_QT_TEST=False
fi

# do not run these test which fails on ci-worker-amd64-01 of
# ci.debian.net. we need to investigate this...
PYTEST_MATCH="not test_colormap.py"

for py in $(py3versions -s 2>/dev/null)
do cd "$AUTOPKGTEST_TMP"
   echo "Testing with $py:"
   HOME="$AUTOPKGTEST_TMP" SILX_OPENCL=False SILX_TEST_LOW_MEM=False $py -m pytest --tb=long -v -k "${PYTEST_MATCH}" --pyargs silx 2>&1
done
