#!/bin/sh

set -e

# The upstream unit tests ship inside the installed package
# (cobs.cobs.test and cobs.cobsr.test), so there is nothing to copy.
# Run from a scratch directory to test the installed package.
cd "$AUTOPKGTEST_TMP"

for py in $(py3versions -s); do
    echo "[*] testing $py:"
    $py -c 'import cobs.cobs, cobs.cobsr; assert cobs.cobs._using_extension and cobs.cobsr._using_extension, "C extension not in use"'
    $py -m unittest cobs.cobs.test cobs.cobsr.test 2>&1
done
