#! /bin/bash
#
# debian/tests/module-scripts
# Part of Debian ‘python-coverage’ package.
#
# Copyright © 2016 Ben Finney <bignose@debian.org>
# This is free software; you may copy, modify, and/or distribute this work
# under the terms of the Expat license as published by James Clark.
# No warranty expressed or implied.
#
# Simple test for module scripts.

set -o errexit
set -o errtrace
set -o nounset

COMMAND_TEMPLATE='python%s -m coverage'

versions=(
        ''
        '3' '2'
        $(py3versions --version --supported)
        $(pyversions --version --supported)
)

test_input_path="$(mktemp -t --suffix=".py")"
cat > "$test_input_path" <<_EOF_
print("Hello, world!")
_EOF_

for ver in "${versions[@]}" ; do
    command="$(printf "$COMMAND_TEMPLATE" "$ver")"
    printf "Module script: ‘%s’\n" "$command"
    echo $command run "$test_input_path"
    printf "\n"
done


# Local variables:
# coding: utf-8
# mode: shell-script
# End:
# vim: fileencoding=utf-8 filetype=sh :
