#!/bin/sh

set -e -u
cp -a pydoctor "${AUTOPKGTEST_TMP}"

PYTEST_OPTIONS="-k \
    not test_c_module_python_module_name_clash and \
    not test_c_module_text_signature and \
    not test_cyclic_imports_base_classes and \
    not test_expressions_parens and \
    not test_unquote_naughty_quoted_strings \
"

for py3vers in $(py3versions -s); do
    echo
    echo "***************************"
    echo "*** Testing with ${py3vers}"
    echo "***************************"
    echo
    cd ${AUTOPKGTEST_TMP} && \
        echo "Content of current working folder:\n" && \
        ls -la && \
        echo "Running tests...\n" && \
        PYTHONPATH=. "${py3vers}" -X dev -m pytest -vv pydoctor/test "${PYTEST_OPTIONS}" && \
            rm -rf .pytest_cache .hypothesis || exit 1
done

echo

exit 0
