#!/bin/sh

set -e

test_import() {
    module=$1
    [ -n "$module" ]

    # By default, test on all versions
    versions="-r"
    if [ "$2" = default ] ; then
        versions="-d"
    fi
    for py in $(py3versions $versions 2>/dev/null) ; do
        cd "$AUTOPKGTEST_TMP"
        echo "Testing $module with $py:"
        $py -c "import $module; print($module)"
    done
}

# csnd6 is only built for the default version
test_import ctcsound
test_import csnd6 default
