#!/bin/bash

set -e

patch -p1 < debian/tests-patches/autopkgtest_nobuild 2>&1 || true

PYVERS="$(py3versions --supported --version 2> /dev/null)"

mv pocketsphinx pocketsphinx_disabled 2>&1 || true

fail=0
for pyver in $PYVERS; do
  echo "====================  configure with PYTHON $pyver =================="
  python$pyver setup.py test
done

mv pocketsphinx_disabled pocketsphinx

patch -p1 -R < debian/tests-patches/autopkgtest_nobuild
