#! /bin/bash

# Some tests fail intermittently or consistently on some
# architectures; we therefore perform a per-architecture exclusion.
# This script is called from both debian/rules and from the
# autopkgtest suite.

arch=$(dpkg --print-architecture)

if [ $arch = mipsel -o $arch = mips64el -o $arch = armel ]
then
    EXCLUDES=(
        tests_python/test_debugger.py::test_attach_to_pid_no_threads[True]
        tests_python/test_debugger.py::test_case_django_a
        tests_python/test_debugger.py::test_case_django_b
        tests_python/test_debugger.py::test_case_django_invalid_template_exception_breakpoint
        tests_python/test_debugger.py::test_case_django_no_attribute_exception_breakpoint
        tests_python/test_debugger.py::test_case_django_no_attribute_exception_breakpoint_and_regular_exceptions
        tests_python/test_debugger.py::test_case_django_no_var_error
        tests_python/test_debugger.py::test_case_django_template_inherits_no_exception
        tests_python/test_debugger.py::test_case_flask
        tests_python/test_debugger.py::test_gevent_show_paused_greenlets[True]
        tests_python/test_debugger_json.py::test_attach_to_pid[True]
	tests_python/test_debugger_json.py::test_case_django_line_validation
        tests_python/test_debugger_json.py::test_case_django_no_attribute_exception_breakpoint
        tests_python/test_debugger_json.py::test_case_flask_line_validation
    )
elif [ $arch = ppc64el ]
then
    EXCLUDES=(
	tests_python/test_debugger_json.py::test_code_reload
    )
else
    EXCLUDES=()
fi

DESELECTS=()
for test in "${EXCLUDES[@]}"
do
    DESELECTS+=("--deselect=$test")
done

echo ${DESELECTS[*]}
