#!/bin/sh
set -efu

# on arm/ppc64el this produces a massive 2.5 GB log file, disable for now
arch=`uname -m`
[ $arch = x86_64 ] || [ $arch = i686 ] || {
    echo "Skipping test until the massive stdout log gets fixed"
    exit 0
}

pythons="$(pyversions -r)"
cp -a c testing "$ADTTMP"

# Not appropriate:
rm "$ADTTMP"/testing/test_version.py

# Delete any stale __pycache__s
find "$ADTTMP" -name '__pycache__' -print0 | xargs -0 rm -rf

cd "$ADTTMP"
for py in $pythons; do
	echo "======= $py ======="
	$py -m pytest c testing
	echo "======= $py-dbg ======="
	$py-dbg -m pytest c testing 2>&1
done
