#!/bin/sh
set -e -u

# Make the tests use the API specified
export QT_API=$1
export PYTEST_QT_API=$1

cp -a example.py qtawesome/tests "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"

for py in $(py3versions -s)
do
    echo ">>>> Testing unit tests with $py:"
    $py -m pytest tests
    # example.py, and so probably qtawesome itself, is currently broken:
    # see https://github.com/spyder-ide/qtawesome/issues/284
    # echo ">>>> Running example.py with $py:"
    # xvfb-run -a -s "-screen 0 1024x768x24 +extension GLX" $py example.py
done
