#!/bin/sh

set -eu

# FIXME: THIS IS A MASSIVE HACK  and will probably break on upstream changes
cp runtests.py ${AUTOPKGTEST_TMP}
mkdir ${AUTOPKGTEST_TMP}/simple_history2
touch ${AUTOPKGTEST_TMP}/simple_history2/__init__.py
cp -r simple_history/tests ${AUTOPKGTEST_TMP}/simple_history2/
cp -r simple_history/registry_tests/ ${AUTOPKGTEST_TMP}/simple_history2/
find ${AUTOPKGTEST_TMP} -type f -exec sed -i -e 's/simple_history\.tests/simple_history2.tests/g; s/simple_history\.registry_tests/simple_history2.registry_tests/g' '{}' ';'
sed -i -e 's/"simple_history",/"simple_history2", &/' ${AUTOPKGTEST_TMP}/runtests.py


cd ${AUTOPKGTEST_TMP}
python3 runtests.py
