#!/bin/sh
set -efu

export HOME="$ADTTMP"
export LC_ALL=C.UTF-8
export PYTHONPATH=/usr/share/beets

pythons="$(py3versions -r)"

cp -a test $ADTTMP
cd "$ADTTMP"

# The tests assume beetsplug is found above them, and do unspeakable evil with
# __path__ to ensure that their local beetsplug is used.
ln -s /usr/share/beets/beetsplug .

for python in $pythons; do
	echo "=== $python ==="
	$python -m unittest discover -p 'test_*' 2>&1
done
